Last active
April 11, 2024 21:54
-
-
Save wpmudev-sls/d9b2e7eec3cf6c91f47e23bd2892bcc1 to your computer and use it in GitHub Desktop.
[Hustle Pro] Fix conflict with Shortcodes Ultimate tabs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: [Hustle Pro] Fix conflict with Shortcodes Ultimate tabs | |
* Description: Emulates the tabs' functionality when used within a Hustle Pop-up | |
* Author: Anderson Salas @ WPMUDEV | |
* Task: SLS-6013 | |
* Author URI: https://premium.wpmudev.org | |
* License: GPLv2 or later | |
*/ | |
add_action( 'wp_footer', function(){ | |
?> | |
<script id="hustle-us-tabs-emulation"> | |
( function($){ | |
$( function(){ | |
$( document ).on( 'hustle:module:loaded', function( e, o ){ | |
$( '.hustle-popup .su-tabs-nav span' ).click( function() { | |
var index = $( this ).index(); | |
var selector = '.hustle-popup.hustle_module_id_' + o.moduleId; | |
$( selector + ' .su-tabs-nav span').removeClass( 'su-tabs-current' ); | |
$( this ).addClass( 'su-tabs-current' ); | |
$( selector + ' .su-tabs-pane').removeClass( 'su-tabs-pane-open' ); | |
$( selector + ' .su-tabs-panes > div:nth-child(' + ( index + 1 ) + ')').addClass( 'su-tabs-pane-open' ); | |
}) | |
}); | |
}); | |
})( window.jQuery ); | |
</script> | |
<?php | |
}, 21 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment