Bulk Delete - Version 0.8

Version Description

Download this release

Release Info

Developer sudar
Plugin Icon 128x128 Bulk Delete
Version 0.8
Comparing to
See all releases

Code changes from version 0.7 to 0.8

Files changed (4) hide show
  1. bulk-delete.php +48 -3
  2. readme.txt +10 -1
  3. screenshot-1.png +0 -0
  4. screenshot-2.png +0 -0
bulk-delete.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Bulk Delete
4
  Plugin Script: bulk-delete.php
5
  Plugin URI: http://sudarmuthu.com/wordpress/bulk-delete
6
  Description: Bulk delete posts from selected categories or tags. Use it with caution.
7
- Version: 0.7
8
  License: GPL
9
  Author: Sudar
10
  Author URI: http://sudarmuthu.com/
@@ -18,6 +18,7 @@ Text Domain: bulk-delete
18
  2009-07-21 - v0.5 - Fifth release - Added option to delete all pending posts.
19
  2009-07-22 - v0.6 - Sixth release - Added option to delete all scheduled posts.
20
  2010-02-21 - v0.7 - Added an option to delete posts directly or send them to trash and support for translation.
 
21
 
22
  /* Copyright 2009 Sudar Muthu (email : sudar@sudarmuthu.com)
23
 
@@ -60,7 +61,14 @@ if (!function_exists('smbd_request_handler')) {
60
 
61
  add_filter ('posts_where', 'cats_by_days');
62
  }
63
- $options = array('category__in'=>$selected_cats,'post_status'=>'publish', 'post_type'=>'post');
 
 
 
 
 
 
 
64
 
65
  $limit_to = absint($_POST['smbd_cats_limits_to']);
66
 
@@ -95,7 +103,14 @@ if (!function_exists('smbd_request_handler')) {
95
 
96
  add_filter ('posts_where', 'tags_by_days');
97
  }
98
- $options = array('tag__in'=>$selected_tags,'post_status'=>'publish', 'post_type'=>'post');
 
 
 
 
 
 
 
99
 
100
  $limit_to = absint($_POST['smbd_tags_limits_to']);
101
 
@@ -176,6 +191,15 @@ if (!function_exists('smbd_request_handler')) {
176
  }
177
  }
178
 
 
 
 
 
 
 
 
 
 
179
  // Pages
180
  if ("pages" == $_POST['smbd_pages']) {
181
  $options['post_type'] = 'page';
@@ -225,6 +249,7 @@ if (!function_exists('smbd_displayOptions')) {
225
  $revisions = $wpdb->get_results($wpdb->prepare("select * from $wpdb->posts where post_type = 'revision'"));
226
  $pending = $wpdb->get_results($wpdb->prepare("select * from $wpdb->posts where post_status = 'pending'"));
227
  $future = $wpdb->get_results($wpdb->prepare("select * from $wpdb->posts where post_status = 'future'"));
 
228
  $pages = $wp_query->query(array('post_type'=>'page'));
229
  ?>
230
  <fieldset class="options">
@@ -253,6 +278,12 @@ if (!function_exists('smbd_displayOptions')) {
253
  <label for="smbd_future"><?php echo _e("All scheduled posts", 'bulk-delete'); ?> (<?php echo count($future) . " "; _e("Posts", 'bulk-delete'); ?>)</label>
254
  </td>
255
  </tr>
 
 
 
 
 
 
256
  <tr>
257
  <td>
258
  <input name="smbd_pages" value = "pages" type = "checkbox" />
@@ -344,6 +375,13 @@ if (!function_exists('smbd_displayOptions')) {
344
  </td>
345
  </tr>
346
 
 
 
 
 
 
 
 
347
  <tr>
348
  <td scope="row">
349
  <input name="smbd_cats_limit" id="smbd_cats_limit" value = "true" type = "checkbox" onclick="toggle_limit_restrict('cats');" />
@@ -426,6 +464,13 @@ if (!function_exists('smbd_displayOptions')) {
426
  </td>
427
  </tr>
428
 
 
 
 
 
 
 
 
429
  <tr>
430
  <td scope="row">
431
  <input name="smbd_tags_limit" id="smbd_tags_limit" value = "true" type = "checkbox" onclick="toggle_limit_restrict('tags');" />
4
  Plugin Script: bulk-delete.php
5
  Plugin URI: http://sudarmuthu.com/wordpress/bulk-delete
6
  Description: Bulk delete posts from selected categories or tags. Use it with caution.
7
+ Version: 0.8
8
  License: GPL
9
  Author: Sudar
10
  Author URI: http://sudarmuthu.com/
18
  2009-07-21 - v0.5 - Fifth release - Added option to delete all pending posts.
19
  2009-07-22 - v0.6 - Sixth release - Added option to delete all scheduled posts.
20
  2010-02-21 - v0.7 - Added an option to delete posts directly or send them to trash and support for translation.
21
+ 2010-03-17 - v0.7 - Added support for private posts.
22
 
23
  /* Copyright 2009 Sudar Muthu (email : sudar@sudarmuthu.com)
24
 
61
 
62
  add_filter ('posts_where', 'cats_by_days');
63
  }
64
+
65
+ $private = $_POST['smbd_cats_private'];
66
+
67
+ if ($private == 'true') {
68
+ $options = array('category__in'=>$selected_cats,'post_status'=>'private', 'post_type'=>'post');
69
+ } else {
70
+ $options = array('category__in'=>$selected_cats,'post_status'=>'publish', 'post_type'=>'post');
71
+ }
72
 
73
  $limit_to = absint($_POST['smbd_cats_limits_to']);
74
 
103
 
104
  add_filter ('posts_where', 'tags_by_days');
105
  }
106
+
107
+ $private = $_POST['smbd_tags_private'];
108
+
109
+ if ($private == 'true') {
110
+ $options = array('tag__in'=>$selected_tags,'post_status'=>'private', 'post_type'=>'post');
111
+ } else {
112
+ $options = array('tag__in'=>$selected_tags,'post_status'=>'publish', 'post_type'=>'post');
113
+ }
114
 
115
  $limit_to = absint($_POST['smbd_tags_limits_to']);
116
 
191
  }
192
  }
193
 
194
+ // Private Posts
195
+ if ("private" == $_POST['smbd_private']) {
196
+ $privates = $wpdb->get_results($wpdb->prepare("select * from $wpdb->posts where post_status = 'private'"));
197
+
198
+ foreach ($privates as $private) {
199
+ wp_delete_post($private->ID, $force_delete);
200
+ }
201
+ }
202
+
203
  // Pages
204
  if ("pages" == $_POST['smbd_pages']) {
205
  $options['post_type'] = 'page';
249
  $revisions = $wpdb->get_results($wpdb->prepare("select * from $wpdb->posts where post_type = 'revision'"));
250
  $pending = $wpdb->get_results($wpdb->prepare("select * from $wpdb->posts where post_status = 'pending'"));
251
  $future = $wpdb->get_results($wpdb->prepare("select * from $wpdb->posts where post_status = 'future'"));
252
+ $private = $wpdb->get_results($wpdb->prepare("select * from $wpdb->posts where post_status = 'private'"));
253
  $pages = $wp_query->query(array('post_type'=>'page'));
254
  ?>
255
  <fieldset class="options">
278
  <label for="smbd_future"><?php echo _e("All scheduled posts", 'bulk-delete'); ?> (<?php echo count($future) . " "; _e("Posts", 'bulk-delete'); ?>)</label>
279
  </td>
280
  </tr>
281
+ <tr>
282
+ <td>
283
+ <input name="smbd_private" id ="smbd_private" value = "private" type = "checkbox" />
284
+ <label for="smbd_private"><?php echo _e("All private posts", 'bulk-delete'); ?> (<?php echo count($private) . " "; _e("Posts", 'bulk-delete'); ?>)</label>
285
+ </td>
286
+ </tr>
287
  <tr>
288
  <td>
289
  <input name="smbd_pages" value = "pages" type = "checkbox" />
375
  </td>
376
  </tr>
377
 
378
+ <tr>
379
+ <td scope="row" colspan="2">
380
+ <input name="smbd_cats_private" value = "false" type = "radio" checked="checked" /> <?php _e('Public posts', 'bulk-delete'); ?>
381
+ <input name="smbd_cats_private" value = "true" type = "radio" /> <?php _e('Private Posts', 'bulk-delete'); ?>
382
+ </td>
383
+ </tr>
384
+
385
  <tr>
386
  <td scope="row">
387
  <input name="smbd_cats_limit" id="smbd_cats_limit" value = "true" type = "checkbox" onclick="toggle_limit_restrict('cats');" />
464
  </td>
465
  </tr>
466
 
467
+ <tr>
468
+ <td scope="row" colspan="2">
469
+ <input name="smbd_tags_private" value = "false" type = "radio" checked="checked" /> <?php _e('Public posts', 'bulk-delete'); ?>
470
+ <input name="smbd_tags_private" value = "true" type = "radio" /> <?php _e('Private Posts', 'bulk-delete'); ?>
471
+ </td>
472
+ </tr>
473
+
474
  <tr>
475
  <td scope="row">
476
  <input name="smbd_tags_limit" id="smbd_tags_limit" value = "true" type = "checkbox" onclick="toggle_limit_restrict('tags');" />
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: sudar
3
  Tags: post, comment, delete, bulk, draft, revision, page
4
  Requires at least: 2.0
5
  Tested up to: 2.9.2
6
- Stable tag: 0.7
7
 
8
  Bulk delete posts from selected categories or tags
9
 
@@ -22,6 +22,12 @@ If you looking for just moving posts, instead of deleting, then use [Bulk Move P
22
 
23
  Extract the zip file and just drop the contents in the wp-content/plugins/ directory of your WordPress installation and then activate the Plugin from Plugins page.
24
 
 
 
 
 
 
 
25
  == Changelog ==
26
 
27
  ###v0.1 (2009-02-02)
@@ -50,6 +56,9 @@ Extract the zip file and just drop the contents in the wp-content/plugins/ direc
50
  * Added an option to delete posts directly or send them to trash.
51
  * Added support for translation.
52
 
 
 
 
53
  ==Readme Generator==
54
 
55
  This Readme file was generated using <a href = 'http://sudarmuthu.com/wordpress/wp-readme'>wp-readme</a>, which generates readme files for WordPress Plugins.
3
  Tags: post, comment, delete, bulk, draft, revision, page
4
  Requires at least: 2.0
5
  Tested up to: 2.9.2
6
+ Stable tag: 0.8
7
 
8
  Bulk delete posts from selected categories or tags
9
 
22
 
23
  Extract the zip file and just drop the contents in the wp-content/plugins/ directory of your WordPress installation and then activate the Plugin from Plugins page.
24
 
25
+ == Screenshot ==
26
+
27
+ 1. Delete posts based on type
28
+
29
+ 2. Delete posts based on categories or tags
30
+
31
  == Changelog ==
32
 
33
  ###v0.1 (2009-02-02)
56
  * Added an option to delete posts directly or send them to trash.
57
  * Added support for translation.
58
 
59
+ ###v0.8 (2010-03-17)
60
+ * Added support for private posts.
61
+
62
  ==Readme Generator==
63
 
64
  This Readme file was generated using <a href = 'http://sudarmuthu.com/wordpress/wp-readme'>wp-readme</a>, which generates readme files for WordPress Plugins.
screenshot-1.png ADDED
Binary file
screenshot-2.png ADDED
Binary file