Skip to content

Instantly share code, notes, and snippets.

@maxrice
Last active August 29, 2015 14:18
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save maxrice/b7cbc2ab0f8649e061e0 to your computer and use it in GitHub Desktop.
WooCommerce Tab Manager - Force Tab Resize
<?php
/**
* Plugin Name: WooCommerce Tab Manager Force Resize
* Plugin URI: http://www.skyverge.com/contact
* Description: Forces the product page tabs to resize when clicked
* Author: SkyVerge
* Author URI: http://www.skyverge.com
* Version: 1.0.0
*
* Copyright: (c) 2015 SkyVerge, Inc. (info@skyverge.com)
*
* License: GNU General Public License v3.0
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
function wc_tab_manager_force_tab_resize() {
wc_enqueue_js( '
$( ".woocommerce-tabs [class$=\'_tab\'] a" ).click( function() {
var selector = $( this ).attr( "href" );
$( selector ).resize()
} );
' );
}
add_action( 'woocommerce_after_single_product_summary', 'wc_tab_manager_force_tab_resize' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment