Validation of Custom Product Metadata
-
I have created some custom fields to store some custom meta data for a woocommerce product. This all works fine but how can I raise an error if a value is provided for example? There are many examples on how to store meta data but haven’t been able to find any examples concerning validation of that data.
add_action('woocommerce_process_product_meta', function($post_id) { if(isset($_POST['some_custom_meta']) { //save to database } else { //raise an error? How? });
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Validation of Custom Product Metadata’ is closed to new replies.