• Resolved disturbed-pixel

    (@disturbed-pixel)


    Hey, sorry to be a pain but i am back.

    When i am logged in to WP my “ACFe -> forms -> actions -> Save” work perfectly when submitting a form and it saves the “Post terms”, but when i log out of WP and submit the form again, they don’t get saved. I am not sure if it’s a problem with how the taxonomy is registered or a bug. (suspect the former).

    $args = array(
    ‘hierarchical’ => true,
    ‘labels’ => $labels,
    ‘show_ui’ => true,
    ‘show_admin_column’ => true,
    ‘query_var’ => true,
    ‘publicly_queryable’=> true,
    ‘public’ => true,
    ‘rewrite’ => array( ‘slug’ => ‘cat’, ‘with_front’ => false ),
    ‘capabilities’ => array( ‘manage_options’, ‘edit_posts’ ),
    );
    register_taxonomy(‘brief_types’, array( ‘brief’ ),$args);

    Have i done something wrong?

    Thanks
    Piers

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

    (@hwk-fr)

    Hello,

    Thanks for the feedback!

    I had a similar report last week. This is due to the fact Dynamic Forms use the native tax_input argument of wp_insert_post(). As suggested in a related note from the documentation: https://developer.www.ads-software.com/reference/functions/wp_insert_post/

    tax_input: Equivalent to calling wp_set_post_terms() for each custom taxonomy in the array. If the current user doesn’t have the capability to work with a taxonomy, then you must use wp_set_object_terms() instead.

    In other words, WordPress check the if the current has the rights to set terms. When you’re not logged-in, you don’t have that rights, so that’s why terms aren’t set as expected.

    The next patch will fix that problem by using wp_set_object_terms(), which is more versatile. It will also let you create and set terms dynamically, if it doesn’t exists. The update should be out this weekend, I just need to wrap up 1/2 more things ??

    Have a nice day!

    Regards.

    Thread Starter disturbed-pixel

    (@disturbed-pixel)

    Thanks @hwk-fr you are extremely helpful and offer top notch support. I love that you explain the problem too with references.

    I had created all these great forms, that work perfectly for me in all testing (though i never tested being logged out) but when i shared it with the client for testing, that was only thing that failed, which then prevented my “results / update” form from loading. (as i require that taxonomy being set).

    Look forward to testing this out.

    P.s. i am loving the forms i can create with ACF and ACFe!!!

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Just to let you know that the latest 0.8.5 Fixed this issue.

    Have a nice day ??

    Regards.

    Thread Starter disturbed-pixel

    (@disturbed-pixel)

    Brilliant works thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Action -> Save -> Post Terms not saved’ is closed to new replies.