I got the wp_die
error message:
Sorry, you are not allowed to move this item to the Trash.
on trying to put the post in trash, but when I tried to put it in trash again the wp_die
error message:
Error in moving to Trash.
showed up and on refresh I see that the post was deleted. I have the administrator role, so I have the delete_post
capability. According to this code snippet in wp-admin/edit.php
, the role with admin should not get any of these errors.
foreach ( (array) $post_ids as $post_id ) {
if ( !current_user_can( 'delete_post', $post_id) )
wp_die( __('Sorry, you are not allowed to move this item to the Trash.') );
if ( wp_check_post_lock( $post_id ) ) {
$locked++;
continue;
}
if ( !wp_trash_post($post_id) )
wp_die( __('Error in moving to Trash.') );
$trashed++;
}