diff --git a/src/wp-admin/edit.php b/src/wp-admin/edit.php index 98ce887af4..e05d3ce195 100644 --- a/src/wp-admin/edit.php +++ b/src/wp-admin/edit.php @@ -80,6 +80,8 @@ if ( $doaction ) { $sendback = admin_url( $post_new_file ); } + $post_ids = array(); + if ( 'delete_all' === $doaction ) { // Prepare for deletion of all posts with a specified post status (i.e. Empty Trash). $post_status = preg_replace( '/[^a-z0-9_-]+/i', '', $_REQUEST['post_status'] ); @@ -96,7 +98,7 @@ if ( $doaction ) { $post_ids = array_map( 'intval', $_REQUEST['post'] ); } - if ( ! isset( $post_ids ) ) { + if ( empty( $post_ids ) ) { wp_redirect( $sendback ); exit; } diff --git a/src/wp-admin/upload.php b/src/wp-admin/upload.php index d29914114a..8ea6e1c6d6 100644 --- a/src/wp-admin/upload.php +++ b/src/wp-admin/upload.php @@ -119,6 +119,7 @@ $doaction = $wp_list_table->current_action(); if ( $doaction ) { check_admin_referer( 'bulk-media' ); + $post_ids = array(); if ( 'delete_all' === $doaction ) {