diff --git a/wp-includes/capabilities.php b/wp-includes/capabilities.php index c3bb58f627..1884cdc785 100644 --- a/wp-includes/capabilities.php +++ b/wp-includes/capabilities.php @@ -1039,10 +1039,8 @@ function map_meta_cap( $cap, $user_id ) { if ( ! $post_author_id ) $post_author_id = $user_id; - $post_author_data = $post_author_id == get_current_user_id() ? wp_get_current_user() : get_userdata( $post_author_id ); - // If the user is the author... - if ( is_object( $post_author_data ) && $user_id == $post_author_data->ID ) { + if ( $user_id == $post_author_id ) { // If the post is published... if ( 'publish' == $post->post_status ) { $caps[] = $post_type->cap->delete_published_posts; @@ -1089,10 +1087,8 @@ function map_meta_cap( $cap, $user_id ) { if ( ! $post_author_id ) $post_author_id = $user_id; - $post_author_data = $post_author_id == get_current_user_id() ? wp_get_current_user() : get_userdata( $post_author_id ); - // If the user is the author... - if ( is_object( $post_author_data ) && $user_id == $post_author_data->ID ) { + if ( $user_id == $post_author_id ) { // If the post is published... if ( 'publish' == $post->post_status ) { $caps[] = $post_type->cap->edit_published_posts; @@ -1143,9 +1139,7 @@ function map_meta_cap( $cap, $user_id ) { if ( ! $post_author_id ) $post_author_id = $user_id; - $post_author_data = $post_author_id == get_current_user_id() ? wp_get_current_user() : get_userdata( $post_author_id ); - - if ( is_object( $post_author_data ) && $user_id == $post_author_data->ID ) + if ( $user_id == $post_author_id ) $caps[] = $post_type->cap->read; elseif ( $status_obj->private ) $caps[] = $post_type->cap->read_private_posts;