diff --git a/wp-admin/edit-page-form.php b/wp-admin/edit-page-form.php index 3ba05c4e94..e1b2707cec 100644 --- a/wp-admin/edit-page-form.php +++ b/wp-admin/edit-page-form.php @@ -228,7 +228,7 @@ if ( ( 'edit' == $action ) && current_user_can('delete_page', $post->ID) ) { ?>
post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) { ?> - + post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?> diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index 7c44c40d92..3ffcfa667d 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -75,8 +75,15 @@ function _wp_translate_postdata( $update = false, $post_data = null ) { // Posts 'submitted for approval' present are submitted to $_POST the same as if they were being published. // Change status from 'publish' to 'pending' if user lacks permissions to publish or to resave published posts. - if ( isset($post_data['post_status']) && ('publish' == $post_data['post_status'] && !current_user_can( 'publish_posts' )) ) - if ( $previous_status != 'publish' OR !current_user_can( 'edit_published_pages') ) + if ( 'page' == $post_data['post_type'] ) { + $publish_cap = 'publish_pages'; + $edit_cap = 'edit_published_pages'; + } else { + $publish_cap = 'publish_posts'; + $edit_cap = 'edit_published_posts'; + } + if ( isset($post_data['post_status']) && ('publish' == $post_data['post_status'] && !current_user_can( $publish_cap )) ) + if ( $previous_status != 'publish' || !current_user_can( $edit_cap ) ) $post_data['post_status'] = 'pending'; if ( ! isset($post_data['post_status']) )