Skip to content

Instantly share code, notes, and snippets.

@fervous
Last active March 25, 2017 20:26
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 fervous/104215a3e4c905bf4306c91c6b271333 to your computer and use it in GitHub Desktop.
Save fervous/104215a3e4c905bf4306c91c6b271333 to your computer and use it in GitHub Desktop.
wc vendors pro set virtual and donwloadable as default yes selected
/* WC Vendors Pro set downloadable by default */
add_filter('product_type_options', 'product_type_options_default_download');
function product_type_options_default_download( $product_type_options ){
if ( array_key_exists('downloadable', $product_type_options ) ) $product_type_options[ 'downloadable' ][ 'default' ] = 'yes';
return $product_type_options;
}
/* WC Vendors Pro set virtual by default */
add_filter('product_type_options', 'product_type_options_default_virtual');
function product_type_options_default_virtual( $product_type_options ){
if ( array_key_exists('virtual', $product_type_options ) ) $product_type_options[ 'virtual' ][ 'default' ] = 'yes';
return $product_type_options;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment