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': if ( isset($_GET['post']) ) { check_admin_referer('bulk-posts'); $_GET['post_status'] = $_GET['_status']; if ( -1 == $_GET['post_author'] ) unset($_GET['post_author']); $done = bulk_edit_posts($_GET); } 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); if ( isset($done) ) { $done['upd'] = count( $done['upd'] ); $done['skip'] = count( $done['skip'] ); $sendback = add_query_arg( $done, $sendback ); unset($done); } 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; } if ( empty($title) ) $title = __('View All Posts'); $parent_file = 'edit.php'; wp_enqueue_script('admin-forms'); wp_enqueue_script('inline-edit'); wp_enqueue_script('posts'); list($post_stati, $avail_post_stati) = wp_edit_posts_query(); if ( 1 == count($posts) && is_singular() ) { wp_enqueue_script( 'admin-comments' ); wp_enqueue_script( 'jquery-table-hotkeys' ); } require_once('admin-header.php'); if ( !isset( $_GET['paged'] ) ) $_GET['paged'] = 1; if ( empty($_GET['mode']) ) $mode = 'list'; else $mode = attribute_escape($_GET['mode']); if ( isset($_GET['posted']) && $_GET['posted'] ) : $_GET['posted'] = (int) $_GET['posted']; ?>