Ticket #4656: bp_locate_template.01.patch
File bp_locate_template.01.patch, 2.1 KB (added by , 12 years ago) |
---|
-
bp-core/bp-core-filters.php
add_filter( 'bp_template_include', 'bp_template_include_theme_supports', 2, 1 ); 62 62 add_filter( 'bp_template_include', 'bp_template_include_theme_compat', 4, 2 ); 63 63 64 64 // Run all template parts through additional template locations 65 add_filter( 'bp_locate_template', 'bp_add_template_locations' );66 65 add_filter( 'bp_get_template_part', 'bp_add_template_locations' ); 67 66 68 67 // Turn comments off for BuddyPress pages -
bp-core/bp-core-template-loader.php
function bp_locate_template( $template_names, $load = false, $require_once = tru 64 64 $located = false; 65 65 $template_locations = bp_get_template_stack(); 66 66 67 // Try to find a template file68 foreach ( (array) $template_ names as $template_name) {67 // Loop through template stack 68 foreach ( (array) $template_locations as $template_location ) { 69 69 70 // Continue if templateis empty71 if ( empty( $template_ name) )70 // Continue if $template_location is empty 71 if ( empty( $template_location ) ) 72 72 continue; 73 73 74 // Tr im off any slashes from the template name75 $template_name = ltrim( $template_name, '/' );74 // Try to find a template file 75 foreach ( (array) $template_names as $template_name ) { 76 76 77 // Loop through template stack 78 foreach ( (array) $template_locations as $template_location ) { 79 80 // Continue if $template_location is empty 81 if ( empty( $template_location ) ) 77 // Continue if template is empty 78 if ( empty( $template_name ) ) 82 79 continue; 83 80 84 // Check child theme first 81 // Trim off any slashes from the template name 82 $template_name = ltrim( $template_name, '/' ); 83 84 // See if template exists 85 85 if ( file_exists( trailingslashit( $template_location ) . $template_name ) ) { 86 86 $located = trailingslashit( $template_location ) . $template_name; 87 87 break 2;