shopp_email_valid

filters the validation check on the checkout form which tests for a valid email address.

add_filter( 'shopp_email_valid', [callback] )

@param bool $error true when an email validation error will occur, and false if no error is necessary.

Description

filters the validation check on the checkout form which tests for a valid email address.

This filter should return true to trigger an error on an invalid email address, and should return false to prevent an error.

Example

// register filter callback
add_filter('shopp_email_valid', 'shopp_email_valid_filter');

// say you want to use the BSD licensed validator hosted on Google
// See http://code.google.com/p/php-email-address-validation/
include_once('EmailAddressValidator.php');

// create filter function
function shopp_email_valid_filter( $error ) {
    $validator = new EmailAddressValidator;

    // return true on error, false if ok
    return ! $validator->check_email_address($_POST['email']);
}

See Also

You must be logged in to post a comment.

© Ingenesis Limited. Shopp™ is a registered trademark of Ingenesis Limited.

Skip to toolbar