User registration & user profile – Profile Builder - Version 2.4.0

Version Description

  • Now we check checkboxes default value to not be empty in the front end forms
  • Display name with email confirmation now is set to First name Last name or Nickname if they exist
  • UI adjustment for checkbox in email confirmation table in the admin area
Download this release

Release Info

Developer madalin.ungureanu
Plugin Icon 128x128 User registration & user profile – Profile Builder
Version 2.4.0
Comparing to
See all releases

Code changes from version 2.3.9 to 2.4.0

admin/manage-fields.php CHANGED
@@ -1024,7 +1024,7 @@ function wppb_check_field_on_edit_add( $message, $fields, $required_fields, $met
1024
  $unique_meta_name_list = array( 'first_name', 'last_name', 'nickname', 'description' );
1025
 
1026
  //check to see if meta-name is empty
1027
- $skip_empty_check_for_fields = array('Heading', 'Select (User Role)', 'reCAPTCHA');
1028
 
1029
  if( !in_array( $posted_values['field'], $skip_empty_check_for_fields ) && empty( $posted_values['meta-name'] ) ) {
1030
  $message .= __( "The meta-name cannot be empty\n", 'profile-builder' );
1024
  $unique_meta_name_list = array( 'first_name', 'last_name', 'nickname', 'description' );
1025
 
1026
  //check to see if meta-name is empty
1027
+ $skip_empty_check_for_fields = array( 'Heading', 'Select (User Role)', 'reCAPTCHA', 'HTML' );
1028
 
1029
  if( !in_array( $posted_values['field'], $skip_empty_check_for_fields ) && empty( $posted_values['meta-name'] ) ) {
1030
  $message .= __( "The meta-name cannot be empty\n", 'profile-builder' );
assets/css/style-front-end.css CHANGED
@@ -144,6 +144,14 @@
144
  padding-bottom:14px;
145
  }
146
 
 
 
 
 
 
 
 
 
147
  .wppb-user-forms .wppb-form-field > ul {
148
  margin-left: 0;
149
  }
@@ -199,6 +207,11 @@ input#send_credentials_via_email{
199
  font-style:italic;
200
  }
201
 
 
 
 
 
 
202
  .wppb-form-field.wppb-timepicker > span.wppb-timepicker-separator {
203
  display: inline-block;
204
  float: left;
144
  padding-bottom:14px;
145
  }
146
 
147
+ .wppb-user-forms .wppb-input-hidden {
148
+ padding-bottom: 0;
149
+ }
150
+
151
+ .wppb-user-forms.wppb-user-role-administrator .wppb-input-hidden {
152
+ padding-bottom: 14px;
153
+ }
154
+
155
  .wppb-user-forms .wppb-form-field > ul {
156
  margin-left: 0;
157
  }
207
  font-style:italic;
208
  }
209
 
210
+ .wppb-form-field > span.custom_field_html {
211
+ font-style: normal;
212
+ font-size: 100%;
213
+ }
214
+
215
  .wppb-form-field.wppb-timepicker > span.wppb-timepicker-separator {
216
  display: inline-block;
217
  float: left;
assets/js/jquery-manage-fields-live-change.js CHANGED
@@ -431,6 +431,7 @@ var fields = {
431
 
432
  'Map': { 'show_rows' : [
433
  '.row-field-title',
 
434
  '.row-description',
435
  '.row-map-api-key',
436
  '.row-map-default-lat',
@@ -444,9 +445,11 @@ var fields = {
444
  '.row-field-title',
445
  '.row-description',
446
  '.row-html-content'
447
- ]
 
 
 
448
  }
449
-
450
  }
451
  var fields_to_show = [
452
  '.row-field-title',
431
 
432
  'Map': { 'show_rows' : [
433
  '.row-field-title',
434
+ '.row-meta-name',
435
  '.row-description',
436
  '.row-map-api-key',
437
  '.row-map-default-lat',
445
  '.row-field-title',
446
  '.row-description',
447
  '.row-html-content'
448
+ ],
449
+ 'properties': {
450
+ 'meta_name_value' : ''
451
+ }
452
  }
 
453
  }
454
  var fields_to_show = [
455
  '.row-field-title',
features/class-list-table.php CHANGED
@@ -722,13 +722,14 @@ class PB_WP_List_Table {
722
  if ( in_array( $column_key, $hidden ) )
723
  $style = 'display:none;';
724
 
725
- $style = ' style="' . $style . '"';
726
-
727
- if ( 'cb' == $column_key )
728
  $class[] = 'check-column';
729
- elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ) ) )
 
730
  $class[] = 'num';
731
 
 
 
732
  if ( isset( $sortable[$column_key] ) ) {
733
  list( $orderby, $desc_first ) = $sortable[$column_key];
734
 
722
  if ( in_array( $column_key, $hidden ) )
723
  $style = 'display:none;';
724
 
725
+ if ( 'cb' == $column_key ) {
 
 
726
  $class[] = 'check-column';
727
+ $style .= ' padding: 10px 0 10px 3px;';
728
+ } elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ) ) )
729
  $class[] = 'num';
