Skip to content

Instantly share code, notes, and snippets.

@lmartins
Created December 26, 2014 15:19
Show Gist options
  • Save lmartins/a7b433476f5162ff58e3 to your computer and use it in GitHub Desktop.
Save lmartins/a7b433476f5162ff58e3 to your computer and use it in GitHub Desktop.
Limit the product types available in the WooCommerce Dashboard
/**
* 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