Custom Fields
Support Meta Box Tabs Custom button to switch tabs

  • Creator
  • #10161
    Resolved meta_gecko


    I'd like to add a button at the bottom of the page in the WP Admin beneath all the fields in a Tab to switch to the a different tab when clicked.

    I've been trying to add it using the html field, and basically just want to pass the click event from the button at the bottom to switch to the next tab (there are only two tabs).

    I can get it to switch, but because the event is set to prevent bubbling up, it does not remove the "rwmb-tab-active" class from the tab I'm switching away from.

    Also, if I go back to that tab, then my code has added the active panel class to the custom button.

    I can see why it isn't working properly, but is anyone able to help me out with the correct callback?

Viewing 1 replies (of 1 total)
  • Author
  • #10165

    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-active a' ).trigger( 'click' );
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.