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-admin/async-upload.php

    r24214 r24593  
    4848        if ( 'attachment' != $post->post_type )
    4949                wp_die( __( 'Unknown post type.' ) );
    50         $post_type_object = get_post_type_object( 'attachment' );
    51         if ( ! current_user_can( $post_type_object->cap->edit_post, $id ) )
     50        if ( ! current_user_can( 'edit_post', $id ) )
    5251                wp_die( __( 'You are not allowed to edit this item.' ) );
    5352
Note: See TracChangeset for help on using the changeset viewer.