Changeset 6549 for trunk/src/includes/core/template-functions.php
- Timestamp:
- 06/15/2017 02:50:58 AM (9 years ago)
- File:
-
- 1 edited
-
trunk/src/includes/core/template-functions.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/core/template-functions.php
r6532 r6549 408 408 $type = preg_replace( '|[^a-z0-9-]+|', '', $type ); 409 409 410 // Fallback template 410 411 if ( empty( $templates ) ) { 411 412 $templates = array( "{$type}.php" ); 412 413 } 413 414 414 // Filter possible templates, try to match one, and set any bbPress theme 415 // compat properties so they can be cross-checked later. 415 // Filter possible templates 416 416 $templates = apply_filters( "bbp_get_{$type}_template", $templates ); 417 $templates = bbp_set_theme_compat_templates( $templates ); 418 $template = bbp_locate_template( $templates ); 419 $template = bbp_set_theme_compat_template( $template ); 417 418 // Stash the possible templates for this query, for later use 419 bbp_set_theme_compat_templates( $templates ); 420 421 // Try to locate a template in the stack 422 $template = bbp_locate_template( $templates ); 423 424 // Stash the located template for this query, for later use 425 bbp_set_theme_compat_template( $template ); 420 426 421 427 // Filter & return 422 return apply_filters( "bbp_{$type}_template", $template );428 return apply_filters( "bbp_{$type}_template", $template, $templates ); 423 429 } 424 430 … … 429 435 * 430 436 * @param array $templates Templates we are looking for 431 * @return array Possible sub folders to look in437 * @return array Possible subdirectories to look in 432 438 */ 433 439 function bbp_get_template_locations( $templates = array() ) { … … 464 470 465 471 // Filter & return 466 return apply_filters( 'bbp_add_template_stack_locations', array_unique( $retval ), $stacks );472 return (array) apply_filters( 'bbp_add_template_stack_locations', array_unique( $retval ), $stacks ); 467 473 } 468 474
Note: See TracChangeset
for help on using the changeset viewer.