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_5485', 10, 4 );
function filter_function_name_5485( $post_templates, $this, $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.

Список изменений

С версии 4.9.6 Введена.

Где вызывается хук

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

Где используется хук в ядре WP

Использование не найдено.