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');
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.