diff --git src/bp-core/bp-core-template-loader.php src/bp-core/bp-core-template-loader.php
index 46ef7a6..09e79c5 100644
|
|
|
function bp_get_template_stack() { |
| 212 | 212 | $wp_current_filter[] = $tag; |
| 213 | 213 | |
| 214 | 214 | // Sort |
| 215 | | if ( ! isset( $merged_filters[ $tag ] ) ) { |
| 216 | | ksort( $wp_filter[$tag] ); |
| 217 | | $merged_filters[ $tag ] = true; |
| | 215 | if ( class_exists( 'WP_Hook' ) ) { |
| | 216 | $filter = $wp_filter[ $tag ]->callbacks; |
| | 217 | } else { |
| | 218 | $filter = &$wp_filter[ $tag ]; |
| | 219 | |
| | 220 | if ( ! isset( $merged_filters[ $tag ] ) ) { |
| | 221 | ksort( $filter ); |
| | 222 | $merged_filters[ $tag ] = true; |
| | 223 | } |
| 218 | 224 | } |
| 219 | 225 | |
| 220 | 226 | // Ensure we're always at the beginning of the filter array |
| 221 | | reset( $wp_filter[ $tag ] ); |
| | 227 | reset( $filter ); |
| 222 | 228 | |
| 223 | 229 | // Loop through 'bp_template_stack' filters, and call callback functions |
| 224 | 230 | do { |
| 225 | | foreach( (array) current( $wp_filter[$tag] ) as $the_ ) { |
| | 231 | foreach( (array) current( $filter ) as $the_ ) { |
| 226 | 232 | if ( ! is_null( $the_['function'] ) ) { |
| 227 | 233 | $args[1] = $stack; |
| 228 | 234 | $stack[] = call_user_func_array( $the_['function'], array_slice( $args, 1, (int) $the_['accepted_args'] ) ); |
| 229 | 235 | } |
| 230 | 236 | } |
| 231 | | } while ( next( $wp_filter[$tag] ) !== false ); |
| | 237 | } while ( next( $filter ) !== false ); |
| 232 | 238 | |
| 233 | 239 | // Remove 'bp_template_stack' from the current filter array |
| 234 | 240 | array_pop( $wp_current_filter ); |