WordPress.org

Forums

The Future Is Now
Works for posts, but not for custom post types (4 posts)

  1. Jacob Gotwals
    Member
    Posted 3 years ago #

    Does anyone have any ideas on how to get similar functionality for custom post types?

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

  2. Scott Cariss
    Member
    Posted 3 years ago #

    The plugin will only work with posts and not CPT's thats because they hook into future_posts and not future_{CPT_NAME}

    If you know some coding this may help you with getting this to work with CPT's:

    remove_action("future_{$post_type}", '_future_post_hook');
    add_action("future_{$post_type}", 'publish_future_events_now', 2, 10);
    
    function publish_future_events_now($depreciated, $post) {
        wp_publish_post($post);
    }
  3. Jacob Gotwals
    Member
    Posted 3 years ago #

    Thanks!

  4. alex@ps122.org
    Member
    Posted 2 years ago #

    Hi any chance this can work for Pages? I tried some super amateur PHP copy/replacing, adding the code below but it didn't work. Thanks!! Great plugin.

    function setup_future_hook_page() {
    // Replace native future_page function with replacement
    remove_action('future_page', '_future_page_hook');
    add_action('future_page', 'publish_future_page_now');
    }

    function publish_future_page_now($id) {
    // Set new page's post_status to "publish" rather than "future."
    wp_publish_page($id);
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic