Custom Fields
Re-Envisioned
Support Meta Box Tabs Custom button to switch tabs Reply To: Custom button to switch tabs

#10165

meta_gecko
Participant

My earlier reply has been put in quarantine because I tried to make it look a bit tidier..

It said this below (please delete the duplicate):

meh, close enough since this is a single implementation on a site, although I would still like to know how to write a variable function for this:

jQuery( function( $ ) {
  $( '.wtv_switch' ).on( 'click', function(e) {

    if ($('.rwmb-tab-tax_filters').hasClass('rwmb-tab-active')) {
      $('.rwmb-tab-tax_filters').removeClass('rwmb-tab-active');
      $('.rwmb-tab-fact_compose').addClass('rwmb-tab-active');
    }

  $( '.rwmb-tab-active a' ).trigger( 'click' );

  });
});