WordPress.org

Plugin Directory

Changeset 1335033


Ignore:
Timestamp:
01/24/16 16:36:43 (2 years ago)
Author:
WilltheWebMechanic
Message:

v2.1.5

Location:
automatic-post-publishing-scheduler
Files:
58 added
3 edited

Legend:

Unmodified
Added
Removed
  • automatic-post-publishing-scheduler/trunk/automatic-post-publishing-scheduler.php

    r1323981 r1335033  
    44Plugin URI: http://www.willthewebmechanic.com 
    55Description: Replaces default publishing with queued publishing. 
    6 Version: 2.1.4 
     6Version: 2.1.5 
    77Author: Will Brubaker 
    88Author URI: http://www.willthewebmechanic.com 
     
    3535    static private $wwm_plugin_values = array( 
    3636        'name' => 'PublishScheduler', 
    37         'version' => '2.1.4', 
     37        'version' => '2.1.5', 
    3838        'slug' => 'PublishScheduler', 
    3939        'dbversion' => '1.5',//db version 1.1 was introduced in version 2.0, 1.2 in 2.1, 1.3 in 2.2, 1.4 in 2.3 
     
    403403        $current_time = current_time( 'timestamp' ); 
    404404        $tz = get_option( 'timezone_string' ); 
    405  
    406405        //a user without admin/editor rights cannot alter the post status or the time/date of published posts: 
    407406        if ( ! current_user_can( 'edit_others_posts' ) ) { 
     
    435434            $post_date_gmt = gmdate( 'Y-m-d H:i', strtotime( $data['post_date'] ) ); 
    436435        } 
    437  
     436        $post_date_ts = strtotime( $post_date ); 
     437        $post_date_gmt_ts = strtotime( $post_date_gmt ); 
     438        $diff = $post_date_gmt_ts - $post_date_ts; 
    438439        //check if the time sent is in the past.  If so, return $data. 
    439         $post_date_timestamp = strtotime( $post_date ); 
    440440        $now_timestamp = strtotime( date_i18n( 'Y-m-d H:i', $current_time ) );//the seconds have been stripped from $post_date_timestamp, so they need to be stripped here too. 
    441  
    442         if ( ! 'XMLRPC_REQUEST' &&  $post_date_timestamp < $now_timestamp && current_user_can( 'edit_others_posts' ) ) { 
     441        if ( ! 'XMLRPC_REQUEST' &&  $post_date_ts < $now_timestamp && current_user_can( 'edit_others_posts' ) ) { 
    443442            $data['post_status'] = 'publish'; 
    444443            return $data; 
     
    460459            elseif ( $asked_for_time < $original_time_slot ) {//Nope, earlier time slot is not yours. Can not has. 
    461460                $post_date = date_i18n( 'Y-m-d H:i:s', $original_time_slot ); 
    462                 $post_date_gmt = date_i18n( 'Y-m-d H:i:s', $original_time_slot, true ); 
    463                 $post_date_gmt = date_i18n( 'Y-m-d H:i:s', strtotime( $original_time_slot . ' ' . get_option( 'timezone_string' ) ), true ); 
     461                $gmt_ts = $original_time_slot + $diff; 
     462                $post_date_gmt = date_i18n( 'Y-m-d H:i:s', $gmt_ts, true ); 
    464463                $data['post_status'] = 'future'; 
    465464                $data['post_date'] = $post_date; 
     
    547546 
    548547        $publish_time = reset( $available_time_slots ); 
     548        $gmt_ts = $publish_time + $diff; 
    549549        //take $publish_time which is a timestamp - convert it to a time/date with localization goodness for WP 
    550550        $post_date = date_i18n( 'Y-m-d H:i:s', $publish_time ); 
    551         //and also convert it to a gmt time/date. 
    552         $post_date_gmt = date_i18n( 'Y-m-d H:i:s', strtotime( $post_date . ' ' . $tz ), true ); 
     551        //convert the gmt timestamp to a time/date. 
     552        $post_date_gmt = date_i18n( 'Y-m-d H:i:s', $gmt_ts, true ); 
    553553        //schedule post for that slot 
    554554        $data['post_status'] = 'future'; 
  • automatic-post-publishing-scheduler/trunk/readme.md

    r1323981 r1335033  
    55**Requires at least:** 3.6 
    66**Tested up to:** 4.4.1 
    7 **Stable tag:** 2.1.4 
     7**Stable tag:** 2.1.5 
    88**Tags:** posts, publishing, scheduling, admin, author, automatic, blog, free, plugin 
    99**Donate Link:** http://www.willthewebmechanic.com/automatic-post-publishing-scheduler/ 
     
    8282 
    8383## Changelog ## 
     84 
     85### v2.1.5 ### 
     861. Better handling of WordPress timezone settings 
    8487 
    8588### v2.1.4 ### 
  • automatic-post-publishing-scheduler/trunk/readme.txt

    r1323981 r1335033  
    44Requires at least: 3.6 
    55Tested up to: 4.4.1 
    6 Stable tag: 2.1.4 
     6Stable tag: 2.1.5 
    77Tags: posts, publishing, scheduling, admin, author, automatic, blog, free, plugin 
    88Donate Link: http://www.willthewebmechanic.com/automatic-post-publishing-scheduler/ 
     
    6969 
    7070== Changelog == 
     71 
     72= v2.1.5 = 
     731. Better handling of WordPress timezone settings 
    7174 
    7275= v2.1.4 = 
Note: See TracChangeset for help on using the changeset viewer.