apply_filters( ‘theme_templates’, string[] $post_templates, WP_Theme $theme, WP_Post|null $post, string $post_type )

In this article

Filters list of page templates for a theme.

Parameters

$post_templatesstring[]
Array of template header names keyed by the template file name.
$themeWP_Theme
The theme object.
$postWP_Post|null
The post being edited, provided for context, or null.
$post_typestring
Post type to get the templates for.

Source

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

Changelog

VersionDescription
4.9.6Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.