Support » Plugin: Advanced Custom Fields: Extended » Frontend Form – Scheduled Status

  • Resolved yourtrustedfreelancer

    (@yourtrustedfreelancer)


    Hi,
    First I want to thank you for this amazing work of art.

    My question:
    How can I set the date for the scheduled ( future ) post status? I currently see no mapping option and when I set the status to scheduled it will just get published.

    Many thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Thanks for the feedback! Sorry for the late answer, I’m currently really busy with the next patch.

    The “Scheduled” post status should be used in conjonction with post_date argument. However, the UI is not implemented yet due to the complexity to fit to everyone’s need.

    I added it to the Trello board: https://trello.com/c/PXM9W3JS/126-dynamic-forms-add-post-date-setting-in-the-post-action-for-scheduled-status

    Meanwhile, you can use the following code in order to filter the post creation arguments:

    
    add_filter('acfe/form/submit/post_args/action=my-post-action', 'my_form_post_scheduled_args', 10, 4);
    function my_form_post_scheduled_args($args, $type, $form, $action){
    
        $args['post_date'] = date('Y-m-d H:i:s', strtotime('tomorrow'));
        $args['post_date_gmt'] = date('Y-m-d H:i:s', strtotime('tomorrow'));
        
        return $args;
        
    }
    

    Note: This hook target the Post Action named my-post-action, make sure to update it with your setup.

    Hope it helps 🙂

    Regards.

    Thread Starter yourtrustedfreelancer

    (@yourtrustedfreelancer)

    Thank you for your reply, this is really helpful.
    You are doing a great job, and we all appreciate it.

    With regards.

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    I’m glad you made it worked! If you enjoy this plugin, feel free to submit a review, it always helps and it’s much appreciated 🙂

    Have a nice day!

    Regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Frontend Form – Scheduled Status’ is closed to new replies.