[wp-hackers] immediate publishing of future posts

Sindikat Blog sindikatblog at gmail.com
Thu Aug 28 21:43:35 GMT 2008


Hi, I would like to be able to publish some future posts immediately. This
would be useful for making posts about future events. I had written a small
plugin that did the trick, but somehow it stopped working. Can anyone help
me fix the following code. Thanks.


add_action('init', 'setup_future_hook');

function setup_future_hook() {
 // Replace native future_post function with replacement
 remove_action('future_post', 'check_and_publish_future_post');
 add_action('future_post', 'publish_future_post_now');
}

function publish_future_post_now($post_ID) {
    $publish_future_posts = TRUE;
    if($publish_future_posts)
    {
        wp_publish_post($post_id);
    } else {
        _future_post_hook('', $post_ID);
    }
}


More information about the wp-hackers mailing list