Last active
November 6, 2017 02:11
-
-
Save bhavik-kiri/58797d0dff1141eed29d3e6ba07248f2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'woocommerce_process_product_meta', 'save_gift_card_options_field' ); | |
function save_gift_card_options_field( $post_id ) { | |
$enable_gift_card = isset( $_POST['_enable_gift_card'] ) ? 'yes' : 'no'; | |
update_post_meta( $post_id, '_enable_gift_card', $enable_gift_card ); | |
if ( isset( $_POST['_gift_card_price'] ) ) : | |
update_post_meta( $post_id, '_gift_card_price', sanitize_text_field( $_POST['_gift_card_price'] ) ); | |
endif; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment