Last active
May 22, 2022 08:39
-
-
Save arixwap/dccb3b95500fa2578c1aa3667eabb27f to your computer and use it in GitHub Desktop.
How to remove metabox product gallery in woocommerce admin page product detail
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 | |
// Exit if accessed directly. | |
defined( 'ABSPATH' ) || exit; | |
// Check if plugin woocommerce is active | |
if ( ! class_exists( 'WooCommerce' ) ) return; | |
/** | |
* Remove metabox in product page | |
* | |
* @return void | |
*/ | |
add_action( 'add_meta_boxes', 'remove_product_meta_boxes', 40 ); | |
function remove_product_meta_boxes() { | |
remove_meta_box( 'postimagediv', 'product', 'side' ); // Remove metabox product thumbnail | |
remove_meta_box( 'woocommerce-product-images', 'product', 'side' ); // Remove metabox product gallery | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment