Ticket #6230: bp-core-theme-compatibility.php.1424377688.diff
File bp-core-theme-compatibility.php.1424377688.diff, 783 bytes (added by , 10 years ago) |
---|
-
bp-core-theme-compatibility.php
453 453 * properties of {@link WP_Post}; see that class for more details. 454 454 */ 455 455 function bp_theme_compat_reset_post( $args = array() ) { 456 global $wp_query, $post; 456 global $wp_query, $post, $bp; 457 458 // set proper page ID if one exists in $bp->pages and $args['ID'] is empty 459 if ( empty( $args['ID'] ) ) { 460 foreach ( $bp->pages AS $page ) { 461 if ( $page->name == $bp->unfiltered_uri[$bp->unfiltered_uri_offset] ) { 462 $args['ID'] = $page->id; 463 break; 464 } 465 } 466 } 457 467 458 468 // Switch defaults if post is set 459 469 if ( isset( $wp_query->post ) ) {