Drafts Scheduler - Version 1.5

Version Description

  • Fixes for the problem where drafts publish immediately in WordPress 3.1.1
  • Only update POST type posts, not pages - ALSO THIS WON'T POST any of the custom post types
Download this release

Release Info

Developer talus
Plugin Icon wp plugin Drafts Scheduler
Version 1.5
Comparing to
See all releases

Code changes from version 1.4 to 1.5

Files changed (2) hide show
  1. draft-scheduler.php +8 -7
  2. readme.txt +5 -2
draft-scheduler.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Drafts Scheduler
4
  Plugin URI: http://www.installedforyou.com/draftscheduler
5
  Description: Allows WordPress admins to bulk schedule posts currently saved as drafts
6
  Author: Jeff Rose
7
- Version: 1.4
8
  Author URI: http://www.installedforyou.com
9
 
10
  */
@@ -27,7 +27,7 @@ Author URI: http://www.installedforyou.com
27
 
28
  if (!class_exists('DraftScheduler')) {
29
 
30
- define ('IFDS_VERSION', '1.4');
31
  define('DraftScheduler_root', WP_PLUGIN_URL . '/drafts-scheduler/');
32
 
33
  class DraftScheduler {
@@ -304,7 +304,7 @@ if (!class_exists('DraftScheduler')) {
304
 
305
  $randInterval = (strtotime($endTime) - strtotime($startTime));
306
 
307
- $findDrafts = "SELECT ID FROM " .$wpdb->prefix . "posts WHERE post_status = 'draft' ORDER BY rand()";
308
 
309
  $draftList = $wpdb->get_results($findDrafts);
310
 
@@ -361,7 +361,7 @@ if (!class_exists('DraftScheduler')) {
361
 
362
  $intvSecs = ($intvHours * 60 * 60) + ($intvMins * 60);
363
 
364
- $findDrafts = "SELECT * FROM " .$wpdb->posts . " WHERE post_status = 'draft' ORDER BY rand()";
365
 
366
  $draftList = $wpdb->get_results($findDrafts);
367
 
@@ -401,7 +401,7 @@ if (!class_exists('DraftScheduler')) {
401
  */
402
  $intvSecs = ($intvHours * 60 * 60) + ($intvMins * 60);
403
 
404
- $findDrafts = "SELECT ID FROM " .$wpdb->posts . " WHERE post_status = 'draft' ORDER BY id ASC";
405
 
406
  $draftList = $wpdb->get_results($findDrafts);
407
  $this->draftScheduler_add_undo( $draftList );
@@ -432,7 +432,8 @@ if (!class_exists('DraftScheduler')) {
432
  'ID' => $draftID,
433
  'post_date' => date_i18n('Y-n-j G:i:s', $ds_postDate),
434
  'post_date_gmt' => $ds_gmt,
435
- 'post_status' => 'future'
 
436
  );
437
 
438
  wp_update_post( $update_date );
@@ -476,7 +477,7 @@ if (!class_exists('DraftScheduler')) {
476
  function draftScheduler_check_for_drafts(){
477
  global $wpdb;
478
 
479
- $findDrafts = "SELECT COUNT(ID) FROM " .$wpdb->prefix . "posts WHERE post_status = 'draft'";
480
 
481
  $draftCount = $wpdb->get_var($findDrafts);
482
 
4
  Plugin URI: http://www.installedforyou.com/draftscheduler
5
  Description: Allows WordPress admins to bulk schedule posts currently saved as drafts
6
  Author: Jeff Rose
7
+ Version: 1.5
8
  Author URI: http://www.installedforyou.com
9
 
10
  */
27
 
28
  if (!class_exists('DraftScheduler')) {
29
 
30
+ define ('IFDS_VERSION', '1.5');
31
  define('DraftScheduler_root', WP_PLUGIN_URL . '/drafts-scheduler/');
32
 
33
  class DraftScheduler {
304
 
305
  $randInterval = (strtotime($endTime) - strtotime($startTime));
306
 
307
+ $findDrafts = "SELECT ID FROM " .$wpdb->prefix . "posts WHERE post_status = 'draft' AND post_type = 'post' ORDER BY rand()";
308
 
309
  $draftList = $wpdb->get_results($findDrafts);
310
 
361
 
362
  $intvSecs = ($intvHours * 60 * 60) + ($intvMins * 60);
363
 
364
+ $findDrafts = "SELECT * FROM " .$wpdb->posts . " WHERE post_status = 'draft' AND post_type = 'post' ORDER BY rand()";
365
 
366
  $draftList = $wpdb->get_results($findDrafts);
367
 
401
  */
402
  $intvSecs = ($intvHours * 60 * 60) + ($intvMins * 60);
403
 
404
+ $findDrafts = "SELECT ID FROM " .$wpdb->posts . " WHERE post_status = 'draft' AND post_type = 'post' ORDER BY id ASC";
405
 
406
  $draftList = $wpdb->get_results($findDrafts);
407
  $this->draftScheduler_add_undo( $draftList );
432
  'ID' => $draftID,
433
  'post_date' => date_i18n('Y-n-j G:i:s', $ds_postDate),
434
  'post_date_gmt' => $ds_gmt,
435
+ 'post_status' => 'future',
436
+ 'edit_date' => true
437
  );
438
 
439
  wp_update_post( $update_date );
477
  function draftScheduler_check_for_drafts(){
478
  global $wpdb;
479
 
480
+ $findDrafts = "SELECT COUNT(ID) FROM " .$wpdb->prefix . "posts WHERE post_status = 'draft' AND post_type = 'post'";
481
 
482
  $draftCount = $wpdb->get_var($findDrafts);
483
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: talus
3
  Donate link: http://www.installedforyou.com/wordpress/drafts-scheduler-plugin/
4
  Tags: drafts, scheduling, posts, schedule
5
  Requires at least: 2.8
6
- Tested up to: 3.1
7
- Stable tag: 1.4
8
 
9
  Sequentially or randomly schedule ALL draft posts for posting.
10
 
@@ -51,6 +51,9 @@ Again, sorry, not in this version. In the future, it would be easy to add.
51
 
52
 
53
  == Changelog ==
 
 
 
54
 
55
  = 1.4 =
56
  - Misc changes to how drafts are updated, hoping to find/fix a bug related to permalinks disappearing.
3
  Donate link: http://www.installedforyou.com/wordpress/drafts-scheduler-plugin/
4
  Tags: drafts, scheduling, posts, schedule
5
  Requires at least: 2.8
6
+ Tested up to: 3.1.1
7
+ Stable tag: 1.5
8
 
9
  Sequentially or randomly schedule ALL draft posts for posting.
10
 
51
 
52
 
53
  == Changelog ==
54
+ = 1.5 =
55
+ - Fixes for the problem where drafts publish immediately in WordPress 3.1.1
56
+ - Only update POST type posts, not pages - ALSO THIS WON'T POST any of the custom post types
57
 
58
  = 1.4 =
59
  - Misc changes to how drafts are updated, hoping to find/fix a bug related to permalinks disappearing.