Skip to:
Content

Changeset 6490


Ignore:
Timestamp:
11/06/12 19:10:45 (18 months ago)
Author:
r-a-y
Message:

Theme Compat:

  • In bp_locate_template(), make sure templates placed in custom template

locations (as set in bp_add_template_locations()) are recognized.

  • Previously, the fallback template would stop the foreach loop from

checking the next available template because the fallback template will
always exist.

  • Now, the fallback template is moved out of the foreach loop and into a

separate one so all template locations are checked.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-template-loader.php

    r6462 r6490  
    7272 
    7373    // Try to find a template file 
     74    // Check the parent and child theme directories first 
    7475    foreach ( (array) $template_names as $template_name ) { 
    7576 
     
    9091            $located = trailingslashit( $parent_theme ) . $template_name; 
    9192            break; 
    92  
    93         // Check theme compatibility last 
    94         } elseif ( file_exists( trailingslashit( $fallback_theme ) . $template_name ) ) { 
    95             $located = trailingslashit( $fallback_theme ) . $template_name; 
    96             break; 
     93        } 
     94    } 
     95 
     96    // Check theme compatibility last if no template is found in the current theme 
     97    if ( empty( $located ) ) { 
     98        foreach ( (array) $template_names as $template_name ) { 
     99            if ( file_exists( trailingslashit( $fallback_theme ) . $template_name ) ) { 
     100                $located = trailingslashit( $fallback_theme ) . $template_name; 
     101                break; 
     102            } 
    97103        } 
    98104    } 
Note: See TracChangeset for help on using the changeset viewer.