Skip to content

Instantly share code, notes, and snippets.

@kharissulistiyo
Created April 22, 2015 00:49
Show Gist options
  • Save kharissulistiyo/451ca338911f121aee01 to your computer and use it in GitHub Desktop.
Save kharissulistiyo/451ca338911f121aee01 to your computer and use it in GitHub Desktop.
Woocommerce Custom Product Data Fields: Field setting to allow checkbox to be checked by default. https://wordpress.org/plugins/woocommerce-custom-product-data-fields/
$custom_product_data_fields[] = array(
'id' => '_mycheckbox',
'type' => 'checkbox',
'label' => __('Checkbox', 'wc_cpdf'),
'description' => __('Field description.', 'wc_cpdf'),
'desc_tip' => true,
'checked' => true, // Allows the checkbox to be checked by default.
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment