Skip to:
Content

BuddyPress.org

Changeset 8461


Ignore:
Timestamp:
05/31/2014 04:20:30 PM (11 years ago)
Author:
johnjamesjacoby
Message:

In bp_register_template_stack() wrap function_exists() check with is_array() check. Allows class methods to be used as a callback for adding new template stack locations. Fixes #5671.

File:
1 edited

Legend:

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

    r7842 r8461  
    125125 * @todo Make 'callable' instead of 'function'.
    126126 *
    127  * @param string $location Callback function that returns the stack location.
     127 * @param string $location_callback Callback function that returns the stack location.
    128128 * @param int $priority Optional. The priority parameter as passed to
    129129 *        add_filter(). Default: 10.
     
    133133
    134134    // Bail if no location, or function does not exist
    135     if ( empty( $location_callback ) || ! function_exists( $location_callback ) )
     135    if ( empty( $location_callback ) ) {
    136136        return false;
     137    }
     138
     139    // Bail if callback function does not exist
     140    if ( ! is_array( $location_callback ) ) {
     141        if ( ! function_exists( $location_callback ) ) {
     142            return false;
     143        }
     144    }
    137145
    138146    // Add location callback to template stack
     
    147155 * @see bp_register_template_stack()
    148156 *
    149  * @param string $location Callback function that returns the stack location.
     157 * @param string $location_callback Callback function that returns the stack location.
    150158 * @param int $priority Optional. The priority parameter passed to
    151159 *        {@link bp_register_template_stack()}. Default: 10.
Note: See TracChangeset for help on using the changeset viewer.