730
 
731
+ $style = ' style="' . $style . '"';
732
+
733
  if ( isset( $sortable[$column_key] ) ) {
734
  list( $orderby, $desc_first ) = $sortable[$column_key];
735
 
features/email-confirmation/email-confirmation.php CHANGED
@@ -166,6 +166,12 @@ function wppb_add_meta_to_user_on_activation( $user_id, $password, $meta ){
166
 
167
  if( !empty( $meta['role'] ) )
168
  $user->set_role( $meta['role'] ); //update the users role (s)he registered for
 
 
 
 
 
 
169
 
170
  //copy the data from the meta fields (custom fields)
171
  $manage_fields = get_option( 'wppb_manage_fields', 'not_set' );
166
 
167
  if( !empty( $meta['role'] ) )
168
  $user->set_role( $meta['role'] ); //update the users role (s)he registered for
169
+
170
+ if( !empty( $meta['first_name'] ) && !empty( $meta['last_name'] ) )
171
+ wp_update_user(array('ID' => $user_id, 'display_name' => $meta['first_name'].' '.$meta['last_name'] ));
172
+ else if( !empty( $meta['nickname'] ) )
173
+ wp_update_user(array('ID' => $user_id, 'display_name' => $meta['nickname'] ));
174
+
175
 
176
  //copy the data from the meta fields (custom fields)
177
  $manage_fields = get_option( 'wppb_manage_fields', 'not_set' );
front-end/class-formbuilder.php CHANGED
@@ -343,8 +343,23 @@ class Profile_Builder_Form_Creator{
343
 
344
  // use this action hook to add extra content before the register form
345
  do_action( 'wppb_before_'.$this->args['form_type'].'_fields', $this->args['form_name'], $this->args['ID'], $this->args['form_type'] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
346
  ?>
347
- <form enctype="multipart/form-data" method="post" id="<?php if( $this->args['form_type'] == 'register' ) echo 'wppb-register-user'; else if( $this->args['form_type'] == 'edit_profile' ) echo 'wppb-edit-user'; if( isset($this->args['form_name']) && $this->args['form_name'] != "unspecified" ) echo '-' . $this->args['form_name']; ?>" class="wppb-user-forms<?php if( $this->args['form_type'] == 'register' ) echo ' wppb-register-user'; else if( $this->args['form_type'] == 'edit_profile' ) echo ' wppb-edit-user';?>" action="<?php echo apply_filters( 'wppb_form_action', '' ); ?>">
348
  <?php
349
  do_action( 'wppb_form_args_before_output', $this->args );
350
  echo apply_filters( 'wppb_before_form_fields', '<ul>', $this->args['form_type'] );
343
 
344
  // use this action hook to add extra content before the register form
345
  do_action( 'wppb_before_'.$this->args['form_type'].'_fields', $this->args['form_name'], $this->args['ID'], $this->args['form_type'] );
346
+
347
+ $wppb_user_role_class = '';
348
+ if( is_user_logged_in() ) {
349
+ $wppb_user = wp_get_current_user();
350
+
351
+ if( $wppb_user && isset( $wppb_user->roles ) ) {
352
+ foreach( $wppb_user->roles as $wppb_user_role ) {
353
+ $wppb_user_role_class .= ' wppb-user-role-'. $wppb_user_role;
354
+ }
355
+ }
356
+ } else {
357
+ $wppb_user_role_class = ' wppb-user-logged-out';
358
+ }
359
+ $wppb_user_role_class = apply_filters( 'wppb_user_role_form_class', $wppb_user_role_class );
360
+
361
  ?>
362
+ <form enctype="multipart/form-data" method="post" id="<?php if( $this->args['form_type'] == 'register' ) echo 'wppb-register-user'; else if( $this->args['form_type'] == 'edit_profile' ) echo 'wppb-edit-user'; if( isset($this->args['form_name']) && $this->args['form_name'] != "unspecified" ) echo '-' . $this->args['form_name']; ?>" class="wppb-user-forms<?php if( $this->args['form_type'] == 'register' ) echo ' wppb-register-user'; else if( $this->args['form_type'] == 'edit_profile' ) echo ' wppb-edit-user'; echo $wppb_user_role_class; ?>" action="<?php echo apply_filters( 'wppb_form_action', '' ); ?>">
363
  <?php
364
  do_action( 'wppb_form_args_before_output', $this->args );
365
  echo apply_filters( 'wppb_before_form_fields', '<ul>', $this->args['form_type'] );
index.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Profile Builder
4
  Plugin URI: https://www.cozmoslabs.com/wordpress-profile-builder/
5
  Description: Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed or add new (custom) ones both in the front-end and in the dashboard.
6
- Version: 2.3.9
7
  Author: Cozmoslabs, Madalin Ungureanu, Antohe Cristian, Barina Gabriel, Mihai Iova
8
  Author URI: https://www.cozmoslabs.com/
9
  License: GPL2
@@ -73,7 +73,7 @@ function wppb_free_plugin_init() {
73
  *
74
  *
75
  */
76
- define('PROFILE_BUILDER_VERSION', '2.3.9' );
77
  define('WPPB_PLUGIN_DIR', plugin_dir_path(__FILE__));
78
  define('WPPB_PLUGIN_URL', plugin_dir_url(__FILE__));
79
  define('WPPB_SERVER_MAX_UPLOAD_SIZE_BYTE', apply_filters('wppb_server_max_upload_size_byte_constant', wppb_return_bytes(ini_get('upload_max_filesize'))));
3
  Plugin Name: Profile Builder
4
  Plugin URI: https://www.cozmoslabs.com/wordpress-profile-builder/
5
  Description: Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed or add new (custom) ones both in the front-end and in the dashboard.
6
+ Version: 2.4.0
7
  Author: Cozmoslabs, Madalin Ungureanu, Antohe Cristian, Barina Gabriel, Mihai Iova
8
  Author URI: https://www.cozmoslabs.com/
9
  License: GPL2
73
  *
74
  *
75
  */
76
+ define('PROFILE_BUILDER_VERSION', '2.4.0' );
77
  define('WPPB_PLUGIN_DIR', plugin_dir_path(__FILE__));
78
  define('WPPB_PLUGIN_URL', plugin_dir_url(__FILE__));
79
  define('WPPB_SERVER_MAX_UPLOAD_SIZE_BYTE', apply_filters('wppb_server_max_upload_size_byte_constant', wppb_return_bytes(ini_get('upload_max_filesize'))));
readme.txt CHANGED
@@ -4,8 +4,8 @@ Donate link: http://www.cozmoslabs.com/wordpress-profile-builder/
4
  Tags: user registration, user registration form, user fields, extra user fields, edit profile, user custom fields, front-end login, front-end edit profile, front-end user registration, email confirmation, login form
5
 
6
  Requires at least: 3.1
7
- Tested up to: 4.5.2
8
- Stable tag: 2.3.9
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -147,6 +147,11 @@ This plugin adds/removes user fields in the front-end. Both default and extra pr
147
  10. Profile Builder Login Widget
148
 
149
  == Changelog ==
 
 
 
 
 
150
  = 2.3.9 =
151
  * Security update
152
 
4
  Tags: user registration, user registration form, user fields, extra user fields, edit profile, user custom fields, front-end login, front-end edit profile, front-end user registration, email confirmation, login form
5
 
6
  Requires at least: 3.1
7
+ Tested up to: 4.5.3
8
+ Stable tag: 2.4.0
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
147
  10. Profile Builder Login Widget
148
 
149
  == Changelog ==
150
+ = 2.4.0 =
151
+ * Now we check checkboxes default value to not be empty in the front end forms
152
+ * Display name with email confirmation now is set to First name Last name or Nickname if they exist
153
+ * UI adjustment for checkbox in email confirmation table in the admin area
154
+
155
  = 2.3.9 =
156
  * Security update
157