PHP Class WC_Validation

Author: WooThemes
Afficher le fichier Open project: woocommerce/woocommerce Class Usage Examples

Méthodes publiques

Méthode Description
format_phone ( mixed $tel ) : string format_phone function.
format_postcode ( $postcode, $country ) : string Format the postcode according to the country and length of the postcode.
is_GB_postcode ( string $to_check ) : boolean Check if is a GB postcode.
is_email ( $email ) : boolean Validates an email using wordpress native is_email function.
is_phone ( $phone ) : boolean Validates a phone number using a regular expression.
is_postcode ( $postcode, $country ) : boolean Checks for a valid postcode.

Method Details

format_phone() public static méthode

format_phone function.
public static format_phone ( mixed $tel ) : string
$tel mixed
Résultat string

format_postcode() public static méthode

Format the postcode according to the country and length of the postcode.
public static format_postcode ( $postcode, $country ) : string
Résultat string formatted postcode

is_GB_postcode() public static méthode

Check if is a GB postcode.
Author: John Gardner
public static is_GB_postcode ( string $to_check ) : boolean
$to_check string A postcode
Résultat boolean

is_email() public static méthode

Validates an email using wordpress native is_email function.
public static is_email ( $email ) : boolean
Résultat boolean

is_phone() public static méthode

Validates a phone number using a regular expression.
public static is_phone ( $phone ) : boolean
Résultat boolean

is_postcode() public static méthode

Checks for a valid postcode.
public static is_postcode ( $postcode, $country ) : boolean
Résultat boolean