From 611183e09d8dbaf0b7ba0f70c0f6ced91bc4e398 Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 13 Feb 2008 20:53:18 +0000 Subject: [PATCH] Hookup bulk delete for posts. git-svn-id: http://svn.automattic.com/wordpress/trunk@6827 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/edit.php | 37 +++++++++++++++++++++++++++++++--- wp-admin/includes/template.php | 4 ++-- 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/wp-admin/edit.php b/wp-admin/edit.php index d0895fad8c..11f742b869 100644 --- a/wp-admin/edit.php +++ b/wp-admin/edit.php @@ -1,9 +1,37 @@ 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(); +} + $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'); @@ -14,6 +42,7 @@ $wp_query->max_num_pages = ceil( $wp_query->found_posts / 15 ); // We grab 20 bu if ( !isset( $_GET['paged'] ) ) $_GET['paged'] = 1; + ?>
@@ -74,7 +103,7 @@ unset($status_links); -

|

+

|

@@ -103,7 +132,8 @@ if ( $page_links ) ?>
- + + posts WHERE post_type = 'post' ORDER BY post_date DESC"; @@ -141,12 +171,13 @@ foreach ($arc_result as $arc_row) {
-
+ + diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index f67b721c02..6ca4037026 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -287,7 +287,7 @@ function tag_rows( $page = 1, $pagesize = 20, $searchterms = '' ) { // define the columns to display, the syntax is 'internal name' => 'display name' function wp_manage_posts_columns() { $posts_columns = array(); - $posts_columns['cb'] = '
'; + $posts_columns['cb'] = '
'; if ( 'draft' === $_GET['post_status'] ) $posts_columns['modified'] = __('Modified'); elseif ( 'pending' === $_GET['post_status'] ) @@ -308,7 +308,7 @@ function wp_manage_posts_columns() { function wp_manage_pages_columns() { $posts_columns = array(); - $posts_columns['cb'] = '
'; + $posts_columns['cb'] = '
'; if ( 'draft' === $_GET['post_status'] ) $posts_columns['modified'] = __('Modified'); elseif ( 'pending' === $_GET['post_status'] )