-
before_registration_form- Location:
includes/class-wwlc-shortcode.php:298 - Parameters:
$registration_form_fields(array) - Description: Fires before the registration form is rendered
- Use case: Add content or modify fields before form display
- Location:
-
after_registration_form- Location:
includes/class-wwlc-shortcode.php:356 - Parameters:
$registration_form_fields(array) - Description: Fires after the registration form is rendered
- Use case: Add content after the form
- Location:
-
wwlc_initialize_registration_form- Location:
includes/class-wwlc-forms.php:337 - Parameters: None
- Description: Fires when the registration form is initialized (after nonce and honeypot fields)
- Use case: Add custom fields or scripts at form start
- Location:
-
wwlc_end_registration_form- Location:
includes/class-wwlc-forms.php:350 - Parameters:
$options(array) - Shortcode options - Description: Fires at the end of the registration form (before closing form tag)
- Use case: Add hidden fields or scripts at form end
- Location:
-
wwlc_action_before_create_wholesale_lead- Location:
includes/class-wwlc-user-account.php:453 - Parameters:
$user_data(array),$auto_generated_password(bool),$password(string) - Description: Fires before creating a new wholesale lead
- Use case: Validate or modify user data before user creation
- Location:
-
wwlc_action_after_create_wholesale_lead- Location:
includes/class-wwlc-user-account.php:501 - Parameters:
$new_lead(WP_User object) - Description: Fires after a wholesale lead is created
- Use case: Perform actions after user creation
- Location:
-
wwlc_new_user_email- Location:
includes/class-wwlc-user-account.php:726 - Parameters:
$user_id(int),$user_pass(string) - Description: Fires when sending new user email
- Use case: Customize email behavior
- Location:
-
wwlc_registration_form_fields- Location:
includes/class-wwlc-shortcode.php:349 - Parameters:
$registration_form_fields(array) - Description: Filters the registration form fields array before rendering
- Use case: Modify, add, or remove form fields
- Important for VAT ID: Use this to add custom validation attributes to your VAT ID field
- Location:
-
wwlc_sanitized_user_data- Location:
woocommerce-wholesale-lead-capture.functions.php:576 - Parameters:
$sanitized_data(array),$raw_user_data(array),$context(string) - Description: Filters sanitized user data after processing
- Use case: Modify sanitized data before saving
- Location:
-
wwlc_create_user_response_data- Location:
includes/class-wwlc-user-account.php:554 - Parameters:
$response(array) - Description: Filters the response data after user creation attempt
- Use case: Modify success/error messages or add custom data
- Location:
-
wwlc_stop_registering- Location:
includes/class-wwlc-user-account.php:456 - Parameters:
$stop(bool),$user_data(array) - Description: Allows preventing user registration
- Use case: Add custom validation to block registration if validation fails
- Important for VAT ID: Use this to validate VAT ID via VIES before allowing registration
- Location:
-
wwlc_fail_user_login- Location:
includes/class-wwlc-user-account.php:461 - Parameters:
$message(string),$status(string) - Description: Filters the error message when registration is stopped
- Use case: Customize error messages
- Location:
-
wwlc_inline_notice- Location:
includes/class-wwlc-user-account.php:416, 539, 547 - Parameters:
$message(string),$status(string - 'success' or 'fail') - Description: Filters inline notice messages
- Use case: Customize success/error messages
- Location:
These filters allow you to modify field labels:
wwlc_filter_first_name_field_form_labelwwlc_filter_last_name_field_form_labelwwlc_filter_phone_field_form_labelwwlc_filter_email_field_form_labelwwlc_filter_username_form_labelwwlc_filter_company_field_form_labelwwlc_filter_country_field_form_labelwwlc_filter_address1_field_form_labelwwlc_filter_address1_field_form_placeholderwwlc_filter_address2_field_form_labelwwlc_filter_address2_field_form_placeholderwwlc_filter_city_field_form_labelwwlc_filter_city_field_form_placeholderwwlc_filter_state_field_form_labelwwlc_filter_state_field_form_placeholderwwlc_filter_postcode_field_form_labelwwlc_filter_postcode_field_form_placeholderwwlc_filter_password_field_form_label
wwlc_filter_registration_form_register_control- Filter the register button HTMLwwlc_filter_registration_form_login_control- Filter the login link HTMLwwlc_filter_registration_form_lost_password_control- Filter the lost password link HTMLwwlc_filter_terms_and_condition_text- Filter terms and conditions textwwlc_filter_privacy_policy_text- Filter privacy policy text
wwlc_filter_login_form_action- Filter login form action URLwwlc_filter_login_field_label_username- Filter username labelwwlc_filter_login_field_label_password- Filter password labelwwlc_filter_login_field_label_remember_me- Filter remember me labelwwlc_filter_login_field_label_login- Filter login button labelwwlc_login_form_args- Filter login form argumentswwlc_before_login_form- Action hook before login formwwlc_login_forms- Action hook for login form elements (used for reCAPTCHA)
wwlc_action_before_approve_user- Before user approvalwwlc_action_after_approve_user- After user approvalwwlc_action_before_reject_user- Before user rejectionwwlc_action_after_reject_user- After user rejectionwwlc_action_before_activate_user- Before user activationwwlc_action_after_activate_user- After user activationwwlc_action_before_deactivate_user- Before user deactivationwwlc_action_after_deactivate_user- After user deactivationwwlc_action_auto_approve_user- When user is auto-approved
wwlc_login_user_when_auto_approve- Filter whether to auto-login user when auto-approvedwwlc_login_redirect_url- Filter login redirect URLwwlc_filter_logout_redirect_url- Filter logout redirect URLwwlc_wholesale_lead_logout_redirect- Filter logout redirect URLwwlc_remove_user_after_rejection- Filter whether to remove user after rejectionwwlc_registration_success_message- Filter registration success messagewwlc_registration_status- Filter registration statuswwlc_always_display_message_after_registration- Filter whether to always show message after registration
wwlc_user_registration_form_fields- Filter all registration form fieldswwlc_user_registration_custom_fields- Filter custom fields onlywwlc_manage_user_controls- Filter user management controlswwlc_allowed_user_roles- Filter allowed user roles for viewing custom fieldswwlc_blacklist_field_attribute_wpml_translate- Filter field attributes to exclude from WPML translationwwlc_show_custom_fields_on_order_details- Filter whether to show custom fields on order details
wwlc_registration_form_loaded- Filter whether registration form is loadedwwlc_login_form_loaded- Filter whether login form is loadedwwlc_upgrade_account- Filter whether to show upgrade account page
wwlc_required_plugins- Filter required plugin dependencieswwlc_registration_allowed_roles- Filter allowed roles for registrationwwlc_redirect_page_url- Filter redirect page URLsenable_login_page_recaptcha- Filter whether to enable reCAPTCHA on login pagewwlc_sanitized_user_data- Filter sanitized user data
The plugin also uses standard WooCommerce hooks:
woocommerce_form_field_text- Filter text field outputwoocommerce_form_field_recaptcha- Filter reCAPTCHA field outputwoocommerce_form_field_file- Filter file field outputwoocommerce_form_field_url- Filter URL field outputwoocommerce_form_field_hidden- Filter hidden field outputwoocommerce_form_field_wwlc_password- Filter password field outputwoocommerce_form_field_wwlc_checkbox- Filter checkbox field outputwoocommerce_form_field_radio- Filter radio field output
wwlc_stop_registering— Use to validate VAT ID via VIES API and prevent registration if invalidwwlc_registration_form_fields— Use to add custom validation attributes or modify the VAT ID fieldwwlc_action_before_create_wholesale_lead— Use to validate VAT ID before user creationwwlc_sanitized_user_data— Use to sanitize/validate VAT ID data formatwwlc_create_user_response_data— Use to add custom error messages if VAT ID validation fails
// Validate VAT ID via VIES before registration
add_filter( 'wwlc_stop_registering', function( $stop, $user_data ) {
if ( isset( $user_data['your_vat_id_field'] ) ) {
$vat_id = $user_data['your_vat_id_field'];
// Perform VIES validation
if ( ! your_vies_validation_function( $vat_id ) ) {
return true; // Stop registration
}
}
return $stop;
}, 10, 2 );
// Add custom error message
add_filter( 'wwlc_fail_user_login', function( $message, $status ) {
if ( $status === 'vat_validation_failed' ) {
return 'Invalid VAT ID. Please check your VAT number.';
}
return $message;
}, 10, 2 );This list covers the hooks available in the WooCommerce Wholesale Lead Capture plugin for implementing VIES VAT ID validation.