Plugin Directory

Changeset 1663462


Ignore:
Timestamp:
05/23/2017 09:34:05 PM (9 years ago)
Author:
reblogdog
Message:

Commit v5.6.9

Location:
blogdog
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • blogdog/tags/5.6.8/blogdog.php

    r1654660 r1663462  
    44Plugin URI:  https://reblogdog.com
    55Description: Add automated real estate content to your website. We publish an SEO optimized blog post for you everyday.
    6 Version:     5.6.8
     6Version:     5.6.9
    77Author:      reblogdog
    88Author URI:  https://reblogdog.com
     
    2828
    2929if ( ! defined( 'BLOGDOG_PLUGIN_VERSION' ) )
    30     define( 'BLOGDOG_PLUGIN_VERSION', '5.6.8' );
     30    define( 'BLOGDOG_PLUGIN_VERSION', '5.6.9' );
    3131
    3232/**
     
    146146       
    147147        add_action( 'rest_api_init', array( $this, 'register_route' ) );
     148       
     149        /**
     150         * Check Event Schedule
     151         *
     152         * @since 5.6.9
     153         */
     154       
     155        add_action( 'check_event_schedule', array( $this, 'check_event_schedule' ), 10, 1 );
     156       
     157        /**
     158         * Check Event Schedule
     159         *
     160         * @since 5.6.9
     161         */
     162       
     163        add_action( 'check_event_schedule', array( $this, 'check_event_schedule' ), 10, 1 );
    148164       
    149165    }
     
    386402        }
    387403       
     404        /** @see blogdog::check_event_schedule( $post_id ) */
     405        do_action( 'check_event_schedule', $post_id );
     406       
    388407        return;
     408    }
     409   
     410    /**
     411     * Check Event Schedule
     412     *
     413     * Check to ensure the wp_cron event has been scheduled.
     414     *
     415     * @since 5.6.9
     416     *
     417     * @params int $post_id The ID the post the event will act on.
     418     */
     419       
     420    public function check_event_schedule( $post_id ) {
     421       
     422        if(
     423            ! wp_next_scheduled( 'publish_future_post', array( $post_id ) )
     424            &&
     425            ! wp_next_scheduled( 'future_to_publish', array( $post_id ) )
     426        ) {
     427           
     428            /** We schedule the post to publish within a 4 hour window */
     429            wp_schedule_single_event(
     430                ( rand ( 0, 10800 ) + time() ),
     431                'publish_future_post',
     432                array( $post_id )
     433            );
     434           
     435        }
     436       
    389437    }
    390438   
  • blogdog/tags/5.6.8/readme.txt

    r1654660 r1663462  
    6464
    6565
     66= 5.6.9 =
     67
     68* Add functionality to check that posts are scheduled correcrly.
     69
    6670= 5.6.8 =
    6771
  • blogdog/trunk/blogdog.php

    r1654660 r1663462  
    44Plugin URI:  https://reblogdog.com
    55Description: Add automated real estate content to your website. We publish an SEO optimized blog post for you everyday.
    6 Version:     5.6.8
     6Version:     5.6.9
    77Author:      reblogdog
    88Author URI:  https://reblogdog.com
     
    2828
    2929if ( ! defined( 'BLOGDOG_PLUGIN_VERSION' ) )
    30     define( 'BLOGDOG_PLUGIN_VERSION', '5.6.8' );
     30    define( 'BLOGDOG_PLUGIN_VERSION', '5.6.9' );
    3131
    3232/**
     
    146146       
    147147        add_action( 'rest_api_init', array( $this, 'register_route' ) );
     148       
     149        /**
     150         * Check Event Schedule
     151         *
     152         * @since 5.6.9
     153         */
     154       
     155        add_action( 'check_event_schedule', array( $this, 'check_event_schedule' ), 10, 1 );
     156       
     157        /**
     158         * Check Event Schedule
     159         *
     160         * @since 5.6.9
     161         */
     162       
     163        add_action( 'check_event_schedule', array( $this, 'check_event_schedule' ), 10, 1 );
    148164       
    149165    }
     
    386402        }
    387403       
     404        /** @see blogdog::check_event_schedule( $post_id ) */
     405        do_action( 'check_event_schedule', $post_id );
     406       
    388407        return;
     408    }
     409   
     410    /**
     411     * Check Event Schedule
     412     *
     413     * Check to ensure the wp_cron event has been scheduled.
     414     *
     415     * @since 5.6.9
     416     *
     417     * @params int $post_id The ID the post the event will act on.
     418     */
     419       
     420    public function check_event_schedule( $post_id ) {
     421       
     422        if(
     423            ! wp_next_scheduled( 'publish_future_post', array( $post_id ) )
     424            &&
     425            ! wp_next_scheduled( 'future_to_publish', array( $post_id ) )
     426        ) {
     427           
     428            /** We schedule the post to publish within a 4 hour window */
     429            wp_schedule_single_event(
     430                ( rand ( 0, 10800 ) + time() ),
     431                'publish_future_post',
     432                array( $post_id )
     433            );
     434           
     435        }
     436       
    389437    }
    390438   
  • blogdog/trunk/readme.txt

    r1654660 r1663462  
    6464
    6565
     66= 5.6.9 =
     67
     68* Add functionality to check that posts are scheduled correcrly.
     69
    6670= 5.6.8 =
    6771
Note: See TracChangeset for help on using the changeset viewer.