shopp_postcode_patterns

filters the regular expression postcode pattern table.

add_filter( 'shopp_postcode_patterns', [callback] )

@param array $patterns regular expression postcode pattern table.

Description

filters the regular expression postcode pattern table.

The postcode pattern table is used to verify the postcode is correct for the specified country.

Example

// register filter callback
add_filter('shopp_postcode_patterns', 'shopp_postcode_patterns_filter');

// create filter function
function shopp_postcode_patterns_filter( $patterns ) {
    // regular expression indexed on ISO-3166
    $patterns['US'] = '(\d{5})(\-\d{4})?';
    return $patterns;
}

See Also

You must be logged in to post a comment.

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

Skip to toolbar