Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

_future_post_hook() WordPress Function

The future post hook is a function that is called when a post is published in the future. It allows you to perform any actions that you want to happen when the post is published.

_future_post_hook( int $deprecated, WP_Post $post ) #

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’.


Top ↑

Parameters

$deprecated

(int)(Required)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().

$post

(WP_Post)(Required)Post object.


Top ↑

Source

File: wp-includes/post.php

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 ) );
}


Top ↑

Changelog

Changelog
VersionDescription
2.3.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More