Make WordPress Core


Ignore:
Timestamp:
07/08/2013 08:05:42 PM (13 years ago)
Author:
nacin
Message:

Use meta caps edit_post, read_post, and delete_post directly, rather than consulting the post type object. map_meta_cap() handles that for us. props markjaquith, kovshenin. fixes #23226.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/admin-bar.php

    r24214 r24593  
    430430            && 'add' != $current_screen->action
    431431            && ( $post_type_object = get_post_type_object( $post->post_type ) )
    432             && current_user_can( $post_type_object->cap->read_post, $post->ID )
     432            && current_user_can( 'read_post', $post->ID )
    433433            && ( $post_type_object->public )
    434434            && ( $post_type_object->show_in_admin_bar ) )
     
    458458        if ( ! empty( $current_object->post_type )
    459459            && ( $post_type_object = get_post_type_object( $current_object->post_type ) )
    460             && current_user_can( $post_type_object->cap->edit_post, $current_object->ID )
     460            && current_user_can( 'edit_post', $current_object->ID )
    461461            && $post_type_object->show_ui && $post_type_object->show_in_admin_bar )
    462462        {
Note: See TracChangeset for help on using the changeset viewer.