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...') ); } } $sendback = wp_get_referer(); if (strpos($sendback, 'post.php') !== false) $sendback = get_option('siteurl') .'/wp-admin/post-new.php'; elseif (strpos($sendback, 'attachments.php') !== false) $sendback = get_option('siteurl') .'/wp-admin/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-posts' ); wp_enqueue_script('admin-forms'); if ( 1 == $_GET['c'] ) wp_enqueue_script( 'admin-comments' ); require_once('admin-header.php'); add_filter( 'post_limits', $limit_filter = create_function( '$a', '$b = split(" ",$a); if ( !isset($b[2]) ) return $a; $start = intval(trim($b[1])) / 20 * 15; if ( !is_int($start) ) return $a; return "LIMIT $start, 20";' ) ); list($post_stati, $avail_post_stati) = wp_edit_posts_query(); $wp_query->max_num_pages = ceil( $wp_query->found_posts / 15 ); // We grab 20 but only show 15 ( 5 more for ajax extra ) if ( !isset( $_GET['paged'] ) ) $_GET['paged'] = 1; ?>