WooCommerce: Validate custom fields on My Account's edit page
<p>I've added custom fields to my WooCommerce registration using <a href="https://support.woothemes.com/hc/en-us/articles/203182373-How-to-add-custom-fields-in-user-registration-on-the-My-Account-page" rel="nofollow noreferrer">this process</a>.
I've made them available on the My Account's edit page using these actions:</p>

<pre><code>// added custom fields here
add_action( 'woocommerce_edit_account_form', 'my_woocommerce_edit_account_form' );   

// saved user meta here
add_action( 'woocommerce_save_account_details', 'my_woocommerce_save_account_details' );
</code></pre>

<p>In between the two, I need to validate these fields when editing. I tried using the <code>woocommerce_process_myaccount_field_</code> filter (<a href="https://stackoverflow.com/a/35330812/4469652">as mentioned here</a>) but that didn't work. The code inside it doesn't trigger when I save the changes.</p>

<p>Any ideas on how can I validate? <br>
Am I using the correct filter? <br>
If yes, why doesn't it trigger? </p>

<p>Thanks.</p>