Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/13/2014 02:00:53 AM (10 years ago)
Author:
r-a-y
Message:

In bp_core_load_template(), save a locate_template() call.

When the current theme isn't the bp-default theme (or a deriviative), we do
not need to attempt to find a bp-default template since it will not exist.

This saves us an unnecessary locate_template() call and a few
file_exists() checks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-catchuri.php

    r8738 r8820  
    373373    }
    374374
     375    // Only perform template lookup for bp-default themes
     376    if ( ! bp_use_theme_compat_with_current_theme() ) {
     377        $template = locate_template( (array) $filtered_templates, false );
     378
     379    // Theme compat doesn't require a template lookup
     380    } else {
     381        $template = '';
     382    }
     383
    375384    // Filter the template locations so that plugins can alter where they are located
    376     $located_template = apply_filters( 'bp_located_template', locate_template( (array) $filtered_templates, false ), $filtered_templates );
     385    $located_template = apply_filters( 'bp_located_template', $template, $filtered_templates );
    377386    if ( !empty( $located_template ) ) {
    378387
Note: See TracChangeset for help on using the changeset viewer.