-
- if ( 'page' == $post_data['post_type'] )
- return new WP_Error( 'edit_others_pages', __( 'You are not allowed to create pages as this user.' ) );
- else
- return new WP_Error( 'edit_others_posts', __( 'You are not allowed to create posts as this user.' ) );
+ if ( $update ) {
+ if ( 'page' == $post_data['post_type'] )
+ return new WP_Error( 'edit_others_pages', __( 'You are not allowed to edit pages as this user.' ) );
+ else
+ return new WP_Error( 'edit_others_posts', __( 'You are not allowed to edit posts as this user.' ) );
+ } else {
+ if ( 'page' == $post_data['post_type'] )
+ return new WP_Error( 'edit_others_pages', __( 'You are not allowed to create pages as this user.' ) );
+ else
+ return new WP_Error( 'edit_others_posts', __( 'You are not allowed to create posts as this user.' ) );
+ }