Skip to content

Instantly share code, notes, and snippets.

@digitalchild
Created May 28, 2015 03:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save digitalchild/16baaa9da4eeaf13e05f to your computer and use it in GitHub Desktop.
Save digitalchild/16baaa9da4eeaf13e05f to your computer and use it in GitHub Desktop.
Pseudo Code for removing a product type.
<?php
add_filter( 'product_type_selector', 'remove_listing_package');
// $product type is an array of product it containts the following:
//
// $product_type_selector = apply_filters( 'product_type_selector', array(
// 'simple' => __( 'Simple product', 'wcvendors-pro' ),
// 'grouped' => __( 'Grouped product', 'wcvendors-pro' ),
// 'external' => __( 'External/Affiliate product', 'wcvendors-pro' ),
// 'variable' => __( 'Variable product', 'wcvendors-pro' )
// ), $product_type );
//
function remove_listing_package($product_type) {
if ( WCV_Vendors::is_vendor( get_current_user_id() ) ) {
//unset the array index for listing_package (whatever that is. )
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment