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