User registration & user profile – Profile Builder - Version 2.7.1

Version Description

  • Fixed an issue with the Biographical Info field that was showing html tags
  • Fixed Content Restriction preview post before more-tag issue
  • Fixed Roles Editor conflict with Dokan plugin
  • Fixed redirect_priority='top' not working after login
  • Fixed back-end login with after login redirect set to http_referer
Download this release

Release Info

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

Code changes from version 2.7.0 to 2.7.1

features/content-restriction/content-restriction-filtering.php CHANGED
@@ -182,7 +182,10 @@ function wppb_content_restriction_add_post_preview( $message, $content, $post, $
182
  // More tag
183
  if( $preview_option == 'more-tag' ) {
184
  $content_parts = get_extended( $post->post_content );
185
- $preview = $content_parts['main'];
 
 
 
186
  }
187
 
188
  // Return the preview
182
  // More tag
183
  if( $preview_option == 'more-tag' ) {
184
  $content_parts = get_extended( $post->post_content );
185
+
186
+ if( ! empty( $content_parts['extended'] ) ) {
187
+ $preview = $content_parts['main'];
188
+ }
189
  }
190
 
191
  // Return the preview
features/functions.php CHANGED
@@ -1023,4 +1023,23 @@ function wppb_build_redirect( $redirect_url, $redirect_delay, $redirect_type = N
1023
  */
1024
  function wppb_sanitize_value( $string ){
1025
  return preg_replace( '/<script\b[^>]*>(.*?)<\/script>/is', '', $string );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1026
  }
1023
  */
1024
  function wppb_sanitize_value( $string ){
1025
  return preg_replace( '/<script\b[^>]*>(.*?)<\/script>/is', '', $string );
1026
+ }
1027
+
1028
+ /**
1029
+ * Function that receives a user role and returns it's label.
1030
+ * Returns the original role if not found.
1031
+ *
1032
+ * @since v.2.7.1
1033
+ *
1034
+ * @param string $role
1035
+ *
1036
+ * @return string
1037
+ */
1038
+ function wppb_get_role_name($role){
1039
+ global $wp_roles;
1040
+
1041
+ if ( array_key_exists( $role, $wp_roles->role_names ) )
1042
+ return $wp_roles->role_names[$role];
1043
+
1044
+ return '';
1045
  }
features/roles-editor/roles-editor.php CHANGED
@@ -837,9 +837,9 @@ class WPPB_Roles_Editor {
837
 
838
  }
839
 
840
- function remove_filter_by_month_dropdown( $months, $post_type ) {
841
 
842
- if( $post_type == 'wppb-roles-editor' ) {
843
  return __return_empty_array();
844
  } else {
845
  return $months;
837
 
838
  }
839
 
840
+ function remove_filter_by_month_dropdown( $months, $post_type = NULL ) {
841
 
842
+ if( isset( $post_type ) && $post_type == 'wppb-roles-editor' ) {
843
  return __return_empty_array();
844
  } else {
845
  return $months;
front-end/default-fields/description/description.php CHANGED
@@ -4,8 +4,10 @@ function wppb_description_handler( $output, $form_location, $field, $user_id, $f
4
  $item_title = apply_filters( 'wppb_'.$form_location.'_description_item_title', wppb_icl_t( 'plugin profile-builder-pro', 'default_field_'.$field['id'].'_title_translation', $field['field-title'] ) );
5
  $item_description = wppb_icl_t( 'plugin profile-builder-pro', 'default_field_'.$field['id'].'_description_translation', $field['description'] );
6
  $input_value = '';
7
- if( $form_location == 'edit_profile' )
8
- $input_value = get_the_author_meta( 'description', $user_id );
 
 
9
 
10
  if ( trim( $input_value ) == '' )
11
  $input_value = $field['default-value'];
4
  $item_title = apply_filters( 'wppb_'.$form_location.'_description_item_title', wppb_icl_t( 'plugin profile-builder-pro', 'default_field_'.$field['id'].'_title_translation', $field['field-title'] ) );
5
  $item_description = wppb_icl_t( 'plugin profile-builder-pro', 'default_field_'.$field['id'].'_description_translation', $field['description'] );
6
  $input_value = '';
7
+ if( $form_location == 'edit_profile' ) {
8
+ $profileuser = get_userdata( $user_id );
9
+ $input_value = $profileuser->description;
10
+ }
11
 
12
  if ( trim( $input_value ) == '' )
13
  $input_value = $field['default-value'];
front-end/login.php CHANGED
@@ -115,7 +115,7 @@ if( isset( $wppb_generalSettings['loginWith'] ) && ( $wppb_generalSettings['logi
115
  // login redirect filter. used to redirect from wp-login.php if it errors out
116
  function wppb_login_redirect( $redirect_to, $requested_redirect_to, $user ){
117
  // custom redirect after login on default wp login form
118
- if( ! is_wp_error( $user ) ) {
119
  // we don't have an error make sure to remove the error from the query arg
120
  $redirect_to = remove_query_arg( 'loginerror', $redirect_to );
121
 
115
  // login redirect filter. used to redirect from wp-login.php if it errors out
116
  function wppb_login_redirect( $redirect_to, $requested_redirect_to, $user ){
117
  // custom redirect after login on default wp login form
118
+ if( ! isset( $_POST['wppb_login'] ) && ! is_wp_error( $user ) ) {
119
  // we don't have an error make sure to remove the error from the query arg
120
  $redirect_to = remove_query_arg( 'loginerror', $redirect_to );
121
 
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.7.0
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.7.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'))));
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.7.1
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.7.1' );
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,7 +4,7 @@ Donate link: http://www.cozmoslabs.com/wordpress-profile-builder/
4
  Tags: user registration, user profile, 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, content restriction, restrict content
5
  Requires at least: 3.1
6
  Tested up to: 4.9.0
7
- Stable tag: 2.7.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -163,6 +163,13 @@ This plugin adds/removes user fields in the front-end. Both default and extra pr
163
  12. Role Editor
164
 
165
  == Changelog ==
 
 
 
 
 
 
 
166
  = 2.7.0 =
167
  * Added [wppb-restrict] shortcode for Content Restriction
168
  * Password Strength Indicator improvements
4
  Tags: user registration, user profile, 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, content restriction, restrict content
5
  Requires at least: 3.1
6
  Tested up to: 4.9.0
7
+ Stable tag: 2.7.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
163
  12. Role Editor
164
 
165
  == Changelog ==
166
+ = 2.7.1 =
167
+ * Fixed an issue with the Biographical Info field that was showing html tags
168
+ * Fixed Content Restriction preview post before more-tag issue
169
+ * Fixed Roles Editor conflict with Dokan plugin
170
+ * Fixed redirect_priority='top' not working after login
171
+ * Fixed back-end login with after login redirect set to http_referer
172
+
173
  = 2.7.0 =
174
  * Added [wppb-restrict] shortcode for Content Restriction
175
  * Password Strength Indicator improvements