WordPress at Your Fingertips
filter is not described

theme_templates filter-hook . WP 4.9.6

Filters list of page templates for a theme.


add_filter( 'theme_templates', 'filter_function_name_7760', 10, 4 );
function filter_function_name_7760( $post_templates, $theme, $post, $post_type ){
	// filter...

	return $post_templates;
Array of template header names keyed by the template file name.
The theme object.
The post being edited, provided for context, or null.
Post type to get the templates for.


Since 4.9.6 Introduced.

Where the hook is called

wp-includes/class-wp-theme.php 1275
$post_templates = (array) apply_filters( 'theme_templates', $post_templates, $this, $post, $post_type );

Where in WP core the hook is used WordPress

Usage not found.