Skip to:
Content

BuddyPress.org

Changeset 6329


Ignore:
Timestamp:
09/11/2012 06:45:56 PM (11 years ago)
Author:
johnjamesjacoby
Message:

Theme Compat:

  • Use theme directory functions instead of constants in bp_locate_template().
File:
1 edited

Legend:

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

    r6300 r6329  
    7373        // Trim off any slashes from the template name
    7474        $template_name = ltrim( $template_name, '/' );
     75        $child_theme    = get_stylesheet_directory();
     76        $parent_theme   = get_template_directory();
     77        $fallback_theme = bp_get_theme_compat_dir();
    7578
    7679        // Check child theme first
    77         if ( file_exists( trailingslashit( STYLESHEETPATH ) . $template_name ) ) {
    78             $located = trailingslashit( STYLESHEETPATH ) . $template_name;
     80        if ( file_exists( trailingslashit( $child_theme ) . $template_name ) ) {
     81            $located = trailingslashit( $child_theme ) . $template_name;
    7982            break;
    8083
    8184        // Check parent theme next
    82         } elseif ( file_exists( trailingslashit( TEMPLATEPATH ) . $template_name ) ) {
    83             $located = trailingslashit( TEMPLATEPATH ) . $template_name;
     85        } elseif ( file_exists( trailingslashit( $parent_theme ) . $template_name ) ) {
     86            $located = trailingslashit( $child_theme ) . $template_name;
    8487            break;
    8588
    8689        // Check theme compatibility last
    87         } elseif ( file_exists( trailingslashit( bp_get_theme_compat_dir() ) . $template_name ) ) {
    88             $located = trailingslashit( bp_get_theme_compat_dir() ) . $template_name;
     90        } elseif ( file_exists( trailingslashit( $fallback_theme ) . $template_name ) ) {
     91            $located = trailingslashit( $fallback_theme ) . $template_name;
    8992            break;
    9093        }
Note: See TracChangeset for help on using the changeset viewer.