WordPress.org

Forums

The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Missed Schedule Fix WP Failed Future Posts
[resolved] Publishing Ahead of Schedule (TimeZone Issues) (4 posts)

  1. milewis1
    Member
    Posted 3 years ago #

    On my blog, the WordPress timezone is different than the timezone set on the MySQL server. In this case this plugin ends up publishing future items early.

    I would recommend a change to the query:

    global $wpdb;
    	$sql = $wpdb->prepare(
    		"SELECT<code>ID</code>FROM<code>{$wpdb->posts}</code>"."WHERE("."((<code>post_date</code>>0)&&(<code>post_date</code><=%s))OR"."((<code>post_date_gmt</code>>0)&&(<code>post_date_gmt</code><=%s))".")AND<code>post_status</code>='future'LIMIT 0,5",
    		current_time('mysql'),		// Blog local time
    		current_time('mysql', 1)	// UTC Time
    	);
    
    	$scheduledIDs=$wpdb->get_col($sql);

    This will use the WordPress blog's timezone instead of the MySQL server, which should give better results.

    http://wordpress.org/extend/plugins/wp-missed-schedule/

  2. sLaNGjIs Team
    Blocked
    Plugin Contributor

    Posted 3 years ago #

    Please, milewis1, send me full plugin code ;) Thanks :)

  3. sLaNGjIs Team
    Blocked
    Plugin Contributor

    Posted 3 years ago #

    This issue was inserted as Ticket #3712701 on to Todo List for Future Development.

    Thanks to milewis1 and all others users was send me same solution via Contact form ...

    If are satisfied of this plugin, please, consider one small Donation for my free work. :)

  4. sLaNGjIs Team
    Blocked
    Plugin Contributor

    Posted 3 years ago #

    @milewis1: try this version ;)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic