Changeset 9322 for trunk/src/bp-core/bp-core-catchuri.php
- Timestamp:
- 01/09/2015 12:39:36 AM (11 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-core/bp-core-catchuri.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-catchuri.php
r9315 r9322 343 343 global $wp_query; 344 344 345 // check if BP page belongs to, or is a child of, a BP directory page 346 $page_id = false; 347 foreach ( (array) buddypress()->pages as $page ) { 348 if ( $page->name == buddypress()->unfiltered_uri[buddypress()->unfiltered_uri_offset] ) { 349 $page_id = $page->id; 350 break; 351 } 352 } 353 354 // Set up reset post args 355 $reset_post_args = array( 345 // Reset the post 346 bp_theme_compat_reset_post( array( 347 'ID' => 0, 356 348 'is_404' => true, 357 349 'post_status' => 'publish', 358 ); 359 360 // BP page exists - fill in the $wp_query->post object 361 // 362 // bp_theme_compat_reset_post() looks at the $wp_query->post object to fill in 363 // the post globals 364 if ( ! empty( $page_id ) ) { 365 $wp_query->post = get_post( $page_id ); 366 $reset_post_args['ID'] = $page_id; 367 } else { 368 $reset_post_args['ID'] = 0; 369 } 370 371 // Reset the post 372 bp_theme_compat_reset_post( $reset_post_args ); 350 ) ); 373 351 374 352 // Set theme compat to false since the reset post function automatically sets … … 394 372 $located_template = apply_filters( 'bp_located_template', $template, $filtered_templates ); 395 373 if ( !empty( $located_template ) ) { 396 397 374 // Template was located, lets set this as a valid page and not a 404. 398 375 status_header( 200 );
Note: See TracChangeset
for help on using the changeset viewer.