[wp-trac] [WordPress Trac] #20061: Preprocess get_page_templates() and store in a global

WordPress Trac wp-trac at lists.automattic.com
Fri Feb 17 15:40:50 UTC 2012


#20061: Preprocess get_page_templates() and store in a global
-------------------------+-----------------------------
 Reporter:  Master Jake  |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  General      |    Version:  3.3.1
 Severity:  normal       |   Keywords:
-------------------------+-----------------------------
 The get_page_templates() function is only defined in certain admin-only
 actions (as far as I can tell). I came across a situation recently where I
 needed this list on the client side during a page load. Sure I could copy
 the WordPress function or require_once the file it's in, but that's messy
 and I'm sure discouraged against for future-proof and backwards
 compatibility issues.

 It would be nice if WordPress preprocessed the list of valid, registered
 page templates in an early action and then stored that list in a new
 global (something like $wp_page_templates maybe?).

 Thoughts?

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20061>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list