[wp-trac] [WordPress Trac] #8592: Private Pages not listed in the Parent dropdown
WordPress Trac
noreply at wordpress.org
Fri Nov 16 22:46:46 UTC 2012
#8592: Private Pages not listed in the Parent dropdown
----------------------------------------+-----------------------------
Reporter: mtdewvirus | Owner: nacin
Type: enhancement | Status: reopened
Priority: normal | Milestone: Future Release
Component: Administration | Version: 2.7
Severity: major | Resolution:
Keywords: has-patch commit 3.5-early |
----------------------------------------+-----------------------------
Comment (by sillybean):
Roundup of where we stand on this issue as of 3.5b3.
Things that can be fixed with filters:
1. Add private/draft/future/pending pages to parent dropdown in page
attributes metabox and Quick Edit
2. Add (status) to titles in page parent dropdowns
3. Filter front-end page loops to include privately published ones.
4. Add all statuses to the menu admin screen's page metabox.
5. Filter lists of pages (wp_list_pages, wp_page_menu, and menu functions)
to include privately published ones.
See https://gist.github.com/4091448 for examples.
Items 1 and 2 are covered by 8592.3.patch (which probably should be
changed to use the 'read_private_pages' capability as knutsp pointed out).
Item 3 uses a well-known mechanism for altering loops, and I think we can
leave that alone.
I do think we need to do something to fix item 4. My example doesn't
include the "(status)" labels, but a patch probably should.
My example solution to item 5 is inefficient, since we have to wait until
the output is generated before we can overwrite it with new arguments. I
think it would be better to either add a filter on the arguments array in
wp_list_pages(), or put in a few lines to let us filter the post_status
alongside the excluded page IDs.
Things that can't (easily) be fixed with filters:
6. The page dropdown in Settings -> Reading. You'd have to go through the
same contortions as in item 5, with the addition of an is_admin()
conditional. (Plus, in my testing, it doesn't work, although that could be
a quirk of my test setup or a bad cache or who knows.)
I'm ambivalent about "fixing" 6, as it's the most likely to lead unwary
users into doing something they didn't intend. On the other hand, adding
an argument array filter in wp_dropdown_pages() would let developers do it
if they really, really wanted to, and might provide flexibility in other
areas beyond the scope of this ticket.
Have I missed any other places where other page statuses need to be
included?
What needs to be done to get this issue fixed in 3.6? I think:
* Refresh the patch and change the capability
* Write a patch to cover the page metabox in the nav menu admin screen,
preferably with (status) titles, keeping in mind that plugins can register
custom statuses.
* Discuss whether to filter the entire argument array in wp_list_pages()
or just the post_status, and write a patch accordingly.
* Discuss whether to do the same for wp_dropdown_pages().
--
Ticket URL: <http://core.trac.wordpress.org/ticket/8592#comment:148>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list