Files
Filename | Hook Type | Line Number | PHP Doc |
---|---|---|---|
wp-includes/class-wp-theme.php | apply_filters | 1349 | /** * Filters list of page templates for a theme. * * The dynamic portion of the hook name, `$post_type`, refers to the post type. * * Possible hook names include: * * - `theme_post_templates` * - `theme_page_templates` * - `theme_attachment_templates` * * @since 3.9.0 * @since 4.4.0 Converted to allow complete control over the `$page_templates` array. * @since 4.7.0 Added the `$post_type` parameter. * * @param string[] $post_templates Array of template header names keyed by the template file name. * @param WP_Theme $theme The theme object. * @param WP_Post|null $post The post being edited, provided for context, or null. * @param string $post_type Post type to get the templates for. */ |
Hook Parameters
Parameter Type | Name | Description |
---|---|---|
string[] | $post_templates | Array of template header names keyed by the template file name. |
WP_Theme | $theme | The theme object. |
WP_Post|null | $post | The post being edited, provided for context, or null. |
string | $post_type | Post type to get the templates for. |