_future_post_hook

Hook used to schedule publication for a post marked for the future.

Description

_future_post_hook( (int) $deprecated, (WP_Post) $post ); 

The $post properties used and must exist are ID and post_date_gmt..

Parameters (2)

0. $deprecated (int)
Not used. Can be set to null. Never implemented. Not marked as deprecated with _deprecated_argument() as it conflicts with wp_transition_post_status() and the default filter for _future_post_hook().
1. $post (WP_Post)
Post object.

Usage

  1. if ( !function_exists( '_future_post_hook' ) ) { 
  2. require_once ABSPATH . WPINC . '/post.php'; 
  3. $deprecated = -1; 
  4.  
  5. // Post object. 
  6. $post = null; 
  7.  
  8. // NOTICE! Understand what this does before running. 
  9. $result = _future_post_hook($deprecated, $post); 
  10.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/post.php  
  1. function _future_post_hook( $deprecated, $post ) { 
  2. wp_clear_scheduled_hook( 'publish_future_post', array( $post->ID ) ); 
  3. wp_schedule_single_event( strtotime( get_gmt_from_date( $post->post_date ) . ' GMT') , 'publish_future_post', array( $post->ID ) );