BP_Media_Theme_Compat::single_template_hierarchy( string $templates )
Add custom template hierarchy to theme compat for media permalink pages.
Description
This is to mirror how WordPress has template hierarchy.
Parameters
- $templates
-
(Required) The templates from bp_get_theme_compat_templates().
Return
(array) $templates Array of custom templates to look for.
Source
File: bp-media/classes/class-bp-media-theme-compat.php
public function single_template_hierarchy( $templates ) {
/**
* Filters the template hierarchy for the media permalink pages.
*
* @since BuddyBoss 1.0.0
*
* @param array $index Array holding template names to be merged into template list.
*/
$new_templates = apply_filters( 'bp_template_hierarchy_media_single_item', array(
'media/single/index.php'
) );
// Merge new templates with existing stack
// @see bp_get_theme_compat_templates().
$templates = array_merge( (array) $new_templates, $templates );
return $templates;
}
Changelog
| Version | Description |
|---|---|
| BuddyBoss 1.0.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.