Last active
March 12, 2018 13:06
-
-
Save woogists/52cccaf4c70620e6013a9bc0fceeeae2 to your computer and use it in GitHub Desktop.
[Extending][Implementing the WC Integration Class] Validation
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
public function validate_api_key_field( $key, $value ) { | |
if ( isset( $value ) && 20 < strlen( $value ) ) { | |
WC_Admin_Settings::add_error( esc_html__( 'Looks like you made a mistake with the API Key field. Make sure it isn't longer than 20 characters', 'woocommerce-integration-demo' ) ); | |
} | |
return $value; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment