Created
December 26, 2014 15:19
-
-
Save lmartins/a7b433476f5162ff58e3 to your computer and use it in GitHub Desktop.
Limit the product types available in the WooCommerce Dashboard
This file contains 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
/** | |
* Limit the product types that can be added to the store | |
*/ | |
add_filter( 'product_type_selector', 'mw_custom_product_type_change', 20 ); | |
function mw_custom_product_type_change( $product_types ) { | |
$new_array = array( | |
'subscription' => $product_types['subscription'] , | |
'variable-subscription' => $product_types['variable-subscription'] , | |
); | |
// $product_types = $new_array + $product_types; | |
$product_types = $new_array; | |
return $product_types; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment