check_and_publish_future_post [ WordPress Function ]
check_and_publish_future_post ( $post_id )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Benzer Fonksiyonlar: get_others_unpublished_posts, wp_publish_post, _publish_post_hook, user_can_delete_post, the_author_posts
Publish future post and make sure post ID has future post status.
Invoked by cron 'publish_future_post' event. This safeguard prevents cron from publishing drafts, etc.
Source
<?php
function check_and_publish_future_post($post_id) {
$post = get_post($post_id);
if ( empty($post) )
return;
if ( 'future' != $post->post_status )
return;
$time = strtotime( $post->post_date_gmt . ' GMT' );
if ( $time > time() ) { // Uh oh, someone jumped the gun!
wp_clear_scheduled_hook( 'publish_future_post', array( $post_id ) ); // clear anything else in the system
wp_schedule_single_event( $time, 'publish_future_post', array( $post_id ) );
return;
}
return wp_publish_post($post_id);
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- check_and_publish_future_post() WordPress function reference ...
Publish future post and make sure post ID has future post status.
queryposts.com - check_and_publish_future_post | A HitchHackers guide through ...
Feb 11, 2011 ... function check_and_publish_future_post($post_id) { $post = get_post($post_id); if ( empty($post) ) return; if ( 'future' != $post->post_status ) ...
hitchhackerguide.com - check_and_publish_future_post
Function and Method Cross Reference. check_and_publish_future_post(). Defined at: /wp-includes/post.php -> line 2788. No references found.
phpxref.ftwr.co.uk - post.php
Jul 16, 2009 ... Functions add_ping() add_post_meta() check_and_publish_future_post() clean_page_cache() clean_post_cache() delete_post_meta() ...
www.tig12.net