W3cubDocs

/WordPress

apply_filters( 'theme_templates', string[] $post_templates, WP_Theme $this, WP_Post|null $post, string $post_type )

Filters list of page templates for a theme.

Description

Parameters

$post_templates

(string[]) Array of page templates. Keys are filenames, values are translated names.

$this

(WP_Theme) The theme object.

$post

(WP_Post|null) The post being edited, provided for context, or null.

$post_type

(string) Post type to get the templates for.

Source

File: wp-includes/class-wp-theme.php

View on Trac

Changelog

Version Description
4.9.6 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/theme_templates