Created
April 7, 2017 01:01
-
-
Save fervous/036c6dc790858e7c094df82187b66776 to your computer and use it in GitHub Desktop.
enable manage stock by default wc vendors pro
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
/* Default value for manage stock = checked */ | |
add_filter( 'wcv_product_manage_stock', 'change_default_manage_stock' ); | |
function change_default_manage_stock() { | |
$field['post_id'] = $post_id; | |
$field['id'] = '_manage_stock'; | |
$field['wrapper_class'] = 'show_if_simple show_if_variable'; | |
$field['label'] = __( 'Manage stock?', 'wcvendors-pro' ); | |
$field['description'] = __( 'Enable stock management at product level', 'wcvendors-pro' ); | |
$field['type'] = 'checkbox'; | |
$field['value'] = 'yes'; // This checks the checkbox | |
return $field; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment