wpseek.com
WordPress开发者和主题制作者的搜索引擎



theme_templates › WordPress过滤钩子

Since4.9.6
已弃用n/a
apply_filters( 'theme_templates', $post_templates, $this, $post, $post_type )
参数: (4)
  • (string[]) $post_templates Array of template header names keyed by the template file name.
    Required: Yes
  • (WP_Theme) $theme The theme object.
    Required: Yes
  • (WP_Post|null) $post The post being edited, provided for context, or null.
    Required: Yes
  • (string) $post_type Post type to get the templates for.
    Required: Yes
定义在:
文档:

Filters list of page templates for a theme.





源码

$post_templates = (array) apply_filters( 'theme_templates', $post_templates, $this, $post, $post_type );