Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/05/2016 09:24:03 PM (8 years ago)
Author:
offereins
Message:

Stop locating an empty set of templates.

Bail early in bp_locate_template() when there are no files to look for.
This prevents PHP from showing errors when an empty array is provided. Use
case for this is when by hooking into the bp_get_template_part filter
you'd like to prevent the locating of a template.

Fixes #7149.

File:
1 edited

Legend:

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

    r10899 r11267  
    9797 */
    9898function bp_locate_template( $template_names, $load = false, $require_once = true ) {
     99
     100    // Bail when there are no templates to locate
     101    if ( empty( $template_names ) ) {
     102        return false;
     103    }
    99104
    100105    // No file found yet.
Note: See TracChangeset for help on using the changeset viewer.