BP_Registration_Theme_Compat:: template_hierarchy (字符串美元的模板)
为注册/激活页面添加模板层次结构到主题compat。
描述
这是WordPress的镜像模板的层次结构.
参数
- 美元的模板
-
(字符串)(必需)的模板bp_get_theme_compat_templates ().
返回
(数组)要查找的自定义模板数组。
源
文件:bp-members /类/ class-bp-registration-theme-compat.php
Public function template_hierarchy($templates) {$component = sanitize_file_name(bp_current_component());/** *为主题compat和注册/激活页面过滤模板层次结构。* *这个过滤器是一个变量过滤器,取决于当前使用的组件。* * @since BuddyPress 1.8.0 * * @param array $value要添加到层次结构中的模板路径数组。*/ $new_templates = apply_filters("bp_template_hierarchy_{$component}", array("members/index-{$component}.php"));//将新模板与现有的栈合并$templates = array_merge((array) $new_templates, $templates);返回$模板;}
更新日志
版本 | 描述 |
---|---|
BuddyPress 1.8.0 | 介绍了。 |