Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Save Custom Field
- add_action( 'woocommerce_process_product_meta', 'woo_save_custom_shipping_fields' );
- function woo_save_custom_shipping_fields( $post_id ){
- $woocommerce_text_field = $_POST['delivery_time_frame'];
- if( !empty( $woocommerce_text_field ) )
- update_post_meta( $post_id, 'delivery_time_frame', esc_attr( $woocommerce_text_field ) );
- if( empty($woocommerce_text_field)):
- delete_post_meta($post_id,'delivery_time_frame');
- endif;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement