Preprocess get_page_templates() and store in a global
|Reported by:||Master Jake||Owned by:|
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?).
Change History (9)
- Milestone Awaiting Review deleted
- Resolution set to wontfix
- Status changed from new to closed