post_type == 'attachment' ) { if ( ! wp_delete_attachment($post_id) ) die( __('Error in deleting...') ); } else { if ( !wp_delete_post($post_id) ) die( __('Error in deleting...') ); } $sendback = wp_get_referer(); if (strstr($sendback, 'post.php')) $sendback = get_settings('siteurl') .'/wp-admin/post-new.php'; elseif (strstr($sendback, 'attachments.php')) $sendback = get_settings('siteurl') .'/wp-admin/attachments.php'; $sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback); header ('Location: ' . $sendback); exit(); break; default: header('Location: edit.php'); exit(); break; } // end switch include('admin-footer.php'); ?>