wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



theme_{$post_type}_templates › WordPress Filter Hooks

Seit4.7.0
Veraltetn/v
apply_filters( "theme_{$post_type}_templates", $post_templates, $this, $post, $post_type )
Parameter: (4)
  • (string[]) $post_templates Array of template header names keyed by the template file name.
    Erforderlich: Ja
  • (WP_Theme) $theme The theme object.
    Erforderlich: Ja
  • (WP_Post|null) $post The post being edited, provided for context, or null.
    Erforderlich: Ja
  • (string) $post_type Post type to get the templates for.
    Erforderlich: Ja
Definiert in:
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




Quellcode

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