Server IP : 172.67.157.199 / Your IP : 18.219.118.7 [ Web Server : Apache System : Linux b70eb322-3aee-0c53-7c82-0db91281f2c6.secureserver.net 6.1.90-1.el9.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 2 12:09:22 EDT 2024 x86_64 User : root ( 0) PHP Version : 8.0.30.2 Disable Function : NONE Domains : 0 Domains MySQL : ON | cURL : ON | WGET : ON | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/wp-content/plugins/profile-builder/admin/advanced-settings/includes/forms/ |
Upload File : |
<?php // Exit if accessed directly if ( ! defined( 'ABSPATH' ) ) exit; function wppb_toolbox_check_email_domain( $message, $field, $request_data, $form_location ) { $type = wppb_toolbox_get_settings( 'forms', 'restricted-email-domains-type' ); if ( $type == false ) return $message; $restricted_domains = wppb_toolbox_get_settings( 'forms', 'restricted-email-domains-data' ); if ( $restricted_domains == false ) return $message; $domain = strtolower( substr( strrchr( trim( $request_data['email'] ), '@' ), 1 ) ); $validation_message = wppb_toolbox_get_settings( 'forms', 'restricted-email-domains-message' ); if ( $type == 'allow' ) { if ( !in_array( $domain, $restricted_domains ) ) return $validation_message; } else if ( $type == 'deny' ) { if ( in_array( $domain, $restricted_domains ) ) return $validation_message; } return $message; } add_filter( 'wppb_check_form_field_default-e-mail', 'wppb_toolbox_check_email_domain', 20, 4 );