Created
March 31, 2020 17:47
-
-
Save ronalfy/9d9e6499680e922e810f17dab6481e11 to your computer and use it in GitHub Desktop.
Paid Memberships Pro - Require VAT
This file contains hidden or 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
<?php | |
function pmprovat_required_vat_fields_submission( $value ) { | |
global $pmpro_msg, $pmpro_msgt; | |
$vat_number = sanitize_text_field( $_REQUEST['vat_number'] ); | |
if ( empty( $vat_number ) ) { | |
$pmpro_msg = 'VAT is required'; | |
$pmpro_msgt = 'pmpro_error'; | |
} | |
return $value; | |
} | |
add_filter( 'pmpro_registration_checks', 'pmprovat_required_vat_fields_submission', 9 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment