Skip to content

Instantly share code, notes, and snippets.

@landbryo
Last active October 16, 2020 16:07
Show Gist options
  • Save landbryo/c2969cdae3209867e745dc82d09b32ed to your computer and use it in GitHub Desktop.
Save landbryo/c2969cdae3209867e745dc82d09b32ed to your computer and use it in GitHub Desktop.
Restrict Content Pro Avatax - Allow users to disable Avatax address validation before submitting the address.
<?php
// Disable for all registrations
add_filter( 'rcp_avatax_disable_validate_address', '__return_true' );
// Selectively disable address validation example by state/province
add_filter( 'rcp_avatax_disable_validate_address', function ( $disable, $post ) {
$state = isset( $post['rcp_card_state'] ) ? $post['rcp_card_state'] : '';
if ( 'QC' === $state ) {
$disable = true;
}
return $disable;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment