Woocommerce get billing state manually

To avoid that error, you have to add something in your function like: add_filter( ‘woocommerce_email_recipient_new_order’, ‘tm_destinatario_condicionado_wc’, 10, 2 ); function tm_destinatario_condicionado_wc( $recipient, $order ) { // To avoid an error in backend if( ! is_a($order, ‘WC_Order’) ) return $recipient; $estados = array( ‘aguascalientes’ => ‘AG’, ‘baja-california’ => ‘BC’, // etc etc … ); // Get … Read more

Custom Field created in add_meta_boxes reappearing itself again in the default Custom Metabox

Prepending your metakey with an underscore _ makes it private and prevents the data from showing up in the default metabox. So instead of this, update_post_meta( $post_id,’product_desc_en’, wp_kses_post( $_POST[‘product_desc_en’] ) ); do this, update_post_meta( $post_id,’_product_desc_en’, wp_kses_post( $_POST[‘product_desc_en’] ) ); and your custom meta shouldn’t show up in the default metabox. P.s. And of course, when … Read more