The dynamic portion of the hook name, $post_type, refers to the post type. Possible hook names include: <ul> <li>theme_post_templates</li> <li>theme_page_templates</li> <li>theme_attachment_templates</li> </ul>
Parameters
$post_templatesstring[]
Array of template header names keyed by the template file name.
$themeWP_Theme
The theme object.
$postWP_Post|null
The post being edited, provided for context, or null.
1428*1429* @param string[]$post_templatesArray of template header names keyed by the template file name.1430* @param WP_Theme$theme The theme object.1431* @param WP_Post|null$post The post being edited, provided for context,ornull.1432* @param string$post_type Post type to get the templates for.1433*/1434$post_templates=(array)apply_filters("theme_{$post_type}_templates",$post_templates,$this,$post,$post_type);14351436return$post_templates;1437}14381439/**1440* Scans a directory for files of a certain extension.
History
Introduced in 3.9.0. Unchanged from 6.7.7 through 7.1.0.