| 56 | | if ( !current_user_can( $ptype->cap->edit_others_posts ) ) { |
| 57 | | if ( 'page' == $post_data['post_type'] ) { |
| 58 | | return new WP_Error( 'edit_others_pages', $update ? |
| 59 | | __( 'You are not allowed to edit pages as this user.' ) : |
| 60 | | __( 'You are not allowed to create pages as this user.' ) |
| 61 | | ); |
| 62 | | } else { |
| 63 | | return new WP_Error( 'edit_others_posts', $update ? |
| 64 | | __( 'You are not allowed to edit posts as this user.' ) : |
| 65 | | __( 'You are not allowed to create posts as this user.' ) |
| 66 | | ); |
| | 56 | if ( $update ) { |
| | 57 | if ( ! current_user_can( $ptype->cap->edit_post, $post_data['ID'] ) ) { |
| | 58 | if ( 'page' == $post_data['post_type'] ) { |
| | 59 | return new WP_Error( 'edit_others_pages', __( 'You are not allowed to edit pages as this user.' ) ); |
| | 60 | } else { |
| | 61 | return new WP_Error( 'edit_others_posts', __( 'You are not allowed to edit posts as this user.' ) ); |
| | 62 | } |