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
This commit is contained in:
Ryan Boren 2011-10-04 16:00:36 +00:00
parent 188a2b973f
commit ed0c374876
1 changed files with 6 additions and 0 deletions

View File

@ -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.' ) );