Last active
March 25, 2017 20:26
-
-
Save fervous/104215a3e4c905bf4306c91c6b271333 to your computer and use it in GitHub Desktop.
wc vendors pro set virtual and donwloadable as default yes selected
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
/* 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