Support

Account

Home Forums Backend Issues (wp-admin) Active Tab Dependant on Category Reply To: Active Tab Dependant on Category

  • You need to add an event to a trigger on the field. For the standard WP category box you need to add an action when something there is changed. For an ACF taxonomy field you need to add an action to the change event of that field. Take a look at the jQuery docs for .on(), .bind(), .click(), etc. There are probably dozens of ways this can be done but really nothing to do with ACF.

    As far as making a specific tab active, all you really need to do is trigger the click event for that tab in the action you add to the other element. For example, if I have an acf field group with the group key of group_586cf71a7742c and a tab with a field key of field_586d38c5329b5

    
    $('#acf-group_586cf71a7742c .acf-tab-wrap [data-key="field_586d38c5329b5"]').trigger('click');