Fix bulk edit, some cleanup and message fixes for moving in/out of the trash, see #4529

git-svn-id: https://develop.svn.wordpress.org/trunk@11807 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2009-08-12 10:57:15 +00:00
parent 0e8ca7b71f
commit aa630abdab
6 changed files with 160 additions and 152 deletions
+9 -1
View File
@@ -236,6 +236,14 @@ function bulk_edit_posts( $post_data = null ) {
wp_die( __('You are not allowed to edit posts.') );
}
if ( -1 == $post_data['_status'] ) {
$post_data['post_status'] = null;
unset($post_data['post_status']);
} else {
$post_data['post_status'] = $post_data['_status'];
}
unset($post_data['_status']);
$post_IDs = array_map( 'intval', (array) $post_data['post'] );
$reset = array( 'post_author', 'post_status', 'post_password', 'post_parent', 'page_template', 'comment_status', 'ping_status', 'keep_private', 'tags_input', 'post_category', 'sticky' );
@@ -298,7 +306,7 @@ function bulk_edit_posts( $post_data = null ) {
$post_data['ID'] = $post_ID;
$updated[] = wp_update_post( $post_data );
if ( current_user_can( 'edit_others_posts' ) && isset( $post_data['sticky'] ) ) {
if ( isset( $post_data['sticky'] ) && current_user_can( 'edit_others_posts' ) ) {
if ( 'sticky' == $post_data['sticky'] )
stick_post( $post_ID );
else