Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example implementation for a hidden field as WooCommerce product meta field, in the "General" tab.
<?php
function prefix_add_hidden_input() {
$args = array(
'value' => '', // meta_value, meta_key is the id
'class' => '',
'id' => '' // required, makes the meta_key for storing the value
);
woocommerce_wp_hidden_input( $args );
}
add_action( 'woocommerce_product_options_tax', 'prefix_add_hidden_input' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.