Created
October 17, 2016 22:53
-
-
Save LaurenaRehbein/85dd9dcb52f0435027511300df6fcb92 to your computer and use it in GitHub Desktop.
Validate your WooCommerce integration settings.
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