Created
June 22, 2019 20:59
-
-
Save JudeRosario/f1761e600d65efe0d7b7c7d2c3e9e0c3 to your computer and use it in GitHub Desktop.
Product Data Tabs Fix
This file contains hidden or 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
/** | |
* Remove broken product data tabs | |
*/ | |
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 ); | |
function woo_remove_product_tabs( $tabs ) { | |
unset( $tabs['description'] ); // Remove the description tab | |
unset( $tabs['reviews'] ); // Remove the reviews tab | |
return $tabs; | |
} | |
add_filter( 'yikes_woo_use_the_content_filter', '__return_false' ); | |
add_filter( 'yikes_woo_filter_main_tab_content', 'yikes_woo_custom_tab_content_filter', 10, 1 ); | |
function yikes_woo_custom_tab_content_filter( $content ) { | |
$content = function_exists( 'capital_P_dangit' ) ? capital_P_dangit( $content ) : $content; | |
$content = function_exists( 'wptexturize' ) ? wptexturize( $content ) : $content; | |
$content = function_exists( 'convert_smilies' ) ? convert_smilies( $content ) : $content; | |
$content = function_exists( 'wpautop' ) ? wpautop( $content ) : $content; | |
$content = function_exists( 'shortcode_unautop' ) ? shortcode_unautop( $content ) : $content; | |
$content = function_exists( 'prepend_attachment' ) ? prepend_attachment( $content ) : $content; | |
$content = function_exists( 'wp_make_content_images_responsive' ) ? wp_make_content_images_responsive( $content ) : $content; | |
if ( class_exists( 'WP_Embed' ) ) { | |
// Deal with URLs | |
$embed = new WP_Embed; | |
$content = method_exists( $embed, 'autoembed' ) ? $embed->autoembed( $content ) : $content; | |
} | |
return $content; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment