WordPress at a glance
filter is not described

theme_(post_type)_templates filter-hook . WP 3.9.0

Filters list of page templates for a theme.

The dynamic portion of the hook name, $post_type, refers to the post type.

Usage

add_filter( 'theme_(post_type)_templates', 'filter_function_name_7525', 10, 4 );
function filter_function_name_7525( $post_templates, $this, $post, $post_type ){
	// filter...

	return $post_templates;
}
$post_templates(array)
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.

Notes

  • Since 4.4.0 Converted to allow complete control over the $page_templates array.
  • Since 4.7.0 Added the $post_type parameter.

Where the hook is called

WP_Theme::get_page_templates()
theme_(post_type)_templates
wp-includes/class-wp-theme.php 1099
$post_templates = (array) apply_filters( "theme_{$post_type}_templates", $post_templates, $this, $post, $post_type );

Where the hook is used (in WP core)

Does not used.