Make WordPress Core

Ticket #33453: 33453.patch

File 33453.patch, 1.1 KB (added by egill, 10 years ago)

33453.patch

  • src/wp-admin/includes/post.php

     
    6464                }
    6565        }
    6666
    67         if ( isset( $post_data['user_ID'] ) && ( $post_data['post_author'] != $post_data['user_ID'] )
    68                  && ! current_user_can( $ptype->cap->edit_others_posts ) ) {
    69                 if ( $update ) {
    70                         if ( 'page' == $post_data['post_type'] )
    71                                 return new WP_Error( 'edit_others_pages', __( 'You are not allowed to edit pages as this user.' ) );
    72                         else
    73                                 return new WP_Error( 'edit_others_posts', __( 'You are not allowed to edit posts as this user.' ) );
    74                 } else {
    75                         if ( 'page' == $post_data['post_type'] )
    76                                 return new WP_Error( 'edit_others_pages', __( 'You are not allowed to create pages as this user.' ) );
    77                         else
    78                                 return new WP_Error( 'edit_others_posts', __( 'You are not allowed to create posts as this user.' ) );
    79                 }
    80         }
    81 
    8267        if ( ! empty( $post_data['post_status'] ) ) {
    8368                $post_data['post_status'] = sanitize_key( $post_data['post_status'] );