Changeset 9306
- Timestamp:
- 01/07/2015 08:15:06 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-template-loader.php
r8463 r9306 443 443 */ 444 444 function bp_get_theme_compat_templates() { 445 $page_id = 0; 446 $page_template = array(); 447 448 // Get the WordPress Page ID for the current view. 449 foreach ( (array) buddypress()->pages as $component => $bp_page ) { 450 451 // Handles the majority of components. 452 if ( bp_is_current_component( $component ) ) { 453 $page_id = (int) $bp_page->id; 454 } 455 456 // Stop if not on a user page. 457 if ( ! bp_is_user() && ! empty( $page_id ) ) { 458 break; 459 } 460 461 // The Members component requires an explicit check due to overlapping components. 462 if ( bp_is_user() && 'members' === $component ) { 463 $page_id = (int) $bp_page->id; 464 break; 465 } 466 } 467 445 468 $templates = array( 446 469 'plugin-buddypress.php', … … 452 475 'index.php' 453 476 ); 477 478 // If the Page has a Page Template set, use that. 479 if ( $page_id ) { 480 $template_file = get_page_template_slug( $page_id ); 481 482 if ( $template_file ) { 483 $templates = array( $template_file ); 484 } 485 } 486 454 487 return bp_get_query_template( 'buddypress', $templates ); 455 488 }
Note: See TracChangeset
for help on using the changeset viewer.