A WordPress-centric search engine for devs and theme authors



theme_{$post_type}_templates ›

Since4.7.0
Deprecatedn/a
apply_filters( "theme_{$post_type}_templates", $post_templates, $this, $post, $post_type )
Parameters: (4)
  • (array) $post_templates Array of page templates. Keys are filenames, values are translated names.
    Required: Yes
  • (WP_Theme) $this 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
Defined at:
Codex:

Filters list of page templates for a theme.

The dynamic portion of the hook name, $post_type, refers to the post type.





Source

return (array) apply_filters( "theme_{$post_type}_templates", $post_templates, $this, $post, $post_type );