Skip to:
Content

BuddyPress.org

Ticket #6444: bp-core-load-templates.patch

File bp-core-load-templates.patch, 2.2 KB (added by lenasterg, 9 years ago)
  • src/bp-core/bp-core-catchuri.php

     
    367367 *   bp_core_load_template( 'members/index' );
    368368 * Loads:
    369369 *   wp-content/themes/[activated_theme]/members/index.php
     370 * or
     371 *      wp-content/themes/[activated_theme]/[buddypress or community]/members/index.php
    370372 *
    371373 * @param array $templates Array of templates to attempt to load.
    372374 * @return bool|null Returns false on failure.
     
    391393                $filtered_templates[] = $template . '.php';
    392394        }
    393395
    394         // Only perform template lookup for bp-default themes
     396        // Only perform template lookup for themes with the buddypress pages inside them
    395397        if ( ! bp_use_theme_compat_with_current_theme() ) {
    396                 $template = locate_template( (array) $filtered_templates, false );
     398                $template = bp_locate_template( (array) $filtered_templates, false );
    397399
    398400        // Theme compat doesn't require a template lookup
    399401        } else {
  • src/bp-core/bp-core-theme-compatibility.php

     
    310310 *    not been updated for BP 1.7+; we make the assumption that any theme in
    311311 *    this category will have the members-loop.php template, and so use its
    312312 *    presence as an indicator that theme compatibility is not required
    313  *
     313 * 4) A legacy template is found at buddypress/members/members-loop.php or at buddypress/members/members-loop.php
    314314 * @since BuddyPress (1.9.0)
    315315 *
    316316 * @return bool True if the current theme needs theme compatibility.
     
    337337                // Examples are clones of bp-default
    338338                } elseif ( locate_template( 'members/members-loop.php', false, false ) ) {
    339339                        $theme_compat = false;
     340               
     341                // For themes using the guidelines from https://codex.buddypress.org/themes/theme-compatibility-1-7/a-quick-look-at-1-7-theme-compatibility/#overloading-template-compatibility-theme-files
     342                } elseif ( bp_locate_template( 'members/members-loop.php', false, false ) ) {
     343                        $theme_compat = false;
    340344                }
    341345        }
    342346