From 5e247750a1026d13396b8b9c309fe9ab9c1c88e9 Mon Sep 17 00:00:00 2001 From: ryan 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: http://svn.automattic.com/wordpress/trunk@18876 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/upload.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wp-admin/upload.php b/wp-admin/upload.php index f332d720f..fbc87a048 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.' ) );