Changeset 22769
- Timestamp:
- 11/21/2012 04:34:57 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/post.php
r22743 r22769 54 54 $ptype = get_post_type_object( $post_data['post_type'] ); 55 55 if ( isset($post_data['user_ID']) && ($post_data['post_author'] != $post_data['user_ID']) ) { 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 } 63 } 64 } else { 65 if ( ! current_user_can( $ptype->cap->edit_others_posts ) ) { 66 if ( 'page' == $post_data['post_type'] ) { 67 return new WP_Error( 'edit_others_pages', __( 'You are not allowed to create pages as this user.' ) ); 68 } else { 69 return new WP_Error( 'edit_others_posts', __( 'You are not allowed to create posts as this user.' ) ); 70 } 67 71 } 68 72 }
Note: See TracChangeset
for help on using the changeset viewer.