wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema



theme_{$post_type}_templates › Hooks de Filtros WordPress

Desde4.7.0
Obsoleton/a
apply_filters( "theme_{$post_type}_templates", $post_templates, $this, $post, $post_type )
Parâmetros: (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
Definido em:
Codex:

Filters list of page templates for a theme.

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

Possible hook names include:

  • theme_post_templates
  • theme_page_templates
  • theme_attachment_templates




Fonte

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