WordPress.org

Forums

The Future Is Now
custom post types (3 posts)

  1. tpaolillo
    Member
    Posted 2 years ago #

    I cannot get this to work with custom post types. I saw the previous post about custom post types but i have tried to copy the code without any luck also. Can someone please post a fix that will allow this to work on custom post types also. Im using it on a classipress theme at http://www.sellmyapp.com
    Thanks
    Tony

    http://wordpress.org/extend/plugins/the-future-is-now/

  2. darrelly84
    Member
    Posted 2 years ago #

    Had the same issue. Figured it out. Replace the plugin's main code with this:

    function publish_future_events_now($depreciated, $post) {
        wp_publish_post($post);
    }
    
    remove_action('future_shows', '_future_post_hook');
    
    add_filter( 'wp_insert_post_data', 'futurenow_do_not_set_posts_to_future' );
    
    function futurenow_do_not_set_posts_to_future( $data ) {
        if ( $data['post_status'] == 'future' && $data['post_type'] == 'shows' )
            $data['post_status'] = 'publish';
        return $data;
    }

    Replacing "shows" (my custom post type) with yours. Working for me.

  3. spurwing
    Member
    Posted 1 year ago #

    Hello

    I'm trying to use this plugin on V3.8 using the above code, but it's not working. My custom post type is called 'events' so I'm using this code:

    function publish_future_events_now($depreciated, $post) {
        wp_publish_post($post);
    }
    
    remove_action('future_events', '_future_post_hook');
    
    add_filter( 'wp_insert_post_data', 'futurenow_do_not_set_posts_to_future' );
    
    function futurenow_do_not_set_posts_to_future( $data ) {
        if ( $data['post_status'] == 'future' && $data['post_type'] == 'events' )
            $data['post_status'] = 'publish';
        return $data;
    }

    Anyone got it working for a CPT on 3.8?

    Thanks

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • The Future Is Now
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.