WordPress как на ладони
Очень Удобный и Быстрый Хостинг для сайтов на WordPress. Пользуюсь сам и вам рекомендую!
фильтр не описан

(type)_template хук-фильтр . WP 1.5.0

Filters the path of the queried template by type.

Ищем WP-разработчика! Фулл-тайм, удаленка, хорошая зарплата, соц. пакет. Подробности.
Компания Boosta.

The dynamic portion of the hook name, $type, refers to the filename -- minus the file extension and any non-alphanumeric characters delimiting words -- of the file to load. This hook also applies to various types of files loaded as part of the Template Hierarchy.

Possible hook names include:

  • 404_template
  • archive_template
  • attachment_template
  • author_template
  • category_template
  • date_template
  • embed_template
  • frontpage_template
  • home_template
  • index_template
  • page_template
  • paged_template
  • privacypolicy_template
  • search_template
  • single_template
  • singular_template
  • tag_template
  • taxonomy_template


add_filter( '(type)_template', 'filter_function_name_6865', 10, 3 );
function filter_function_name_6865( $template, $type, $templates ){
	// filter...

	return $template;
Path to the template. See locate_template().
Sanitized filename without extension.
A list of template candidates, in descending order of priority.

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

С версии 1.5.0 Введена.
С версии 4.8.0 The $type and $templates parameters were added.

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

wp-includes/template.php 103
return apply_filters( "{$type}_template", $template, $type, $templates );

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

wp-includes/blocks/post-template.php 88
add_action( 'init', 'register_block_core_post_template' );
wp-includes/class-wp-customize-manager.php 676
add_filter( 'template', array( $this, 'get_template' ) );
wp-includes/class-wp-customize-manager.php 682
add_filter( 'pre_option_template', array( $this, 'get_template' ) );
wp-includes/class-wp-customize-manager.php 714
remove_filter( 'template', array( $this, 'get_template' ) );
wp-includes/class-wp-customize-manager.php 720
remove_filter( 'pre_option_template', array( $this, 'get_template' ) );
wp-includes/class-wp-customize-nav-menus.php 65
add_action( 'customize_controls_print_footer_scripts', array( $this, 'available_items_template' ) );
wp-includes/customize/class-wp-customize-header-image-control.php 107
add_action( 'customize_controls_print_footer_scripts', array( $this, 'print_header_image_template' ) );