Custom Field is not showing under General Tab
-
I have imported the WooCommerce demo product.
Custom field is showing in “WordPress Pennant” product but not others and the other post interfaces are different, I don’t know why.// Display Fields add_action('woocommerce_product_options_general_product_data', 'woocommerce_product_custom_fields'); // Save Fields add_action('woocommerce_process_product_meta', 'product_condition_field_save'); function woocommerce_product_custom_fields() { global $woocommerce, $post; echo '<div class="product_custom_field">'; // Custom Product Text Field woocommerce_wp_text_input( array( 'id' => '_product_condition', 'placeholder' => esc_html__('Good, Very Good, Excellent', 'huddlefc'), 'label' => __('Product Condition', 'huddlefc'), 'desc_tip' => 'true' ) ); echo '</div>'; } // save field data function product_condition_field_save($post_id){ // Custom Product Text Field $product_condition = $_POST['_product_condition']; if (!empty($product_condition)){ update_post_meta($post_id, '_product_condition', esc_attr($product_condition)); } }
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Custom Field is not showing under General Tab’ is closed to new replies.