[wp-trac] [WordPress Trac] #13509: Searching doesn't return Private results to logged in users with read_private_ permissions

WordPress Trac wp-trac at lists.automattic.com
Mon May 24 00:42:37 UTC 2010


#13509: Searching doesn't return Private results to logged in users with
read_private_ permissions
--------------------------+-------------------------------------------------
 Reporter:  inbytesinc    |       Owner:  ryan       
     Type:  defect (bug)  |      Status:  new        
 Priority:  normal        |   Milestone:  3.0        
Component:  Post Types    |     Version:  2.9.1      
 Severity:  normal        |    Keywords:  needs-patch
--------------------------+-------------------------------------------------
Changes (by dd32):

  * keywords:  query search private logged => needs-patch
  * component:  Query => Post Types
  * milestone:  Unassigned => 3.0


Comment:

 The only solution to this i can think of is going to be something like the
 following, the current check for a cap and setting the SQL isnt going to
 work with custom post_types..

 {{{
 foreach ( post_types as type )
   if ( user can read private <type> )
     append to post_types_readable array
 $sql .= " OR ($wpdb->posts.post_status = 'private' AND post_type IN
 (<post_types_readable array>)"
 }}}

 Setting to 3.0 for now, but will need a patch rather soon to get in.

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


More information about the wp-trac mailing list