| 1 |
<?php |
| 2 |
// Exit if accessed directly |
| 3 |
if ( ! defined( 'ABSPATH' ) ) exit; |
| 4 |
|
| 5 |
add_filter( 'wppb_email_confirmation_on_register', 'wppb_toolbox_bypass_email_confirmation', 2, 20 ); |
| 6 |
function wppb_toolbox_bypass_email_confirmation( $email_confirmation, $global_request ) { |
| 7 |
$forms = wppb_toolbox_get_settings( 'forms', 'ec-bypass' ); |
| 8 |
|
| 9 |
if ( ! empty( $global_request['form_name'] ) && is_array( $forms ) && in_array( $global_request['form_name'], $forms, true ) ) { |
| 10 |
return 'no'; |
| 11 |
} |
| 12 |
|
| 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 |
|
| 27 |
} |
| 28 |
|