wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



theme_{$post_type}_templates › Les Filtres WordPress

Depuis4.7.0
Dépréciéen/a
apply_filters( "theme_{$post_type}_templates", $post_templates, $this, $post, $post_type )
Paramètres: (4)
  • (string[]) $post_templates Array of template header names keyed by the template file name.
    Requis: Oui
  • (WP_Theme) $theme The theme object.
    Requis: Oui
  • (WP_Post|null) $post The post being edited, provided for context, or null.
    Requis: Oui
  • (string) $post_type Post type to get the templates for.
    Requis: Oui
Défini(e) dans:
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




Source

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