Make WordPress Core

Ticket #26365: capabilities.diff

File capabilities.diff, 1.3 KB (added by methnen, 11 years ago)

map_meta_cap_fix

  • wp-includes/capabilities.php

     
    10771077                if ( ! $post_author_id )
    10781078                        $post_author_id = $user_id;
    10791079
     1080                if ( 'inherit' == $post->post_status && $post->post_parent && $parent_status = get_post_status( $post->post_parent ) ) {
     1081                        $post->post_status = $parent_status;
     1082                }
     1083
    10801084                // If the user is the author...
    10811085                if ( $user_id == $post_author_id ) {
    10821086                        // If the post is published...
     
    11271131                if ( ! $post_author_id )
    11281132                        $post_author_id = $user_id;
    11291133
     1134                if ( 'inherit' == $post->post_status && $post->post_parent && $parent_status = get_post_status( $post->post_parent ) ) {
     1135                        $post->post_status = $parent_status;
     1136                }
     1137
    11301138                // If the user is the author...
    11311139                if ( $user_id == $post_author_id ) {
    11321140                        // If the post is published...
     
    11671175                        break;
    11681176                }
    11691177
     1178                if ( 'inherit' == $post->post_status && $post->post_parent && $parent_status = get_post_status( $post->post_parent ) ) {
     1179                        $post->post_status = $parent_status;
     1180                }
     1181
    11701182                $status_obj = get_post_status_object( $post->post_status );
    11711183                if ( $status_obj->public ) {
    11721184                        $caps[] = $post_type->cap->read;