From ed0c374876604d996dd1649ab8601043ef96b257 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 4 Oct 2011 16:00:36 +0000 Subject: [PATCH] Avoid notice when performing bulk actions with now rows selected. Props SergeyBiryukov. fixes #18774 git-svn-id: https://develop.svn.wordpress.org/trunk@18876 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/upload.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wp-admin/upload.php b/wp-admin/upload.php index f332d720f5..fbc87a048c 100644 --- a/wp-admin/upload.php +++ b/wp-admin/upload.php @@ -90,6 +90,8 @@ if ( $doaction ) { } break; case 'trash': + if ( !isset( $post_ids ) ) + break; foreach ( (array) $post_ids as $post_id ) { if ( !current_user_can( 'delete_post', $post_id ) ) wp_die( __( 'You are not allowed to move this post to the trash.' ) ); @@ -100,6 +102,8 @@ if ( $doaction ) { $location = add_query_arg( array( 'trashed' => count( $post_ids ), 'ids' => join( ',', $post_ids ) ), $location ); break; case 'untrash': + if ( !isset( $post_ids ) ) + break; foreach ( (array) $post_ids as $post_id ) { if ( !current_user_can( 'delete_post', $post_id ) ) wp_die( __( 'You are not allowed to move this post out of the trash.' ) ); @@ -110,6 +114,8 @@ if ( $doaction ) { $location = add_query_arg( 'untrashed', count( $post_ids ), $location ); break; case 'delete': + if ( !isset( $post_ids ) ) + break; foreach ( (array) $post_ids as $post_id_del ) { if ( !current_user_can( 'delete_post', $post_id_del ) ) wp_die( __( 'You are not allowed to delete this post.' ) );