← All changes
|
admin/advanced-settings/includes/forms/ec-bypass.php
+17
-1
3.9.8
→
4.0.3
View file →
| @@ -1,11 +1,27 @@ | ||
| 1 | 1 | <?php |
| 2 | +// Exit if accessed directly | |
| 3 | +if ( ! defined( 'ABSPATH' ) ) exit; | |
| 2 | 4 | |
| 3 | 5 | add_filter( 'wppb_email_confirmation_on_register', 'wppb_toolbox_bypass_email_confirmation', 2, 20 ); |
| 4 | 6 | function wppb_toolbox_bypass_email_confirmation( $email_confirmation, $global_request ) { |
| 5 | 7 | $forms = wppb_toolbox_get_settings( 'forms', 'ec-bypass' ); |
| 6 | 8 | |
| 7 | - if ( in_array( $global_request['form_name'], $forms ) ) | |
| 9 | + if ( ! empty( $global_request['form_name'] ) && is_array( $forms ) && in_array( $global_request['form_name'], $forms, true ) ) { | |
| 8 | 10 | return 'no'; |
| 11 | + } | |
| 9 | 12 | |
| 10 | 13 | return $email_confirmation; |
| 14 | +} | |
| 15 | + | |
| 16 | +add_filter( 'wppb_register_send_credentials_via_email', 'wppb_toolbox_force_enable_send_credentials_via_email', 2, 20 ); | |
| 17 | +function wppb_toolbox_force_enable_send_credentials_via_email( $send_credentials, $user_id, $form_args ) { | |
| 18 | + | |
| 19 | + $forms = wppb_toolbox_get_settings( 'forms', 'ec-bypass' ); | |
| 20 | + | |
| 21 | + if ( ! empty( $form_args['form_name'] ) && is_array( $forms ) && in_array( $form_args['form_name'], $forms, true ) ) { | |
| 22 | + return 'no'; | |
| 23 | + } | |
| 24 | + | |
| 25 | + return $send_credentials; | |
| 26 | + | |
| 11 | 27 | } |