post_type == 'attachment' ) { if ( ! wp_delete_attachment($page_id) ) die( __('Error in deleting...') ); } else { if ( !wp_delete_post($page_id) ) die( __('Error in deleting...') ); } $sendback = wp_get_referer(); if (strstr($sendback, 'page.php')) $sendback = get_settings('siteurl') .'/wp-admin/page.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-pages.php'); exit(); break; } // end switch include('admin-footer.php'); ?>