PluginProbe
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor / 3.9.8
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor v3.9.8
4.0.3 4.0.2 4.0.1 4.0.0 3.16.6 3.16.5 3.16.4 3.16.3 3.16.2 3.16.1 3.16.0 3.15.9 3.9.9 3.9.5 3.9.6 3.9.7 3.9.8 1.1.7 1.1.8 1.1.9 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 All 341 releases
profile-builder / admin / advanced-settings / includes / shortcodes / resend-activation.php

resend-activation.php in User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor 3.9.8, at admin/advanced-settings/includes/shortcodes/resend-activation.php

38 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 add_shortcode( 'wppb-resend-activation', 'wppb_toolbox_resend_activation_url_handler' );
4 function wppb_toolbox_resend_activation_url_handler() {
5 $button_name = __('Resend activation email', 'profile-builder');
6 $output = '<form enctype="multipart/form-data" method="post" id="wppbc-resend_activation" class="wppb-user-forms" action="">';
7 $output .= '
8 <li class="wppb-form-field'. apply_filters( 'wppb_resend_activation_extra_css_class', '', 'resend_activation_email') .'">
9 <label for="username_email" style="padding-right: 30px;">'.__( 'Email', 'profile-builder' ).'</label>
10 <input class="text-input" name="email" type="text" id="username_email" value="" '. apply_filters( 'wppb_resend_activation_extra_attr', '', __( 'Email', 'profile-builder' ), 'text' ) .'/>
11 <div style="padding-top: 20px;">
12 <input name="resend_activation" type="submit" id="wppbc-resend-activation-button" class="submit button" value="'. $button_name . '" />
13 <input name="action" type="hidden" id="action" value="wppbc_resend_activation" />
14 <input type="hidden" name="wppb_nonce" value="'. esc_attr( wp_create_nonce( 'wppbc_resend_activation' ) ) . '" />
15 </div>
16 </li>
17 </form>';
18
19 // return $output;
20 return apply_filters('wppb_resend_activation_form_before_content_output', $output);
21 }
22
23 add_action( 'init', 'wppb_toolbox_resend_activation_url', 999 );
24 function wppb_toolbox_resend_activation_url() {
25 if( isset($_REQUEST['action']) && $_REQUEST['action'] === 'wppbc_resend_activation' && isset($_REQUEST['email'] ) && isset( $_REQUEST['wppb_nonce'] ) && wp_verify_nonce( sanitize_text_field( $_REQUEST['wppb_nonce'] ), 'wppbc_resend_activation' )) {
26 global $wpdb;
27 $sql_result = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM " . $wpdb->base_prefix . "signups WHERE user_email = %s", sanitize_email( $_REQUEST['email'] ) ), ARRAY_A );
28
29 if ( $sql_result ){
30 wppb_signup_user_notification( trim( $sql_result['user_login'] ), trim( $sql_result['user_email'] ), $sql_result['activation_key'], $sql_result['meta'] );
31 echo '<script> alert("Activation email sent!");</script>';
32 }
33 else {
34 echo '<script> alert("No sign-up was made with that email!");</script>';
35 }
36 }
37 }
38