Bulk Delete - Version 3.1

Version Description

Added the option to delete by date for pages, drafts, revisions, future posts etc

=

Download this release

Release Info

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

Code changes from version 3.0 to 3.1

bulk-delete.php CHANGED
@@ -3,9 +3,9 @@
3
  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, tags or custom taxonomies. Use it with caution.
7
  Donate Link: http://sudarmuthu.com/if-you-wanna-thank-me
8
- Version: 3.0
9
  License: GPL
10
  Author: Sudar
11
  Author URI: http://sudarmuthu.com/
@@ -48,6 +48,10 @@ Domain Path: languages/
48
  2013-04-27 - v3.0 - (Dev time: 10 hours)
49
  - Added support for pro addons
50
  - Added GUI to see cron jobs
 
 
 
 
51
  */
52
 
53
  /* Copyright 2009 Sudar Muthu (email : sudar@sudarmuthu.com)
@@ -71,7 +75,7 @@ Domain Path: languages/
71
  */
72
  class Bulk_Delete {
73
 
74
- const VERSION = '3.0';
75
  const JS_HANDLE = 'bulk-delete';
76
  const JS_VARIABLE = 'BULK_DELETE';
77
 
@@ -122,7 +126,7 @@ class Bulk_Delete {
122
  // JavaScript messages
123
  $msg = array(
124
  'deletewarning' => __('Are you sure you want to delete all the selected posts', 'bulk-delete'),
125
- 'selectone' => __('Please select at least one', 'bulk-delete')
126
  );
127
  $translation_array = array( 'msg' => $msg );
128
  wp_localize_script( self::JS_HANDLE, self::JS_VARIABLE, $translation_array );
@@ -171,17 +175,14 @@ class Bulk_Delete {
171
  <h2><?php _e('Bulk Delete', 'bulk-delete');?></h2>
172
 
173
  <div id = "poststuff" style = "float:left; width:75%">
 
174
  <div class = "postbox">
175
- <div class = "handlediv">
176
- <br>
177
- </div>
178
  <h3 class = "hndle"><span><?php _e("By Type", 'bulk-delete'); ?></span></h3>
179
  <div class = "inside">
180
  <h4><?php _e("Select the posts which you want to delete", 'bulk-delete'); ?></h4>
181
 
182
- <form name="smbd_form" id = "smbd_misc_form"
183
- action="<?php echo get_bloginfo("wpurl"); ?>/wp-admin/options-general.php?page=bulk-delete.php" method="post"
184
- onsubmit="return bd_validateForm(this);">
185
 
186
  <?php
187
  $wp_query = new WP_Query;
@@ -190,14 +191,13 @@ class Bulk_Delete {
190
  $pending = $wpdb->get_var("select count(*) from $wpdb->posts where post_status = 'pending'");
191
  $future = $wpdb->get_var("select count(*) from $wpdb->posts where post_status = 'future'");
192
  $private = $wpdb->get_var("select count(*) from $wpdb->posts where post_status = 'private'");
193
- $pages = $wpdb->get_var("select count(*) from $wpdb->posts where post_type = 'page' AND post_status = 'publish' ");
194
  ?>
195
  <fieldset class="options">
196
  <table class="optiontable">
197
  <tr>
198
  <td scope="row" >
199
- <input name="smbd_drafs" id ="smbd_drafs" value = "drafs" type = "checkbox" />
200
- <label for="smbd_drafs"><?php _e("All Drafts", 'bulk-delete'); ?> (<?php echo $drafts . " "; _e("Drafts", 'bulk-delete'); ?>)</label>
201
  </td>
202
  </tr>
203
 
@@ -231,23 +231,19 @@ class Bulk_Delete {
231
 
232
  <tr>
233
  <td>
234
- <input name="smbd_pages" value = "pages" type = "checkbox" />
235
- <label for="smbd_pages"><?php _e("All Pages", 'bulk-delete'); ?> (<?php echo $pages . " "; _e("Pages", 'bulk-delete'); ?>)</label>
236
  </td>
237
  </tr>
238
 
239
  <tr>
240
- <td scope="row">
241
- <input name="smdb_specific_pages" id="smdb_specific_pages" value = "specificpages" type = "checkbox" />
242
- <label for="smdb_specific_pages"><?php _e("Delete these specific pages (Enter one post url (not post ids) per line)", 'bulk-delete'); ?></label>
243
- <br/>
244
- <textarea style="width: 450px; height: 80px;" id="smdb_specific_pages_urls" name="smdb_specific_pages_urls" rows="5" columns="80" ></textarea>
245
- </td>
246
- </tr>
247
-
248
- <tr>
249
- <td>
250
- <h4><?php _e("Choose your filtering options", 'bulk-delete'); ?></h4>
251
  </td>
252
  </tr>
253
 
@@ -281,6 +277,124 @@ class Bulk_Delete {
281
  </div>
282
  </div>
283
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
284
  <div class = "postbox">
285
  <div class = "handlediv">
286
  <br>
@@ -631,8 +745,6 @@ class Bulk_Delete {
631
  </table>
632
  </div>
633
  </div>
634
-
635
- <p><em><?php _e("If you are looking to move posts in bulk, instead of deleting then try out my ", 'bulk-delete'); ?> <a href = "http://sudarmuthu.com/wordpress/bulk-move"><?php _e("Bulk Move Plugin", 'bulk-delete');?></a>.</em></p>
636
  </div>
637
 
638
  <iframe frameBorder="0" height = "950" src = "http://sudarmuthu.com/projects/wordpress/bulk-delete/sidebar.php?color=<?php echo get_user_option('admin_color'); ?>"></iframe>
@@ -722,7 +834,7 @@ class Bulk_Delete {
722
 
723
  if (array_get($_POST, 'smbd_cats_cron', 'false') == 'true') {
724
  $freq = $_POST['smbd_cats_cron_freq'];
725
- $time = strtotime($_POST['smbd_cats_cron_start']) - get_option('gmt_offset');
726
 
727
  if ($freq == -1) {
728
  wp_schedule_single_event($time, 'do-bulk-delete-cats', array($delete_options));
@@ -730,7 +842,7 @@ class Bulk_Delete {
730
  wp_schedule_event($time, $freq , 'do-bulk-delete-cats', array($delete_options));
731
  }
732
  } else {
733
- smbd_delete_cats($delete_options);
734
  }
735
 
736
  break;
@@ -818,105 +930,272 @@ class Bulk_Delete {
818
  break;
819
 
820
  case "bulk-delete-special":
821
- $options = array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
822
 
823
- $limit_to = absint(array_get($_POST, 'smbd_special_limit_to', 0));
 
 
 
 
 
 
 
 
 
824
 
825
- if ($limit_to > 0) {
826
- $options['showposts'] = $limit_to;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
827
  } else {
828
- $options['nopaging'] = 'true';
829
  }
 
 
830
 
831
- $force_delete = array_get($_POST, 'smbd_special_force_delete');
 
 
 
832
  if ($force_delete == 'true') {
833
  $force_delete = true;
834
  } else {
835
  $force_delete = false;
836
  }
837
-
838
- // Drafts
839
- if ("drafs" == array_get($_POST, 'smbd_drafs')) {
840
- $options['post_status'] = 'draft';
841
- $drafts = $wp_query->query($options);
842
-
843
- foreach ($drafts as $draft) {
844
- wp_delete_post($draft->ID, $force_delete);
845
  }
 
 
846
  }
 
 
847
 
848
- // Revisions
849
- if ("revisions" == array_get($_POST, 'smbd_revisions')) {
850
- $revisions = $wpdb->get_results("select ID from $wpdb->posts where post_type = 'revision'");
 
851
 
852
- foreach ($revisions as $revision) {
853
- wp_delete_post($revision->ID, $force_delete);
854
- }
855
- }
 
 
856
 
857
- // Pending Posts
858
- if ("pending" == array_get($_POST, 'smbd_pending')) {
859
- $pendings = $wpdb->get_results("select ID from $wpdb->posts where post_status = 'pending'");
 
860
 
861
- foreach ($pendings as $pending) {
862
- wp_delete_post($pending->ID, $force_delete);
863
- }
864
- }
865
 
866
- // Future Posts
867
- if ("future" == array_get($_POST, 'smbd_future')) {
868
- $futures = $wpdb->get_results("select ID from $wpdb->posts where post_status = 'future'");
869
 
870
- foreach ($futures as $future) {
871
- wp_delete_post($future->ID, $force_delete);
872
- }
873
- }
 
874
 
875
- // Private Posts
876
- if ("private" == array_get($_POST, 'smbd_private')) {
877
- $privates = $wpdb->get_results("select ID from $wpdb->posts where post_status = 'private'");
878
 
879
- foreach ($privates as $private) {
880
- wp_delete_post($private->ID, $force_delete);
881
- }
882
- }
 
883
 
884
- // Pages
885
- if ("pages" == array_get($_POST, 'smbd_pages')) {
886
- $options['post_type'] = 'page';
887
- $pages = $wp_query->query($options);
888
 
889
- foreach ($pages as $page) {
890
- wp_delete_post($page->ID, $force_delete);
891
- }
892
- }
893
-
894
- // Specific Pages
895
- if ("specificpages" == array_get($_POST, 'smdb_specific_pages')) {
896
- $urls = preg_split( '/\r\n|\r|\n/', array_get($_POST, 'smdb_specific_pages_urls') );
897
- foreach ($urls as $url) {
898
- $checkedurl = $url;
899
- if (substr($checkedurl ,0,1) == '/') {
900
- $checkedurl = get_site_url() . $checkedurl ;
901
- }
902
- $postid = url_to_postid( $checkedurl );
903
- wp_delete_post($postid, $force_delete);
904
- }
905
- }
906
-
907
- break;
908
  }
 
 
909
 
910
- // hook the admin notices action
911
- add_action( 'admin_notices', array(&$this, 'deleted_notice'), 9 );
 
 
 
912
  }
913
  }
914
 
915
  /**
916
- * Show deleted notice messages
917
  */
918
- function deleted_notice() {
919
- echo "<div class = 'updated'><p>" . __("All the selected posts have been successfully deleted.", 'bulk-delete') . "</p></div>";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
920
  }
921
 
922
  /**
@@ -938,7 +1217,7 @@ class Bulk_Delete {
938
 
939
  foreach ( (array) $events as $key => $event ) {
940
  $cron_item['timestamp'] = $timestamp;
941
- $cron_item['due'] = date_i18n( $date_format, $timestamp );
942
  $cron_item['schedule'] = $event['schedule'];
943
  $cron_item['type'] = $hook;
944
  $cron_item['args'] = $event['args'];
@@ -973,23 +1252,6 @@ if (!function_exists('array_get')) {
973
  }
974
  }
975
 
976
- /**
977
- * function to filter posts by days
978
- * @param <type> $where
979
- * @return <type>
980
- */
981
- if (!function_exists('smbd_cats_by_days ')) {
982
- function smbd_cats_by_days ($where = '') {
983
- $cats_op = array_get($_POST, 'smbd_cats_op');
984
- $cats_days = array_get($_POST, 'smbd_cats_days');
985
-
986
- remove_filter('posts_where', 'smbd_cats_by_days');
987
-
988
- $where .= " AND post_date $cats_op '" . date('y-m-d', strtotime("-$cats_days days")) . "'";
989
- return $where;
990
- }
991
- }
992
-
993
  /**
994
  * function to filter posts by days
995
  * @param <type> $where
@@ -1045,81 +1307,4 @@ if (!function_exists('smbd_get_tax_post')) {
1045
  return $postids;
1046
  }
1047
  }
1048
-
1049
- /**
1050
- * Delete posts by category
1051
- */
1052
- function smbd_delete_cats($delete_options) {
1053
-
1054
- $selected_cats = $delete_options['selected_cats'];
1055
-
1056
- $private = $delete_options['private'];
1057
-
1058
- if ($private == 'true') {
1059
- $options = array('category__in'=>$selected_cats,'post_status'=>'private', 'post_type'=>'post');
1060
- } else {
1061
- $options = array('category__in'=>$selected_cats,'post_status'=>'publish', 'post_type'=>'post');
1062
- }
1063
-
1064
- $limit_to = $delete_options['limit_to'];
1065
-
1066
- if ($limit_to > 0) {
1067
- $options['showposts'] = $limit_to;
1068
- } else {
1069
- $options['nopaging'] = 'true';
1070
- }
1071
-
1072
- $force_delete = $delete_options['force_delete'];
1073
-
1074
- if ($force_delete == 'true') {
1075
- $force_delete = true;
1076
- } else {
1077
- $force_delete = false;
1078
- }
1079
-
1080
- if ($delete_options['restrict'] == "true") {
1081
- $options['cats_op'] = $delete_options['cats_op'];
1082
- $options['cats_days'] = $delete_options['cats_days'];
1083
-
1084
- $bulkDeleteCatDays = new BulkDeleteCatDays;
1085
- }
1086
-
1087
- $wp_query = new WP_Query();
1088
- $posts = $wp_query->query($options);
1089
-
1090
- foreach ($posts as $post) {
1091
- wp_delete_post($post->ID, $force_delete);
1092
- }
1093
- }
1094
-
1095
- /**
1096
- * Class that encapsulates the deletion of Categories
1097
- */
1098
- class BulkDeleteCatDays {
1099
- var $days;
1100
- var $op;
1101
-
1102
- public function __construct(){
1103
- add_action( 'parse_query', array( $this, 'parse_query' ) );
1104
- }
1105
-
1106
- public function parse_query( $query ) {
1107
- if( isset( $query->query_vars['cats_days'] ) ){
1108
- $this->days = $query->query_vars['cats_days'];
1109
- $this->op = $query->query_vars['cats_op'];
1110
-
1111
- add_filter( 'posts_where', array( $this, 'filter_where' ) );
1112
- add_filter( 'posts_selection', array( $this, 'remove_where' ) );
1113
- }
1114
- }
1115
-
1116
- public function filter_where($where = '') {
1117
- $where .= " AND post_date " . $this->op . " '" . date('y-m-d', strtotime('-' . $this->days . ' days')) . "'";
1118
- return $where;
1119
- }
1120
-
1121
- public function remove_where() {
1122
- remove_filter( 'posts_where', array( $this, 'filter_where' ) );
1123
- }
1124
- }
1125
  ?>
3
  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, tags, custom taxonomies or by post type like drafts, scheduled posts, revisions etc.
7
  Donate Link: http://sudarmuthu.com/if-you-wanna-thank-me
8
+ Version: 3.1
9
  License: GPL
10
  Author: Sudar
11
  Author URI: http://sudarmuthu.com/
48
  2013-04-27 - v3.0 - (Dev time: 10 hours)
49
  - Added support for pro addons
50
  - Added GUI to see cron jobs
51
+ 2013-04-28 - v3.1 - (Dev time: 5 hours)
52
+ - Added separate delete by sections for pages, drafts and urls
53
+ - Added the option to delete by date for drafts, revisions, future posts etc
54
+ - Added the option to delete by date for pages
55
  */
56
 
57
  /* Copyright 2009 Sudar Muthu (email : sudar@sudarmuthu.com)
75
  */
76
  class Bulk_Delete {
77
 
78
+ const VERSION = '3.1';
79
  const JS_HANDLE = 'bulk-delete';
80
  const JS_VARIABLE = 'BULK_DELETE';
81
 
126
  // JavaScript messages
127
  $msg = array(
128
  'deletewarning' => __('Are you sure you want to delete all the selected posts', 'bulk-delete'),
129
+ 'selectone' => __('Please select at least one option', 'bulk-delete')
130
  );
131
  $translation_array = array( 'msg' => $msg );
132
  wp_localize_script( self::JS_HANDLE, self::JS_VARIABLE, $translation_array );
175
  <h2><?php _e('Bulk Delete', 'bulk-delete');?></h2>
176
 
177
  <div id = "poststuff" style = "float:left; width:75%">
178
+
179
  <div class = "postbox">
180
+ <div class = "handlediv"> <br> </div>
 
 
181
  <h3 class = "hndle"><span><?php _e("By Type", 'bulk-delete'); ?></span></h3>
182
  <div class = "inside">
183
  <h4><?php _e("Select the posts which you want to delete", 'bulk-delete'); ?></h4>
184
 
185
+ <form name="smbd_form" id = "smbd_misc_form" action="<?php echo get_bloginfo("wpurl"); ?>/wp-admin/options-general.php?page=bulk-delete.php" method="post" onsubmit="return bd_validateForm(this);">
 
 
186
 
187
  <?php
188
  $wp_query = new WP_Query;
191
  $pending = $wpdb->get_var("select count(*) from $wpdb->posts where post_status = 'pending'");
192
  $future = $wpdb->get_var("select count(*) from $wpdb->posts where post_status = 'future'");
193
  $private = $wpdb->get_var("select count(*) from $wpdb->posts where post_status = 'private'");
 
194
  ?>
195
  <fieldset class="options">
196
  <table class="optiontable">
197
  <tr>
198
  <td scope="row" >
199
+ <input name="smbd_drafts" id ="smbd_drafts" value = "drafts" type = "checkbox" />
200
+ <label for="smbd_drafts"><?php _e("All Drafts", 'bulk-delete'); ?> (<?php echo $drafts . " "; _e("Drafts", 'bulk-delete'); ?>)</label>
201
  </td>
202
  </tr>
203
 
231
 
232
  <tr>
233
  <td>
234
+ <h4><?php _e("Choose your filtering options", 'bulk-delete'); ?></h4>
 
235
  </td>
236
  </tr>
237
 
238
  <tr>
239
+ <td scope="row">
240
+ <input name="smbd_special_restrict" id="smbd_special_restrict" value = "true" type = "checkbox" onclick="toggle_date_restrict('special');" />
241
+ <?php _e("Only restrict to posts which are ", 'bulk-delete');?>
242
+ <select name="smbd_special_op" id="smbd_special_op" disabled>
243
+ <option value ="<"><?php _e("older than", 'bulk-delete');?></option>
244
+ <option value =">"><?php _e("posted within last", 'bulk-delete');?></option>
245
+ </select>
246
+ <input type ="textbox" name="smbd_special_days" id="smbd_special_days" disabled value ="0" maxlength="4" size="4" /><?php _e("days", 'bulk-delete');?>
 
 
 
247
  </td>
248
  </tr>
249
 
277
  </div>
278
  </div>
279
 
280
+
281
+ <div class = "postbox">
282
+ <div class = "handlediv"> <br> </div>
283
+ <h3 class = "hndle"><span><?php _e("By Pages", 'bulk-delete'); ?></span></h3>
284
+ <div class = "inside">
285
+ <h4><?php _e("Select the pages which you want to delete", 'bulk-delete'); ?></h4>
286
+
287
+ <form name="smbd_form" id = "smbd_page_form" action="<?php echo get_bloginfo("wpurl"); ?>/wp-admin/options-general.php?page=bulk-delete.php" method="post"
288
+ onsubmit="return bd_validateForm(this);">
289
+
290
+ <?php
291
+ $wp_query = new WP_Query;
292
+ $pages = $wpdb->get_var("select count(*) from $wpdb->posts where post_type = 'page' AND post_status = 'publish' ");
293
+ ?>
294
+ <fieldset class="options">
295
+ <table class="optiontable">
296
+ <tr>
297
+ <td>
298
+ <input name="smbd_pages" value = "pages" type = "checkbox" />
299
+ <label for="smbd_pages"><?php _e("All Pages", 'bulk-delete'); ?> (<?php echo $pages . " "; _e("Pages", 'bulk-delete'); ?>)</label>
300
+ </td>
301
+ </tr>
302
+
303
+ <tr>
304
+ <td>
305
+ <h4><?php _e("Choose your filtering options", 'bulk-delete'); ?></h4>
306
+ </td>
307
+ </tr>
308
+
309
+ <tr>
310
+ <td scope="row">
311
+ <input name="smbd_page_restrict" id="smbd_page_restrict" value = "true" type = "checkbox" onclick="toggle_date_restrict('page');" />
312
+ <?php _e("Only restrict to pages which are ", 'bulk-delete');?>
313
+ <select name="smbd_page_op" id="smbd_page_op" disabled>
314
+ <option value ="<"><?php _e("older than", 'bulk-delete');?></option>
315
+ <option value =">"><?php _e("posted within last", 'bulk-delete');?></option>
316
+ </select>
317
+ <input type ="textbox" name="smbd_page_days" id="smbd_page_days" disabled value ="0" maxlength="4" size="4" /><?php _e("days", 'bulk-delete');?>
318
+ </td>
319
+ </tr>
320
+
321
+ <tr>
322
+ <td scope="row">
323
+ <input name="smbd_page_force_delete" value = "false" type = "radio" checked="checked" /> <?php _e('Move to Trash', 'bulk-delete'); ?>
324
+ <input name="smbd_page_force_delete" value = "true" type = "radio" /> <?php _e('Delete permanently', 'bulk-delete'); ?>
325
+ </td>
326
+ </tr>
327
+
328
+ <tr>
329
+ <td scope="row">
330
+ <input name="smbd_page_limit" id="smbd_page_limit" value = "true" type = "checkbox" onclick="toggle_limit_restrict('page');" />
331
+ <?php _e("Only delete first ", 'bulk-delete');?>
332
+ <input type ="textbox" name="smbd_page_limit_to" id="smbd_page_limit_to" disabled value ="0" maxlength="4" size="4" /><?php _e("posts.", 'bulk-delete');?>
333
+ <?php _e("Use this option if there are more than 1000 posts and the script timesout.", 'bulk-delete') ?>
334
+ </td>
335
+ </tr>
336
+
337
+ </table>
338
+ </fieldset>
339
+
340
+ <p class="submit">
341
+ <input type="submit" name="submit" class="button-primary" value="<?php _e("Bulk Delete ", 'bulk-delete') ?>&raquo;">
342
+ </p>
343
+
344
+ <?php wp_nonce_field('bulk-delete-posts'); ?>
345
+
346
+ <input type="hidden" name="smbd_action" value="bulk-delete-page" />
347
+ </form>
348
+ </div>
349
+ </div>
350
+
351
+
352
+ <div class = "postbox">
353
+ <div class = "handlediv"> <br> </div>
354
+ <h3 class = "hndle"><span><?php _e("By Urls", 'bulk-delete'); ?></span></h3>
355
+ <div class = "inside">
356
+ <h4><?php _e("Delete these specific pages", 'bulk-delete'); ?></h4>
357
+
358
+ <form name="smbd_form" id = "smbd_specific_form" action="<?php echo get_bloginfo("wpurl"); ?>/wp-admin/options-general.php?page=bulk-delete.php" method="post" >
359
+
360
+ <fieldset class="options">
361
+ <table class="optiontable">
362
+ <tr>
363
+ <td scope="row">
364
+ <label for="smdb_specific_pages"><?php _e("Enter one post url (not post ids) per line", 'bulk-delete'); ?></label>
365
+ <br/>
366
+ <textarea style="width: 450px; height: 80px;" id="smdb_specific_pages_urls" name="smdb_specific_pages_urls" rows="5" columns="80" ></textarea>
367
+ </td>
368
+ </tr>
369
+
370
+ <tr>
371
+ <td>
372
+ <h4><?php _e("Choose your filtering options", 'bulk-delete'); ?></h4>
373
+ </td>
374
+ </tr>
375
+
376
+ <tr>
377
+ <td scope="row">
378
+ <input name="smbd_specific_force_delete" value = "false" type = "radio" checked="checked" /> <?php _e('Move to Trash', 'bulk-delete'); ?>
379
+ <input name="smbd_specific_force_delete" value = "true" type = "radio" /> <?php _e('Delete permanently', 'bulk-delete'); ?>
380
+ </td>
381
+ </tr>
382
+
383
+ </table>
384
+ </fieldset>
385
+
386
+ <p class="submit">
387
+ <input type="submit" name="submit" class="button-primary" value="<?php _e("Bulk Delete ", 'bulk-delete') ?>&raquo;">
388
+ </p>
389
+
390
+ <?php wp_nonce_field('bulk-delete-posts'); ?>
391
+
392
+ <input type="hidden" name="smbd_action" value="bulk-delete-specific" >
393
+ </form>
394
+ </div>
395
+ </div>
396
+
397
+
398
  <div class = "postbox">
399
  <div class = "handlediv">
400
  <br>
745
  </table>
746
  </div>
747
  </div>
 
 
748
  </div>
749
 
750
  <iframe frameBorder="0" height = "950" src = "http://sudarmuthu.com/projects/wordpress/bulk-delete/sidebar.php?color=<?php echo get_user_option('admin_color'); ?>"></iframe>
834
 
835
  if (array_get($_POST, 'smbd_cats_cron', 'false') == 'true') {
836
  $freq = $_POST['smbd_cats_cron_freq'];
837
+ $time = strtotime($_POST['smbd_cats_cron_start']) - ( get_option('gmt_offset') * 60 * 60 );
838
 
839
  if ($freq == -1) {
840
  wp_schedule_single_event($time, 'do-bulk-delete-cats', array($delete_options));
842
  wp_schedule_event($time, $freq , 'do-bulk-delete-cats', array($delete_options));
843
  }
844
  } else {
845
+ self::delete_cats($delete_options);
846
  }
847
 
848
  break;
930
  break;
931
 
932
  case "bulk-delete-special":
933
+ // Delete special types like drafts, reviesion etc
934
+
935
+ $delete_options = array();
936
+ $delete_options['restrict'] = array_get($_POST, 'smbd_special_restrict', FALSE);
937
+ $delete_options['limit_to'] = absint(array_get($_POST, 'smbd_special_limits_to', 0));
938
+ $delete_options['force_delete'] = array_get($_POST, 'smbd_special_force_delete', 'false');
939
+
940
+ $delete_options['special_op'] = array_get($_POST, 'smbd_special_op');
941
+ $delete_options['special_days'] = array_get($_POST, 'smbd_special_days');
942
+
943
+ $delete_options['drafts'] = array_get($_POST, 'smbd_drafts');
944
+ $delete_options['revisions'] = array_get($_POST, 'smbd_revisions');
945
+ $delete_options['pending'] = array_get($_POST, 'smbd_pending');
946
+ $delete_options['future'] = array_get($_POST, 'smbd_future');
947
+ $delete_options['private'] = array_get($_POST, 'smbd_private');
948
+
949
+ if (array_get($_POST, 'smbd_special_cron', 'false') == 'true') {
950
+ $freq = $_POST['smbd_special_cron_freq'];
951
+ $time = strtotime($_POST['smbd_special_cron_start']) - ( get_option('gmt_offset') * 60 * 60 );
952
 
953
+ if ($freq == -1) {
954
+ wp_schedule_single_event($time, 'do-bulk-delete-special', array($delete_options));
955
+ } else {
956
+ wp_schedule_event($time, $freq , 'do-bulk-delete-special', array($delete_options));
957
+ }
958
+ } else {
959
+ self::delete_special($delete_options);
960
+ }
961
+
962
+ break;
963
 
964
+ case "bulk-delete-page":
965
+ // Delete pages
966
+
967
+ $delete_options = array();
968
+ $delete_options['restrict'] = array_get($_POST, 'smbd_page_restrict', FALSE);
969
+ $delete_options['limit_to'] = absint(array_get($_POST, 'smbd_page_limits_to', 0));
970
+ $delete_options['force_delete'] = array_get($_POST, 'smbd_page_force_delete', 'false');
971
+
972
+ $delete_options['page_op'] = array_get($_POST, 'smbd_page_op');
973
+ $delete_options['page_days'] = array_get($_POST, 'smbd_page_days');
974
+
975
+ $delete_options['pages'] = array_get($_POST, 'smbd_pages');
976
+
977
+ if (array_get($_POST, 'smbd_page_cron', 'false') == 'true') {
978
+ $freq = $_POST['smbd_page_cron_freq'];
979
+ $time = strtotime($_POST['smbd_page_cron_start']) - ( get_option('gmt_offset') * 60 * 60 );
980
+
981
+ if ($freq == -1) {
982
+ wp_schedule_single_event($time, 'do-bulk-delete-page', array($delete_options));
983
+ } else {
984
+ wp_schedule_event($time, $freq , 'do-bulk-delete-page', array($delete_options));
985
+ }
986
  } else {
987
+ self::delete_pages($delete_options);
988
  }
989
+
990
+ break;
991
 
992
+ case "bulk-delete-specific":
993
+ // Delete pages
994
+
995
+ $force_delete = array_get($_POST, 'smbd_specific_force_delete');
996
  if ($force_delete == 'true') {
997
  $force_delete = true;
998
  } else {
999
  $force_delete = false;
1000
  }
1001
+
1002
+ $urls = preg_split( '/\r\n|\r|\n/', array_get($_POST, 'smdb_specific_pages_urls') );
1003
+ foreach ($urls as $url) {
1004
+ $checkedurl = $url;
1005
+ if (substr($checkedurl ,0,1) == '/') {
1006
+ $checkedurl = get_site_url() . $checkedurl ;
 
 
1007
  }
1008
+ $postid = url_to_postid( $checkedurl );
1009
+ wp_delete_post($postid, $force_delete);
1010
  }
1011
+ break;
1012
+ }
1013
 
1014
+ // hook the admin notices action
1015
+ add_action( 'admin_notices', array(&$this, 'deleted_notice'), 9 );
1016
+ }
1017
+ }
1018
 
1019
+ /**
1020
+ * Show deleted notice messages
1021
+ */
1022
+ function deleted_notice() {
1023
+ echo "<div class = 'updated'><p>" . __("All the selected posts have been successfully deleted.", 'bulk-delete') . "</p></div>";
1024
+ }
1025
 
1026
+ /**
1027
+ * Delete posts by category
1028
+ */
1029
+ static function delete_cats($delete_options) {
1030
 
1031
+ $selected_cats = $delete_options['selected_cats'];
 
 
 
1032
 
1033
+ $private = $delete_options['private'];
 
 
1034
 
1035
+ if ($private == 'true') {
1036
+ $options = array('category__in'=>$selected_cats,'post_status'=>'private', 'post_type'=>'post');
1037
+ } else {
1038
+ $options = array('category__in'=>$selected_cats,'post_status'=>'publish', 'post_type'=>'post');
1039
+ }
1040
 
1041
+ $limit_to = $delete_options['limit_to'];
 
 
1042
 
1043
+ if ($limit_to > 0) {
1044
+ $options['showposts'] = $limit_to;
1045
+ } else {
1046
+ $options['nopaging'] = 'true';
1047
+ }
1048
 
1049
+ $force_delete = $delete_options['force_delete'];
 
 
 
1050
 
1051
+ if ($force_delete == 'true') {
1052
+ $force_delete = true;
1053
+ } else {
1054
+ $force_delete = false;
1055
+ }
1056
+
1057
+ if ($delete_options['restrict'] == "true") {
1058
+ $options['cats_op'] = $delete_options['cats_op'];
1059
+ $options['cats_days'] = $delete_options['cats_days'];
1060
+
1061
+ if (!class_exists('Bulk_Delete_By_Days')) {
1062
+ require_once dirname(__FILE__) . '/include/class-bulk-delete-by-days.php';
 
 
 
 
 
 
 
1063
  }
1064
+ $bulk_Delete_By_Days = new Bulk_Delete_By_Days;
1065
+ }
1066
 
1067
+ $wp_query = new WP_Query();
1068
+ $posts = $wp_query->query($options);
1069
+
1070
+ foreach ($posts as $post) {
1071
+ wp_delete_post($post->ID, $force_delete);
1072
  }
1073
  }
1074
 
1075
  /**
1076
+ * Delete special type of posts - drafts, revisions etc.
1077
  */
1078
+ static function delete_special($delete_options) {
1079
+ global $wp_query;
1080
+
1081
+ $options = array();
1082
+
1083
+ $limit_to = $delete_options['limit_to'];
1084
+
1085
+ if ($limit_to > 0) {
1086
+ $options['showposts'] = $limit_to;
1087
+ } else {
1088
+ $options['nopaging'] = 'true';
1089
+ }
1090
+
1091
+ $force_delete = $delete_options['force_delete'];
1092
+
1093
+ if ($force_delete == 'true') {
1094
+ $force_delete = true;
1095
+ } else {
1096
+ $force_delete = false;
1097
+ }
1098
+
1099
+ if ($delete_options['restrict'] == "true") {
1100
+ $options['op'] = $delete_options['special_op'];
1101
+ $options['days'] = $delete_options['special_days'];
1102
+
1103
+ if (!class_exists('Bulk_Delete_By_Days')) {
1104
+ require_once dirname(__FILE__) . '/include/class-bulk-delete-by-days.php';
1105
+ }
1106
+ $bulk_Delete_By_Days = new Bulk_Delete_By_Days;
1107
+ }
1108
+
1109
+ // Drafts
1110
+ if ("drafts" == $delete_options['drafts']) {
1111
+ $options['post_status'] = 'draft';
1112
+ $drafts = $wp_query->query($options);
1113
+
1114
+ foreach ($drafts as $draft) {
1115
+ wp_delete_post($draft->ID, $force_delete);
1116
+ }
1117
+ }
1118
+
1119
+ // Revisions
1120
+ if ("revisions" == $delete_options['revisions']) {
1121
+ $revisions = $wpdb->get_results("select ID from $wpdb->posts where post_type = 'revision'");
1122
+
1123
+ foreach ($revisions as $revision) {
1124
+ wp_delete_post($revision->ID, $force_delete);
1125
+ }
1126
+ }
1127
+
1128
+ // Pending Posts
1129
+ if ("pending" == $delete_options['pending']) {
1130
+ $pendings = $wpdb->get_results("select ID from $wpdb->posts where post_status = 'pending'");
1131
+
1132
+ foreach ($pendings as $pending) {
1133
+ wp_delete_post($pending->ID, $force_delete);
1134
+ }
1135
+ }
1136
+
1137
+ // Future Posts
1138
+ if ("future" == $delete_options['future']) {
1139
+ $futures = $wpdb->get_results("select ID from $wpdb->posts where post_status = 'future'");
1140
+
1141
+ foreach ($futures as $future) {
1142
+ wp_delete_post($future->ID, $force_delete);
1143
+ }
1144
+ }
1145
+
1146
+ // Private Posts
1147
+ if ("private" == $delete_options['private']) {
1148
+ $privates = $wpdb->get_results("select ID from $wpdb->posts where post_status = 'private'");
1149
+
1150
+ foreach ($privates as $private) {
1151
+ wp_delete_post($private->ID, $force_delete);
1152
+ }
1153
+ }
1154
+ }
1155
+
1156
+ /**
1157
+ * Delete pages
1158
+ */
1159
+ static function delete_pages($delete_options) {
1160
+ global $wp_query;
1161
+
1162
+ $options = array();
1163
+
1164
+ $limit_to = $delete_options['limit_to'];
1165
+
1166
+ if ($limit_to > 0) {
1167
+ $options['showposts'] = $limit_to;
1168
+ } else {
1169
+ $options['nopaging'] = 'true';
1170
+ }
1171
+
1172
+ $force_delete = $delete_options['force_delete'];
1173
+
1174
+ if ($force_delete == 'true') {
1175
+ $force_delete = true;
1176
+ } else {
1177
+ $force_delete = false;
1178
+ }
1179
+
1180
+ if ($delete_options['restrict'] == "true") {
1181
+ $options['op'] = $delete_options['page_op'];
1182
+ $options['days'] = $delete_options['page_days'];
1183
+
1184
+ if (!class_exists('Bulk_Delete_By_Days')) {
1185
+ require_once dirname(__FILE__) . '/include/class-bulk-delete-by-days.php';
1186
+ }
1187
+ $bulk_Delete_By_Days = new Bulk_Delete_By_Days;
1188
+ }
1189
+
1190
+ // Pages
1191
+ if ("pages" == $delete_options['pages']) {
1192
+ $options['post_type'] = 'page';
1193
+ $pages = $wp_query->query($options);
1194
+
1195
+ foreach ($pages as $page) {
1196
+ wp_delete_post($page->ID, $force_delete);
1197
+ }
1198
+ }
1199
  }
1200
 
1201
  /**
1217
 
1218
  foreach ( (array) $events as $key => $event ) {
1219
  $cron_item['timestamp'] = $timestamp;
1220
+ $cron_item['due'] = date_i18n( $date_format, $timestamp + ( get_option('gmt_offset') * 60 * 60 ) );
1221
  $cron_item['schedule'] = $event['schedule'];
1222
  $cron_item['type'] = $hook;
1223
  $cron_item['args'] = $event['args'];
1252
  }
1253
  }
1254
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1255
  /**
1256
  * function to filter posts by days
1257
  * @param <type> $where
1307
  return $postids;
1308
  }
1309
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1310
  ?>
include/class-bulk-delete-by-days.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class that encapsulates the deletion of posts based on days
4
+ *
5
+ * @package Bulk Delete
6
+ * @author Sudar
7
+ */
8
+ class Bulk_Delete_By_Days {
9
+ var $days;
10
+ var $op;
11
+
12
+ public function __construct(){
13
+ add_action( 'parse_query', array( $this, 'parse_query' ) );
14
+ }
15
+
16
+ public function parse_query( $query ) {
17
+ if( isset( $query->query_vars['days'] ) ){
18
+ $this->days = $query->query_vars['days'];
19
+ $this->op = $query->query_vars['op'];
20
+
21
+ add_filter( 'posts_where', array( $this, 'filter_where' ) );
22
+ add_filter( 'posts_selection', array( $this, 'remove_where' ) );
23
+ }
24
+ }
25
+
26
+ public function filter_where($where = '') {
27
+ $where .= " AND post_date " . $this->op . " '" . date('y-m-d', strtotime('-' . $this->days . ' days')) . "'";
28
+ return $where;
29
+ }
30
+
31
+ public function remove_where() {
32
+ remove_filter( 'posts_where', array( $this, 'filter_where' ) );
33
+ }
34
+ }
35
+ ?>
include/class-cron-list-table.php CHANGED
@@ -2,8 +2,8 @@
2
  /**
3
  * Table to show cron list
4
  *
5
- * @package WordPress
6
- * @subpackage bulk-delete
7
  * @author Sudar
8
  */
9
  class Cron_List_Table extends WP_List_Table {
@@ -124,7 +124,7 @@ class Cron_List_Table extends WP_List_Table {
124
  //Return the title contents
125
  return sprintf('%1$s <span style="color:silver">(%2$s)</span>%3$s',
126
  /*$1%s*/ $item['due'],
127
- /*$2%s*/ $item['timestamp'],
128
  /*$3%s*/ $this->row_actions($actions)
129
  );
130
  }
2
  /**
3
  * Table to show cron list
4
  *
5
+ * @package Bulk Delete
6
+ * @subpackage Cron
7
  * @author Sudar
8
  */
9
  class Cron_List_Table extends WP_List_Table {
124
  //Return the title contents
125
  return sprintf('%1$s <span style="color:silver">(%2$s)</span>%3$s',
126
  /*$1%s*/ $item['due'],
127
+ /*$2%s*/ ($item['timestamp'] + get_option('gmt_offset') * 60 * 60 ),
128
  /*$3%s*/ $this->row_actions($actions)
129
  );
130
  }
js/bulk-delete.js CHANGED
@@ -18,12 +18,12 @@ jQuery(document).ready(function () {
18
 
19
  // invoke the date time picker
20
  jQuery('#smbd_cats_cron_start').datetimepicker({
21
- timeFormat: 'HH-mm-ss'
22
  });
23
  });
24
 
25
  /**
26
- * Check All Checkboxes
27
  */
28
  function bd_checkAll(form) {
29
  for (i = 0, n = form.elements.length; i < n; i++) {
@@ -37,6 +37,9 @@ function bd_checkAll(form) {
37
  }
38
  }
39
 
 
 
 
40
  function toggle_date_restrict(el) {
41
  if (jQuery("#smbd_" + el + "_restrict").is(":checked")) {
42
  jQuery("#smbd_" + el + "_op").removeAttr('disabled');
18
 
19
  // invoke the date time picker
20
  jQuery('#smbd_cats_cron_start').datetimepicker({
21
+ timeFormat: 'HH:mm:ss'
22
  });
23
  });
24
 
25
  /**
26
+ * Check All Check boxes
27
  */
28
  function bd_checkAll(form) {
29
  for (i = 0, n = form.elements.length; i < n; i++) {
37
  }
38
  }
39
 
40
+ /**
41
+ * Toggle the date restrict fields
42
+ */
43
  function toggle_date_restrict(el) {
44
  if (jQuery("#smbd_" + el + "_restrict").is(":checked")) {
45
  jQuery("#smbd_" + el + "_op").removeAttr('disabled');
languages/bulk-delete.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the Bulk Delete package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Bulk Delete 3.0\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/bulk-delete\n"
7
- "POT-Creation-Date: 2013-04-27 12:17:49+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -12,41 +12,41 @@ msgstr ""
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
- #. #-#-#-#-# bulk-delete.pot (Bulk Delete 3.0) #-#-#-#-#
16
  #. Plugin Name of the plugin/theme
17
- #: bulk-delete.php:100 bulk-delete.php:171
18
  msgid "Bulk Delete"
19
  msgstr ""
20
 
21
- #: bulk-delete.php:101 bulk-delete.php:674
22
  msgid "Bulk Delete Schedules"
23
  msgstr ""
24
 
25
- #: bulk-delete.php:124
26
  msgid "Are you sure you want to delete all the selected posts"
27
  msgstr ""
28
 
29
- #: bulk-delete.php:125
30
- msgid "Please select at least one"
31
  msgstr ""
32
 
33
- #: bulk-delete.php:142
34
  msgid "Manage"
35
  msgstr ""
36
 
37
- #: bulk-delete.php:156
38
  msgid "Buy Addons"
39
  msgstr ""
40
 
41
- #: bulk-delete.php:167
42
  msgid "WARNING: Posts deleted once cannot be retrieved back. Use with caution."
43
  msgstr ""
44
 
45
- #: bulk-delete.php:178
46
  msgid "By Type"
47
  msgstr ""
48
 
49
- #: bulk-delete.php:180
50
  msgid "Select the posts which you want to delete"
51
  msgstr ""
52
 
@@ -71,7 +71,7 @@ msgid "All Pending posts"
71
  msgstr ""
72
 
73
  #: bulk-delete.php:214 bulk-delete.php:221 bulk-delete.php:228
74
- #: bulk-delete.php:306 bulk-delete.php:431 bulk-delete.php:535
75
  msgid "Posts"
76
  msgstr ""
77
 
@@ -83,195 +83,208 @@ msgstr ""
83
  msgid "All private posts"
84
  msgstr ""
85
 
86
- #: bulk-delete.php:235
87
- msgid "All Pages"
 
88
  msgstr ""
89
 
90
- #: bulk-delete.php:235
91
- msgid "Pages"
 
92
  msgstr ""
93
 
94
- #: bulk-delete.php:242
95
- msgid ""
96
- "Delete these specific pages (Enter one post url (not post ids) per line)"
97
  msgstr ""
98
 
99
- #: bulk-delete.php:250 bulk-delete.php:323 bulk-delete.php:448
100
- #: bulk-delete.php:552
101
- msgid "Choose your filtering options"
 
 
 
 
 
102
  msgstr ""
103
 
104
- #: bulk-delete.php:256 bulk-delete.php:343 bulk-delete.php:468
105
- #: bulk-delete.php:572
106
  msgid "Move to Trash"
107
  msgstr ""
108
 
109
- #: bulk-delete.php:257 bulk-delete.php:344 bulk-delete.php:469
110
- #: bulk-delete.php:573
111
  msgid "Delete permanently"
112
  msgstr ""
113
 
114
- #: bulk-delete.php:264 bulk-delete.php:360 bulk-delete.php:485
115
- #: bulk-delete.php:589
116
  msgid "Only delete first "
117
  msgstr ""
118
 
119
- #: bulk-delete.php:265 bulk-delete.php:361 bulk-delete.php:486
120
- #: bulk-delete.php:590
121
  msgid "posts."
122
  msgstr ""
123
 
124
- #: bulk-delete.php:266 bulk-delete.php:362 bulk-delete.php:487
125
- #: bulk-delete.php:591
126
  msgid ""
127
  "Use this option if there are more than 1000 posts and the script timesout."
128
  msgstr ""
129
 
130
- #: bulk-delete.php:274 bulk-delete.php:394 bulk-delete.php:494
131
- #: bulk-delete.php:598
132
  msgid "Bulk Delete "
133
  msgstr ""
134
 
135
- #: bulk-delete.php:288
136
- msgid "By Category"
137
  msgstr ""
138
 
139
- #: bulk-delete.php:290
140
- msgid "Select the categories whose post you want to delete"
141
  msgstr ""
142
 
143
- #: bulk-delete.php:317
144
- msgid "All Categories"
145
  msgstr ""
146
 
147
- #: bulk-delete.php:332 bulk-delete.php:457 bulk-delete.php:561
148
- msgid "Only restrict to posts which are "
149
  msgstr ""
150
 
151
- #: bulk-delete.php:334 bulk-delete.php:459 bulk-delete.php:563
152
- msgid "older than"
153
  msgstr ""
154
 
155
- #: bulk-delete.php:335 bulk-delete.php:460 bulk-delete.php:564
156
- msgid "posted within last"
157
  msgstr ""
158
 
159
- #: bulk-delete.php:337 bulk-delete.php:462 bulk-delete.php:566
160
- msgid "days"
 
 
 
 
 
 
 
 
 
 
 
 
161
  msgstr ""
162
 
163
- #: bulk-delete.php:350 bulk-delete.php:475 bulk-delete.php:579
 
 
 
 
164
  msgid "Public posts"
165
  msgstr ""
166
 
167
- #: bulk-delete.php:351 bulk-delete.php:476 bulk-delete.php:580
168
  msgid "Private Posts"
169
  msgstr ""
170
 
171
- #: bulk-delete.php:368
172
  msgid "Delete now"
173
  msgstr ""
174
 
175
- #: bulk-delete.php:369 include/class-cron-list-table.php:73
176
  msgid "Schedule"
177
  msgstr ""
178
 
179
- #: bulk-delete.php:370
180
  msgid "repeat "
181
  msgstr ""
182
 
183
- #: bulk-delete.php:372
184
  msgid "Don't repeat"
185
  msgstr ""
186
 
187
- #: bulk-delete.php:382
188
  msgid "Only available in Pro Addon"
189
  msgstr ""
190
 
191
- #: bulk-delete.php:387
192
  msgid "Enter time in Y-m-d H:i:s format or enter now to use current time"
193
  msgstr ""
194
 
195
- #: bulk-delete.php:412
196
  msgid "By Tags"
197
  msgstr ""
198
 
199
- #: bulk-delete.php:415
200
  msgid "Select the tags whose post you want to delete"
201
  msgstr ""
202
 
203
- #: bulk-delete.php:442
204
  msgid "All Tags"
205
  msgstr ""
206
 
207
- #: bulk-delete.php:515
208
  msgid "By Taxonomies"
209
  msgstr ""
210
 
211
- #: bulk-delete.php:517
212
  msgid "Select the taxonomies whose post you want to delete"
213
  msgstr ""
214
 
215
- #: bulk-delete.php:546
216
  msgid "All Taxonomies"
217
  msgstr ""
218
 
219
- #: bulk-delete.php:614
220
  msgid "Debug Information"
221
  msgstr ""
222
 
223
- #: bulk-delete.php:616
224
  msgid ""
225
  "If you are seeing a blank page after clicking the Bulk Delete button, then "
226
  msgstr ""
227
 
228
- #: bulk-delete.php:616
229
  msgid "check out this FAQ"
230
  msgstr ""
231
 
232
- #: bulk-delete.php:617
233
  msgid "You also need need the following debug information."
234
  msgstr ""
235
 
236
- #: bulk-delete.php:620
237
  msgid "Available memory size "
238
  msgstr ""
239
 
240
- #: bulk-delete.php:624
241
  msgid "Script time out "
242
  msgstr ""
243
 
244
- #: bulk-delete.php:628
245
  msgid "Script input time "
246
  msgstr ""
247
 
248
- #: bulk-delete.php:635
249
- msgid ""
250
- "If you are looking to move posts in bulk, instead of deleting then try out "
251
- "my "
252
- msgstr ""
253
-
254
- #: bulk-delete.php:635
255
- msgid "Bulk Move Plugin"
256
- msgstr ""
257
-
258
- #: bulk-delete.php:652
259
  msgid "plugin"
260
  msgstr ""
261
 
262
- #: bulk-delete.php:652
263
  msgid "Version"
264
  msgstr ""
265
 
266
- #: bulk-delete.php:652
267
  msgid "by"
268
  msgstr ""
269
 
270
- #: bulk-delete.php:919
271
  msgid "All the selected posts have been successfully deleted."
272
  msgstr ""
273
 
274
- #: bulk-delete.php:931
275
  msgctxt "Cron table date format"
276
  msgid "M j, Y @ G:i"
277
  msgstr ""
@@ -336,8 +349,8 @@ msgstr ""
336
 
337
  #. Description of the plugin/theme
338
  msgid ""
339
- "Bulk delete posts from selected categories, tags or custom taxonomies. Use "
340
- "it with caution."
341
  msgstr ""
342
 
343
  #. Author of the plugin/theme
2
  # This file is distributed under the same license as the Bulk Delete package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Bulk Delete 3.1\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/bulk-delete\n"
7
+ "POT-Creation-Date: 2013-05-01 11:21:24+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
+ #. #-#-#-#-# bulk-delete.pot (Bulk Delete 3.1) #-#-#-#-#
16
  #. Plugin Name of the plugin/theme
17
+ #: bulk-delete.php:104 bulk-delete.php:175
18
  msgid "Bulk Delete"
19
  msgstr ""
20
 
21
+ #: bulk-delete.php:105 bulk-delete.php:786
22
  msgid "Bulk Delete Schedules"
23
  msgstr ""
24
 
25
+ #: bulk-delete.php:128
26
  msgid "Are you sure you want to delete all the selected posts"
27
  msgstr ""
28
 
29
+ #: bulk-delete.php:129
30
+ msgid "Please select at least one option"
31
  msgstr ""
32
 
33
+ #: bulk-delete.php:146
34
  msgid "Manage"
35
  msgstr ""
36
 
37
+ #: bulk-delete.php:160
38
  msgid "Buy Addons"
39
  msgstr ""
40
 
41
+ #: bulk-delete.php:171
42
  msgid "WARNING: Posts deleted once cannot be retrieved back. Use with caution."
43
  msgstr ""
44
 
45
+ #: bulk-delete.php:181
46
  msgid "By Type"
47
  msgstr ""
48
 
49
+ #: bulk-delete.php:183
50
  msgid "Select the posts which you want to delete"
51
  msgstr ""
52
 
71
  msgstr ""
72
 
73
  #: bulk-delete.php:214 bulk-delete.php:221 bulk-delete.php:228
74
+ #: bulk-delete.php:420 bulk-delete.php:545 bulk-delete.php:649
75
  msgid "Posts"
76
  msgstr ""
77
 
83
  msgid "All private posts"
84
  msgstr ""
85
 
86
+ #: bulk-delete.php:234 bulk-delete.php:305 bulk-delete.php:372
87
+ #: bulk-delete.php:437 bulk-delete.php:562 bulk-delete.php:666
88
+ msgid "Choose your filtering options"
89
  msgstr ""
90
 
91
+ #: bulk-delete.php:241 bulk-delete.php:446 bulk-delete.php:571
92
+ #: bulk-delete.php:675
93
+ msgid "Only restrict to posts which are "
94
  msgstr ""
95
 
96
+ #: bulk-delete.php:243 bulk-delete.php:314 bulk-delete.php:448
97
+ #: bulk-delete.php:573 bulk-delete.php:677
98
+ msgid "older than"
99
  msgstr ""
100
 
101
+ #: bulk-delete.php:244 bulk-delete.php:315 bulk-delete.php:449
102
+ #: bulk-delete.php:574 bulk-delete.php:678
103
+ msgid "posted within last"
104
+ msgstr ""
105
+
106
+ #: bulk-delete.php:246 bulk-delete.php:317 bulk-delete.php:451
107
+ #: bulk-delete.php:576 bulk-delete.php:680
108
+ msgid "days"
109
  msgstr ""
110
 
111
+ #: bulk-delete.php:252 bulk-delete.php:323 bulk-delete.php:378
112
+ #: bulk-delete.php:457 bulk-delete.php:582 bulk-delete.php:686
113
  msgid "Move to Trash"
114
  msgstr ""
115
 
116
+ #: bulk-delete.php:253 bulk-delete.php:324 bulk-delete.php:379
117
+ #: bulk-delete.php:458 bulk-delete.php:583 bulk-delete.php:687
118
  msgid "Delete permanently"
119
  msgstr ""
120
 
121
+ #: bulk-delete.php:260 bulk-delete.php:331 bulk-delete.php:474
122
+ #: bulk-delete.php:599 bulk-delete.php:703
123
  msgid "Only delete first "
124
  msgstr ""
125
 
126
+ #: bulk-delete.php:261 bulk-delete.php:332 bulk-delete.php:475
127
+ #: bulk-delete.php:600 bulk-delete.php:704
128
  msgid "posts."
129
  msgstr ""
130
 
131
+ #: bulk-delete.php:262 bulk-delete.php:333 bulk-delete.php:476
132
+ #: bulk-delete.php:601 bulk-delete.php:705
133
  msgid ""
134
  "Use this option if there are more than 1000 posts and the script timesout."
135
  msgstr ""
136
 
137
+ #: bulk-delete.php:270 bulk-delete.php:341 bulk-delete.php:387
138
+ #: bulk-delete.php:508 bulk-delete.php:608 bulk-delete.php:712
139
  msgid "Bulk Delete "
140
  msgstr ""
141
 
142
+ #: bulk-delete.php:283
143
+ msgid "By Pages"
144
  msgstr ""
145
 
146
+ #: bulk-delete.php:285
147
+ msgid "Select the pages which you want to delete"
148
  msgstr ""
149
 
150
+ #: bulk-delete.php:299
151
+ msgid "All Pages"
152
  msgstr ""
153
 
154
+ #: bulk-delete.php:299
155
+ msgid "Pages"
156
  msgstr ""
157
 
158
+ #: bulk-delete.php:312
159
+ msgid "Only restrict to pages which are "
160
  msgstr ""
161
 
162
+ #: bulk-delete.php:354
163
+ msgid "By Urls"
164
  msgstr ""
165
 
166
+ #: bulk-delete.php:356
167
+ msgid "Delete these specific pages"
168
+ msgstr ""
169
+
170
+ #: bulk-delete.php:364
171
+ msgid "Enter one post url (not post ids) per line"
172
+ msgstr ""
173
+
174
+ #: bulk-delete.php:402
175
+ msgid "By Category"
176
+ msgstr ""
177
+
178
+ #: bulk-delete.php:404
179
+ msgid "Select the categories whose post you want to delete"
180
  msgstr ""
181
 
182
+ #: bulk-delete.php:431
183
+ msgid "All Categories"
184
+ msgstr ""
185
+
186
+ #: bulk-delete.php:464 bulk-delete.php:589 bulk-delete.php:693
187
  msgid "Public posts"
188
  msgstr ""
189
 
190
+ #: bulk-delete.php:465 bulk-delete.php:590 bulk-delete.php:694
191
  msgid "Private Posts"
192
  msgstr ""
193
 
194
+ #: bulk-delete.php:482
195
  msgid "Delete now"
196
  msgstr ""
197
 
198
+ #: bulk-delete.php:483 include/class-cron-list-table.php:73
199
  msgid "Schedule"
200
  msgstr ""
201
 
202
+ #: bulk-delete.php:484
203
  msgid "repeat "
204
  msgstr ""
205
 
206
+ #: bulk-delete.php:486
207
  msgid "Don't repeat"
208
  msgstr ""
209
 
210
+ #: bulk-delete.php:496
211
  msgid "Only available in Pro Addon"
212
  msgstr ""
213
 
214
+ #: bulk-delete.php:501
215
  msgid "Enter time in Y-m-d H:i:s format or enter now to use current time"
216
  msgstr ""
217
 
218
+ #: bulk-delete.php:526
219
  msgid "By Tags"
220
  msgstr ""
221
 
222
+ #: bulk-delete.php:529
223
  msgid "Select the tags whose post you want to delete"
224
  msgstr ""
225
 
226
+ #: bulk-delete.php:556
227
  msgid "All Tags"
228
  msgstr ""
229
 
230
+ #: bulk-delete.php:629
231
  msgid "By Taxonomies"
232
  msgstr ""
233
 
234
+ #: bulk-delete.php:631
235
  msgid "Select the taxonomies whose post you want to delete"
236
  msgstr ""
237
 
238
+ #: bulk-delete.php:660
239
  msgid "All Taxonomies"
240
  msgstr ""
241
 
242
+ #: bulk-delete.php:728
243
  msgid "Debug Information"
244
  msgstr ""
245
 
246
+ #: bulk-delete.php:730
247
  msgid ""
248
  "If you are seeing a blank page after clicking the Bulk Delete button, then "
249
  msgstr ""
250
 
251
+ #: bulk-delete.php:730
252
  msgid "check out this FAQ"
253
  msgstr ""
254
 
255
+ #: bulk-delete.php:731
256
  msgid "You also need need the following debug information."
257
  msgstr ""
258
 
259
+ #: bulk-delete.php:734
260
  msgid "Available memory size "
261
  msgstr ""
262
 
263
+ #: bulk-delete.php:738
264
  msgid "Script time out "
265
  msgstr ""
266
 
267
+ #: bulk-delete.php:742
268
  msgid "Script input time "
269
  msgstr ""
270
 
271
+ #: bulk-delete.php:764
 
 
 
 
 
 
 
 
 
 
272
  msgid "plugin"
273
  msgstr ""
274
 
275
+ #: bulk-delete.php:764
276
  msgid "Version"
277
  msgstr ""
278
 
279
+ #: bulk-delete.php:764
280
  msgid "by"
281
  msgstr ""
282
 
283
+ #: bulk-delete.php:1023
284
  msgid "All the selected posts have been successfully deleted."
285
  msgstr ""
286
 
287
+ #: bulk-delete.php:1210
288
  msgctxt "Cron table date format"
289
  msgid "M j, Y @ G:i"
290
  msgstr ""
349
 
350
  #. Description of the plugin/theme
351
  msgid ""
352
+ "Bulk delete posts from selected categories, tags, custom taxonomies or by "
353
+ "post type like drafts, scheduled posts, revisions etc."
354
  msgstr ""
355
 
356
  #. Author of the plugin/theme
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: post, comment, delete, bulk, draft, revision, page
4
  Requires at least: 2.0
5
  Tested up to: 3.5.1
6
  Donate Link: http://sudarmuthu.com/if-you-wanna-thank-me
7
- Stable tag: 3.0
8
 
9
  Bulk delete posts from selected categories, tags or custom taxonomies
10
 
@@ -24,6 +24,7 @@ This Plugin supports the following bulk delete options
24
  - Delete all post revisions
25
  - Delete all pending posts
26
  - Delete all private posts
 
27
  - Delete all drafts
28
 
29
  All the above options support the following filters
@@ -158,6 +159,11 @@ The ability to schedule deletion of posts is available as a pro addon.
158
 
159
  == Changelog ==
160
 
 
 
 
 
 
161
  = 2013-04-27 - v3.0 - (Dev time: 10 hours) =
162
  * Added support for pro addons
163
  * Added GUI to see cron jobs
@@ -240,6 +246,12 @@ The ability to schedule deletion of posts is available as a pro addon.
240
  = v0.1 (2009-02-02) =
241
  * First version
242
 
 
 
 
 
 
 
243
  == Readme Generator ==
244
 
245
  This Readme file was generated using <a href = 'http://sudarmuthu.com/wordpress/wp-readme'>wp-readme</a>, which generates readme files for WordPress Plugins.
4
  Requires at least: 2.0
5
  Tested up to: 3.5.1
6
  Donate Link: http://sudarmuthu.com/if-you-wanna-thank-me
7
+ Stable tag: 3.1
8
 
9
  Bulk delete posts from selected categories, tags or custom taxonomies
10
 
24
  - Delete all post revisions
25
  - Delete all pending posts
26
  - Delete all private posts
27
+ - Delete all scheduled posts
28
  - Delete all drafts
29
 
30
  All the above options support the following filters
159
 
160
  == Changelog ==
161
 
162
+ = 2013-04-28 - v3.1 - (Dev time: 5 hours) =
163
+ * Added separate delete by sections for pages, drafts and urls
164
+ * Added the option to delete by date for drafts, revisions, future posts etc
165
+ * Added the option to delete by date for pages
166
+
167
  = 2013-04-27 - v3.0 - (Dev time: 10 hours) =
168
  * Added support for pro addons
169
  * Added GUI to see cron jobs
246
  = v0.1 (2009-02-02) =
247
  * First version
248
 
249
+ == Upgrade Notice ==
250
+
251
+ = 3.1 =
252
+
253
+ Added the option to delete by date for pages, drafts, revisions, future posts etc
254
+
255
  == Readme Generator ==
256
 
257
  This Readme file was generated using <a href = 'http://sudarmuthu.com/wordpress/wp-readme'>wp-readme</a>, which generates readme files for WordPress Plugins.