How to save custom field data on a gift card edit page?

For saving the custom fields data on the gift card product edit page. You can use the following code in functions.php

 

add_action('mwb_wgm_giftcard_product_type_save_fields', 'mwb_wgm_save_custom_filed')

function mwb_wgm_save_custom_filed( $product_id ){

$custom_price = isset( $_POST[''mwb_custom_price''] ) ? sanitize_text_field( wp_unslash( $_POST[''mwb_custom_price''] ) ) : 0;

update_post_meta( $product_id, '_custom_price', $custom_price );

}

Was this Helpful ?

CONTACT

Ready to transform how you market your business

Let's get connected for a free consultation