• Drake

    (@marcoragogna)


    Hello,
    I know that there is already a open thread about this problem but I think that is better to create a new one because maybe they are not related.

    So, I have a commercial theme that define a custom post for real properties. I would like that when a user create a duplicate the default status is draft instead of published.

    I found the code that is used to register the specific custom post type:

    
    // register the custom post type
    add_action('init', 'wpestate_create_property_type',1);
    
    if( !function_exists('wpestate_create_property_type') ):
    function wpestate_create_property_type() {
        register_post_type('estate_property', array(
            'labels' => array(
                'name'                  => __('Properties','wpestate'),
                'singular_name'         => __('Property','wpestate'),
                'add_new'               => __('Add New Property','wpestate'),
                'add_new_item'          => __('Add Property','wpestate'),
                'edit'                  => __('Edit','wpestate'),
                'edit_item'             => __('Edit Property','wpestate'),
                'new_item'              => __('New Property','wpestate'),
                'view'                  => __('View','wpestate'),
                'view_item'             => __('View Property','wpestate'),
                'search_items'          => __('Search Property','wpestate'),
                'not_found'             => __('No Properties found','wpestate'),
                'not_found_in_trash'    => __('No Properties found in Trash','wpestate'),
                'parent'                => __('Parent Property','wpestate')
            ),
            'public' => true,
            'has_archive' => true,
            'rewrite' => array('slug' => 'properties'),
            'supports' => array('title', 'editor', 'thumbnail', 'comments','excerpt'),
            'can_export' => true,
            'register_meta_box_cb' => 'wpestate_add_property_metaboxes',
            'menu_icon'=>get_template_directory_uri().'/img/properties.png'
             )
        );
    

    Let me know if you need other information, like debug output, or if you want to try some specific code.

    Thank you ind advance for the support,
    Marco

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author metaphorcreations

    (@metaphorcreations)

    Go to Dashboard > Tools > Post Duplicator and set the duplicated Post Status to Draft.

    Let me know if that doesn’t work for you for some reason.

    Thread Starter Drake

    (@marcoragogna)

    Thank you for the prompt answer and sorry I forgot to mention that the Post Status is already set to draft in Dashboard -> Tools -> Post Duplicator.

    Same problem for me. I’m not using custom post types and my post status is set to “Draft.” I noticed that when I duplicate a post it is immediately published IF post date is set to Current Time. When I set post date to Duplicate Timestamp, the post is correctly saved as a draft. Maybe this is expected behavior, but it’s a little confusing. Regardless, setting post date to Current Time might fix your problem.

    I can replicate this issue also.

    What seems to to solve it, is to set the Offset Date to 1 second (or more) newer than Current Time.

    This generates a draft instead of a published post.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Duplicate custom post status is set to published instead of draft’ is closed to new replies.