Last active
May 17, 2021 15:25
-
-
Save cubehrends/d3af852e064acc97f23e1efdb6610074 to your computer and use it in GitHub Desktop.
Processing WooCommerce Meta Infos
This file contains 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', 'wdt_process_delivery_time_fallback', 10, 2 ); | |
function wdt_process_delivery_time_fallback( $id, $post ){ | |
$dtf_id = $_POST['delivery_time_fallback']; | |
if( $dtf_id === '' ) { | |
delete_post_meta( $id, '_delivery_time_fallback' ); | |
} else { | |
update_post_meta( $id, '_delivery_time_fallback', $dtf_id ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment