Make WordPress Core

Changeset 25177


Ignore:
Timestamp:
08/30/2013 04:00:06 AM (12 years ago)
Author:
nacin
Message:

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

props duck_.
fixes #25177.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/capabilities.php

    r24593 r25177  
    10401040            $post_author_id = $user_id;
    10411041
    1042         $post_author_data = $post_author_id == get_current_user_id() ? wp_get_current_user() : get_userdata( $post_author_id );
    1043 
    10441042        // If the user is the author...
    1045         if ( is_object( $post_author_data ) && $user_id == $post_author_data->ID ) {
     1043        if ( $user_id == $post_author_id ) {
    10461044            // If the post is published...
    10471045            if ( 'publish' == $post->post_status ) {
     
    10901088            $post_author_id = $user_id;
    10911089
    1092         $post_author_data = $post_author_id == get_current_user_id() ? wp_get_current_user() : get_userdata( $post_author_id );
    1093 
    10941090        // If the user is the author...
    1095         if ( is_object( $post_author_data ) && $user_id == $post_author_data->ID ) {
     1091        if ( $user_id == $post_author_id ) {
    10961092            // If the post is published...
    10971093            if ( 'publish' == $post->post_status ) {
     
    11441140            $post_author_id = $user_id;
    11451141
    1146         $post_author_data = $post_author_id == get_current_user_id() ? wp_get_current_user() : get_userdata( $post_author_id );
    1147 
    1148         if ( is_object( $post_author_data ) && $user_id == $post_author_data->ID )
     1142        if ( $user_id == $post_author_id )
    11491143            $caps[] = $post_type->cap->read;
    11501144        elseif ( $status_obj->private )
Note: See TracChangeset for help on using the changeset viewer.