[wp-trac] [WordPress Trac] #23226: Always use meta caps directly instead of going through the post_type_object->caps array

WordPress Trac noreply at wordpress.org
Fri Jan 18 04:34:45 UTC 2013


#23226: Always use meta caps directly instead of going through the
post_type_object->caps array
-----------------------------+------------------
 Reporter:  markjaquith      |       Owner:
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  3.6
Component:  Role/Capability  |     Version:
 Severity:  normal           |  Resolution:
 Keywords:                   |
-----------------------------+------------------

Comment (by markjaquith):

 Replying to [comment:2 scribu]:
 > To clarify: that's the correct way, even if register_post_type() has
 `'map_meta_cap' => false`, right?

 Right. Our post-related meta caps all have this block of code:

 {{{
 if ( ! $post_type->map_meta_cap ) {
         $caps[] = $post_type->cap->$cap;
 }}}

 So it essentially does that digging for us.

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


More information about the wp-trac mailing list