#25879 closed enhancement (fixed)
Add filter to page_template_dropdown()
Reported by: | meloniq | Owned by: | DrewAPicture |
---|---|---|---|
Milestone: | 4.4 | Priority: | normal |
Severity: | normal | Version: | 3.8 |
Component: | Posts, Post Types | Keywords: | has-patch |
Focuses: | template | Cc: |
Description
page_template_dropdown()
is used in 'Page Attributes' metabox to list available page templates. The filter hook will give ability to adjust what's displayed in this box.
Our issue:
We use many custom templates to perform some specific tasks like building frontend dashboards, submit/edit forms, login pages, etc.
As far it works well, but the 'Page Attributes' metabox fulfill with page templates that in most of cases are not intended for any other use, and some administrators get confused seeing full list of available templates while creating a new page.
Attachments (4)
Change History (17)
#3
@
11 years ago
The move to selected()
looks good though, touch_time()
and parent_dropdown()
would benefit from that as well. I'd suggest creating a new ticket for that.
#4
@
11 years ago
Created separate ticket for the selected()
use, and documenting this functions, see: #25889
Referenced tickets touches similar item (filtering page templates) but on lower level, using that filter to change items in dropdown could cause unexpected issues, as it will remove templates from all places, and not only from mentioned dropdown.
#5
@
11 years ago
- Milestone changed from Awaiting Review to 3.8
My only concern with 'page_template_dropdown'
filter name is that filters of the same name as the function are generally used to filter the actual result of that function. I'd suggest 'page_template_dropdown_items'
.
#6
@
11 years ago
The new filter would also need to be documented:
http://make.wordpress.org/core/handbook/inline-documentation-standards/php-documentation-standards/#4-hooks-actions-and-filters
#11
@
9 years ago
- Keywords needs-refresh removed
Refreshed the patch as the function has moved locations to template-functions.php and also updated the docs to reflect this would be for 4.4.0
Adds 'page_template_dropdown' filter