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/includes/media.php

    r24585 r24593  
    497497    if ( !empty($_POST['attachments']) ) foreach ( $_POST['attachments'] as $attachment_id => $attachment ) {
    498498        $post = $_post = get_post($attachment_id, ARRAY_A);
    499         $post_type_object = get_post_type_object( $post[ 'post_type' ] );
    500 
    501         if ( !current_user_can( $post_type_object->cap->edit_post, $attachment_id ) )
     499
     500        if ( !current_user_can( 'edit_post', $attachment_id ) )
    502501            continue;
    503502
Note: See TracChangeset for help on using the changeset viewer.