Changeset 6439 for trunk/bp-core/bp-core-template-loader.php
- Timestamp:
- 10/22/2012 07:08:52 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-template-loader.php
r6394 r6439 67 67 $fallback_theme = bp_get_theme_compat_dir(); 68 68 69 // Allow templates to be filtered 70 // BuddyPress core automatically adds bp_add_template_locations() 71 $template_names = apply_filters( 'bp_locate_template', $template_names ); 72 69 73 // Try to find a template file 70 74 foreach ( (array) $template_names as $template_name ) { … … 88 92 89 93 // Check theme compatibility last 90 } else { 91 // 3rd-party plugin devs can hook into the 'bp_locate_fallback_template' 92 // filter to load custom templates for their component if desired 93 $fallback_template = apply_filters( 'bp_locate_fallback_template', trailingslashit( $fallback_theme ) . $template_name, $template_name ); 94 95 if ( file_exists( $fallback_template ) ) { 96 $located = $fallback_template; 97 break; 98 } 94 } elseif ( file_exists( trailingslashit( $fallback_theme ) . $template_name ) ) { 95 $located = trailingslashit( $fallback_theme ) . $template_name; 96 break; 99 97 } 100 98 } … … 204 202 205 203 // Loop through locations and templates and combine 206 foreach ( $locations as $location )207 foreach ( $templates as $template )208 $retval[] = trailingslashit( $location ) . $template;204 foreach ( (array) $locations as $location ) 205 foreach ( (array) $templates as $template ) 206 $retval[] = ltrim( trailingslashit( $location ) . $template, '/' ); 209 207 210 208 return apply_filters( 'bp_add_template_locations', $retval, $templates );
Note: See TracChangeset
for help on using the changeset viewer.