PluginProbe
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor / 4.0.3
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor v4.0.3
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 / fields / capitalize-first-last.php

capitalize-first-last.php in User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor 4.0.3, at admin/advanced-settings/includes/fields/capitalize-first-last.php

22 lines 790 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // Exit if accessed directly
4 if ( ! defined( 'ABSPATH' ) ) exit;
5
6 $wppb_general_settings = get_option( 'wppb_general_settings' );
7
8 if ( !empty( $wppb_general_settings ) && isset( $wppb_general_settings['emailConfirmation'] ) && $wppb_general_settings['emailConfirmation'] == 'yes' )
9 add_filter('wppb_add_to_user_signup_form_meta', 'wppb_toolbox_capitalize_first_last', 20, 2);
10 else
11 add_filter('wppb_build_userdata', 'wppb_toolbox_capitalize_first_last', 20, 2);
12
13 function wppb_toolbox_capitalize_first_last( $meta, $global_request ) {
14 if ( isset( $global_request['first_name'] ) )
15 $meta['first_name'] = ucwords( $global_request['first_name'] );
16
17 if ( isset($global_request['last_name']) )
18 $meta['last_name'] = ucwords( $global_request['last_name'] );
19
20 return $meta;
21 }
22