Changeset 13441 for trunk/src/bp-core/classes/class-bp-core.php
- Timestamp:
- 03/23/2023 07:35:38 PM (18 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/classes/class-bp-core.php
r13432 r13441 292 292 // Is the logged in user is a mod for the current item? 293 293 bp_update_is_item_mod( false, 'core' ); 294 295 /* 296 * As the BP Core component is excluded from the BP Component code 297 * used to set the Rewrite IDs, we need to set it here. As the `search` 298 * word is already a WordPress rewrite tag, we are not adding a custom 299 * rule for this component to avoid messing with it. 300 */ 301 $this->rewrite_ids = array( 302 'community_search' => 'bp_search', 303 ); 294 304 295 305 parent::setup_globals( … … 401 411 402 412 parent::register_post_statuses(); 413 } 414 415 /** 416 * Parse the WP_Query and eventually set the BP Search mechanism. 417 * 418 * Search doesn't have an associated page, so we check for it separately. 419 * 420 * @since 12.0.0 421 * 422 * @param WP_Query $query Required. See BP_Component::parse_query() for 423 * description. 424 */ 425 public function parse_query( $query ) { 426 $is_search = $query->get( 'pagename' ) === bp_get_search_slug() || ( isset( $_GET['bp_search'] ) && 1 === (int) $_GET['bp_search'] ); 427 428 if ( isset( $_POST['search-terms'] ) && $is_search ) { 429 buddypress()->current_component = bp_get_search_slug(); 430 } 431 432 parent::parse_query( $query ); 403 433 } 404 434
Note: See TracChangeset
for help on using the changeset viewer.