apply_filters( 'theme_page_templates', array $page_templates , WP_Theme $this , WP_Post|null $post )
Filters list of page templates for a theme.
Description Description
Parameters Parameters
Source Source
Changelog Changelog
Version | Description |
---|---|
4.4.0 | Converted to allow complete control over the $page_templates array. |
3.9.0 | Introduced. |
User Contributed Notes User Contributed Notes
You must log in before being able to contribute a note or feedback.
Filter page templates by blog id
Suppose you have the blog `Food` with the id 2 and the template `page-food.php` which should only be used for this blog. The example below removes the page template from dropdowns of other blogs:
Expand full source codeCollapse full source code