Don't set up $post_author_data in map_meta_cap() as we don't need it.

props duck_.
fixes #25177.


git-svn-id: https://develop.svn.wordpress.org/trunk@25177 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2013-08-30 04:00:06 +00:00
parent e9a8ae1acf
commit 3749745c3d
1 changed files with 3 additions and 9 deletions

View File

@ -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;