[wp-trac] [WordPress Trac] #21891: Need ability to filter page templates
WordPress Trac
wp-trac at lists.automattic.com
Fri Sep 14 17:38:50 UTC 2012
#21891: Need ability to filter page templates
-----------------------------+-------------------------
Reporter: mrwweb | Type: enhancement
Status: new | Priority: normal
Milestone: Awaiting Review | Component: Template
Version: 3.4.2 | Severity: normal
Keywords: |
-----------------------------+-------------------------
The old way of removing a parent theme's templates (as documented
[http://wordpress.org/support/topic/removing-page-template-from-child-
theme?replies=3 here], [http://wordpress.stackexchange.com/questions/54054
/how-to-remove-a-parent-theme-template-from-quick-edit here], and
[http://stackoverflow.com/questions/9411612/wordpress-hiding-or-removing-
parent-themes-templates here]) broke with the big theme-handling rewrite
in 3.4.
The primary use case of a new filter would be to allow a child theme to
remove or rename a parent theme page template in the Dashboard. It's
possible that part of the `get_page_templates()` function might have to be
tweaked to allow for the scenario where one or more pages is using a
template that no longer "exists," but I'm not sure.
Hopefully this is as simple as adding `apply_filters( 'page_templates',
$page_templates );` somewhere in
[http://core.trac.wordpress.org/browser/trunk/wp-includes/class-wp-
theme.php#L920 class-wp-theme.php].
--
Ticket URL: <http://core.trac.wordpress.org/ticket/21891>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list