• Resolved leonetrek

    (@leonetrek)


    I want to display a message about successful term addition

    acf.addAction('acfe/save_term', function(){
    alert('save_term');
    });

    This code doesn’t work

    • This topic was modified 3 years, 4 months ago by leonetrek.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Thanks for the feedback!

    Unfortunately that Javascript hook doesn’t exist. I would recommend to use the new_field hook if you need to interact with a field. See documentation. Usage example:

    acf.addAction('new_field/name=my_field', function(field){
    
        // add class to this field
        field.$el.addClass('my-class');
    
        // add click event to this field's button
        field.on('click', 'button', function( e ){
            e.preventDefault();
            alert('Special event');
        });
        
    });
    

    Hope it helps!

    Have a nice day!

    Regards.

    Thread Starter leonetrek

    (@leonetrek)

    Perhaps this is not quite the right decision.

    edit-tags.php?taxonomy=MY_CUSTOM_TAXONOMY&post_type=MY_CUSTOM_POST_TYPE
    After filling in the data of the new taxonomy, I click on the button “Add New”. After that, the taxonomy is added to the list of all taxonomies.

    • This reply was modified 3 years, 4 months ago by leonetrek.
    Thread Starter leonetrek

    (@leonetrek)

    In the original WordPress, after adding, the page reloads. When using the plugin, the addition occurs via ajax

    Thread Starter leonetrek

    (@leonetrek)

    Please see the link Screen

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    That ajax action always occurs when adding a term on that screen, with or without ACF/ACF Extended.

    That action is handled by WordPress in /wp-admin/includes/ajax-actions.php:1056 and the Javascript is located in /wp-admin/js/tags.js.

    What ACF does: It adds a validation request before that native ajax action. Using acf/validate_save_post.

    What ACF Extended does: It adds an enhanced UI style on that screen, but doesn’t touch the logic.

    Hope it helps!

    Have a nice day!

    Regards.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to get an answer after saving a term?’ is closed to new replies.