{"push_id":1266307008,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"7b6655ceaa42cdb6865e6a3760dbd954774f165d","before":"d4d1a95f21ffc09fa495cc3f6159c70cc8a61829","commits":[{"sha":"7b6655ceaa42cdb6865e6a3760dbd954774f165d","author":{"name":"WM4362","email":"af72fa57277baed4e191ce0a0a1725e1579977d6@gmail.com"},"message":"Update class-wc-form-handler.php - New Hook\n\nAdded a new hook ('woocommerce_save_addresses_errors') on line 140 to allow custom field validation on My Account - Billing & Shipping Address changes.\r\n\r\nIt is consistent with the existing hook ( 'woocommerce_save_account_details_errors') that allows custom field validation on My Account - Account Details changes.\r\n\r\nI'm currently building my own Woocommerce store and noticed this simple, yet sizable 'gap' in hook offerings. Especially considering any custom field validation applied to the Checkout using the existing 'woocommerce_checkout_process' hook, can easily be undone by customers later through My Account.\r\n\r\nI have tested this in my own child theme's functions.php without error. E.g.\r\n\r\nadd_action( 'woocommerce_save_addresses_errors', 'validate_addresses_fields' );\r\nfunction validate_addresses_fields() {\r\n  if ( !empty( $_POST['billing_postcode']) && !ctype_digit( $_POST['billing_postcode'] ) )\r\n    wc_add_notice( __( '<strong>Billing Postcode</strong> contains non-numeric characters.' ), 'error' );\r\n    if ( !empty( $_POST['shipping_postcode']) && !ctype_digit( $_POST['shipping_postcode'] ) )\r\n    wc_add_notice( __( '<strong>Shipping Postcode</strong> contains non-numeric characters.' ), 'error' );\r\n}","distinct":true,"url":"https://api.github.com/repos/WM4362/woocommerce/commits/7b6655ceaa42cdb6865e6a3760dbd954774f165d"}]}
{"actor":{"display_login":"WM4362"}}