Wordpress - Marking future dated post as published

I can't tell for sure since I don't have your site to test with but I believe you just need to remove 'show' from remove_action() and add_action() calls. The wp_publish_post() function is agnostic with respect to post types, at least that's what it appears from reading the code. So try this:

<?php
    function setup_future_hook() {
        // Replace native future_post function with replacement
        remove_action('future_post', '_future_post_hook');
        add_action('future_post', 'publish_future_post_now');
    }

    function publish_future_post_now($id) {
        // Set new post's post_status to "publish" rather than "future."
        wp_publish_post($id);
    }

    add_action('init', 'setup_future_hook');
?>

Of course if you want to limit to only doing shows you might want to do something like this (although the logic will be more complicated if you need it to work with other post types too):

function publish_future_post_now($id) {
    $post = get_post($id);
    if ('show' == $post->post_type)
        wp_publish_post($id);
}

Hope this helps?


Awesome combining both the answers from Mike and Jan I came up with this which works only on the post type in question. We don't need the conditional of show because the 'future_show' hook only grabs the post type of show and updates that.

<?php
    function setup_future_hook() {
        // Replace native future_post function with replacement
        remove_action('future_show','_future_post_hook');
        add_action('future_show','publish_future_post_now');
    }

    function publish_future_post_now($id) {
        wp_publish_post($id);
    }

    add_action('init', 'setup_future_hook');
?>

I think this action gets called by wp_transition_post_status. The code is:

function wp_transition_post_status($new_status, $old_status, $post) {
    do_action('transition_post_status', $new_status, $old_status, $post);
    do_action("${old_status}_to_$new_status", $post);
    do_action("${new_status}_$post->post_type", $post->ID, $post);
}

So for normal future posts the last hook will be future_post, but for your type it will be future_show or whatever your type slug is.