diff --git a/wp-admin/includes/list-table-media.php b/wp-admin/includes/list-table-media.php index dd1cf6adc..4684dd726 100644 --- a/wp-admin/includes/list-table-media.php +++ b/wp-admin/includes/list-table-media.php @@ -90,6 +90,7 @@ class WP_Media_Table extends WP_List_Table { function extra_tablenav( $which ) { global $post_type, $detached; + $post_type_obj = get_post_type_object( $post_type ); ?>
- is_trash && current_user_can( 'edit_others_posts' ) ) { ?> + is_trash && current_user_can( $post_type_obj->cap->edit_others_posts ) ) { ?>
diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index 424399d61..021ebee37 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -205,11 +205,11 @@ function edit_post( $post_data = null ) { wp_set_post_lock( $post_ID, $GLOBALS['current_user']->ID ); - if ( current_user_can( 'edit_others_posts' ) ) { - if ( !empty($post_data['sticky']) ) - stick_post($post_ID); + if ( current_user_can( $ptype->cap->edit_others_posts ) ) { + if ( ! empty( $post_data['sticky'] ) ) + stick_post( $post_ID ); else - unstick_post($post_ID); + unstick_post( $post_ID ); } return $post_ID; @@ -336,7 +336,7 @@ function bulk_edit_posts( $post_data = null ) { $post_data['ID'] = $post_ID; $updated[] = wp_update_post( $post_data ); - if ( isset( $post_data['sticky'] ) && current_user_can( 'edit_others_posts' ) ) { + if ( isset( $post_data['sticky'] ) && current_user_can( $ptype->cap->edit_others_posts ) ) { if ( 'sticky' == $post_data['sticky'] ) stick_post( $post_ID ); else