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

WordPress Trac wp-trac at lists.automattic.com
Wed Apr 23 11:06:43 GMT 2008


#4711: get_pages and get_posts do not work well with private posts
-------------------------------------+--------------------------------------
 Reporter:  Otto42                   |        Owner:  anonymous
     Type:  enhancement              |       Status:  new      
 Priority:  normal                   |    Milestone:  2.6      
Component:  Template                 |      Version:  2.5      
 Severity:  major                    |   Resolution:           
 Keywords:  has-patch needs-testing  |  
-------------------------------------+--------------------------------------
Comment (by chrislear):

 I should have said that I wanted this because I'm using wp_list_pages in
 my template header, and I want to show private pages when the user is
 logged on. Here's the code:

 if (is_user_logged_in()) {
         $exclude="&exclude=5,7"; //But should include private pages
 } else {
         $exclude="&exclude=7";
 }
 wp_list_pages("title_li=&sort_column=menu_order&depth=1$exclude" );

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


More information about the wp-trac mailing list