Created
August 18, 2020 01:46
-
-
Save neilgee/808fc4f8f6e4f35ff7285c6631e02392 to your computer and use it in GitHub Desktop.
Remove Product Tags from Products in WooCommerce
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
<?php //<~ don't add me in | |
/** | |
* Remove Product Tags from Products Post Type - WooCommerce | |
* @link https://rudrastyh.com/woocommerce/remove-product-tags.html | |
* @author Misha Rudrastyh | |
*/ | |
add_action( 'admin_menu', 'themeprefix_hide_product_tags_admin_menu', 9999 ); | |
function themeprefix_hide_product_tags_admin_menu() { | |
remove_submenu_page( 'edit.php?post_type=product', 'edit-tags.php?taxonomy=product_tag&post_type=product' ); | |
} | |
add_action( 'admin_menu', 'themeprefix_hide_product_tags_metabox' ); | |
function themeprefix_hide_product_tags_metabox() { | |
remove_meta_box( 'tagsdiv-product_tag', 'product', 'side' ); | |
} | |
add_filter('manage_product_posts_columns', 'themeprefix_hide_product_tags_column', 999 ); | |
function themeprefix_hide_product_tags_column( $product_columns ) { | |
unset( $product_columns['product_tag'] ); | |
return $product_columns; | |
} | |
add_filter( 'quick_edit_show_taxonomy', 'themeprefix_hide_product_tags_quick_edit', 10, 2 ); | |
function themeprefix_hide_product_tags_quick_edit( $show, $taxonomy_name ) { | |
if ( 'product_tag' == $taxonomy_name ) | |
$show = false; | |
return $show; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment