Last active
December 11, 2024 06:00
-
-
Save tanmay27vats/89f9d67db78c33a6ffa1d844235a5db1 to your computer and use it in GitHub Desktop.
Remove "Product Type/Product Data" Dropdown Options - 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
add_filter( 'product_type_selector', 'remove_product_types' ); | |
function remove_product_types( $types ){ | |
unset( $types['grouped'] ); | |
unset( $types['external'] ); | |
unset( $types['variable'] ); | |
return $types; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
add_filter('product_type_selector', 'custom_product_type_selector');
function custom_product_type_selector($types) {
// Keep only 'simple' and 'variable' product types
$allowed_types = array(
'simple' => $types['simple'],
);
}