_future_post_hook( int $deprecated, WP_Post $post )
- Since
- 2.3.0
- Source
wp-includes/post.php:7983
Hook used to schedule publication for a post marked for the future.
Description
The $post properties used and must exist are 'ID' and 'post_date_gmt'.
Parameters
$deprecatedint- 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().
$postWP_Post- Post object.
Uses · 3
- wp_clear_scheduled_hook()Unschedules all events attached to the hook with the specified arguments.
- wp_schedule_single_event()Schedules an event to run only once.
- get_gmt_from_date()Given a date in the timezone of the site, returns that date in UTC.
Source
function _future_post_hook( $deprecated, $post ) { wp_clear_scheduled_hook( 'publish_future_post', array( $post->ID ) ); wp_schedule_single_event( strtotime( get_gmt_from_date( $post->post_date ) . ' GMT' ), 'publish_future_post', array( $post->ID ) );}History
Introduced in 2.3.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 6.9.7 tag, from
src/wp-includes/post.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.