WordPress at a glance
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_7308', 10, 4 );
function filter_function_name_7308( $post_templates, $this, $post, $post_type ){
	// filter...

	return $post_templates;
Array of page templates. Keys are filenames, values are translated names.
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 1257
$post_templates = (array) apply_filters( 'theme_templates', $post_templates, $this, $post, $post_type );

Where the hook is used (in WP core)

Usage not found!