[wp-trac] [WordPress Trac] #4711: get_pages and get_posts do not work well with private posts

WordPress Trac wp-trac at lists.automattic.com
Thu Jan 14 23:22:37 UTC 2010


#4711: get_pages and get_posts do not work well with private posts
-------------------------+--------------------------------------------------
 Reporter:  Otto42       |       Owner:  anonymous     
     Type:  enhancement  |      Status:  new           
 Priority:  low          |   Milestone:  Future Release
Component:  Template     |     Version:  2.5           
 Severity:  minor        |    Keywords:  needs-patch   
-------------------------+--------------------------------------------------
Changes (by sillybean):

 * cc: steph@… (added)


Comment:

 This issue is causing a number of ripple effects. See #8592 and #6939 for
 starters. All the attempts to patch those problems have apparently
 incurred some serious performance issues (see Denis's comments on #8592
 and #11697).

 Would it make sense to pass these functions an extra argument telling them
 whether or not to include private posts/pages? If the default is to ignore
 them, everything would work exactly as it does now, but those of us who do
 need the private pages would have a way to get them (and we'd have to
 accept the performance hit).

 Another way of looking at it: get_pages serves both template
 (wp_list_pages) and edit screen (wp_dropdown_pages) functions, and it
 doesn't know which one will use its output. We could pass an argument
 based on what the user is trying to do. For example, if $user_is = reading
 (i.e. it's wp_list_pages calling get_pages), we could check to see whether
 they can see private content and include things accordingly. If they're
 writing, we could check to see whether they're allowed to edit private
 pages, and if so, include those pages in the parent dropdown.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/4711#comment:10>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list