post_type == 'attachment' ) { if ( ! wp_delete_attachment($post_id_del) ) wp_die( __('Error in deleting...') ); } else { if ( !wp_delete_post($post_id_del) ) wp_die( __('Error in deleting...') ); } } } break; case 'edit': // TODO: Decide what to do here - add bulk edit feature, or just disallow if >1 post selected break; } $sendback = wp_get_referer(); if (strpos($sendback, 'post.php') !== false) $sendback = admin_url('post-new.php'); elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php'); $sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback); wp_redirect($sendback); exit(); } elseif ( !empty($_GET['_wp_http_referer']) ) { wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']))); exit; } $title = __('Posts'); $parent_file = 'edit.php'; wp_enqueue_script('admin-forms'); list($post_stati, $avail_post_stati) = wp_edit_posts_query(); if ( 1 == count($posts) && is_singular() ) { wp_enqueue_script( 'admin-comments' ); wp_enqueue_script( 'quicktags' ); } require_once('admin-header.php'); if ( !isset( $_GET['paged'] ) ) $_GET['paged'] = 1; if ( empty($_GET['mode']) ) $mode = 'list'; else $mode = attribute_escape($_GET['mode']); ?>