Version Description
- Now when an administrator registers an user the Register button text has changed to Add User
- Multiple fixes regarding redirects
- Fixed issues with redirect_url shortcode parameter and changed the logout shortcode parameter to redirect_url from redirect
- Added the filter 'wppb_edit_other_users_dropdown_query_args' for changing the user query on the edit other users dropwdown
Download this release
Release Info
| Developer | madalin.ungureanu |
| Plugin | |
| Version | 2.4.8 |
| Comparing to | |
| See all releases | |
Code changes from version 2.4.7 to 2.4.8
- admin/manage-fields.php +6 -1
- assets/js/jquery-epf-rf.js +11 -1
- assets/js/jquery-manage-fields-live-change.js +10 -0
- features/email-confirmation/email-confirmation.php +33 -49
- front-end/class-formbuilder.php +22 -17
- front-end/logout.php +4 -1
- index.php +2 -2
- readme.txt +7 -1
admin/manage-fields.php
CHANGED
|
@@ -57,6 +57,7 @@ function wppb_manage_fields_submenu(){
|
|
| 57 |
$manage_field_types[] = 'Select (Timezone)';
|
| 58 |
$manage_field_types[] = 'Select (User Role)';
|
| 59 |
$manage_field_types[] = 'Select (Currency)';
|
|
|
|
| 60 |
$manage_field_types[] = 'Checkbox';
|
| 61 |
$manage_field_types[] = 'Checkbox (Terms and Conditions)';
|
| 62 |
$manage_field_types[] = 'Radio';
|
|
@@ -103,6 +104,9 @@ function wppb_manage_fields_submenu(){
|
|
| 103 |
$default_currency_options[] = $currency_name;
|
| 104 |
}
|
| 105 |
|
|
|
|
|
|
|
|
|
|
| 106 |
// set up the fields array
|
| 107 |
$fields = apply_filters( 'wppb_manage_fields', array(
|
| 108 |
|
|
@@ -132,6 +136,7 @@ function wppb_manage_fields_submenu(){
|
|
| 132 |
array( 'type' => 'select', 'slug' => 'default-option-timezone', 'title' => __( 'Default Option', 'profile-builder' ), 'options' => wppb_timezone_select_options( 'back_end' ), 'description' => __( "Default option of the field", 'profile-builder' ) ),
|
| 133 |
array( 'type' => 'select', 'slug' => 'default-option-currency', 'title' => __( 'Default Option', 'profile-builder' ), 'values' => ( isset( $default_currency_values ) ) ? $default_currency_values : '', 'options' => ( isset( $default_currency_options ) ) ? $default_currency_options : '', 'description' => __( "Default option of the field", 'profile-builder' ) ),
|
| 134 |
array( 'type' => 'select', 'slug' => 'show-currency-symbol', 'title' => __( 'Show Currency Symbol', 'profile-builder' ), 'options' => array( 'No', 'Yes' ), 'default' => 'No', 'description' => __( 'Whether the currency symbol should be displayed after the currency name in the select option.', 'profile-builder' ) ),
|
|
|
|
| 135 |
array( 'type' => 'text', 'slug' => 'validation-possible-values', 'title' => __( 'Allowable Values', 'profile-builder' ), 'description' => __( "Enter a comma separated list of possible values. Upon registration if the value provided by the user does not match one of these values, the user will not be registered.", 'profile-builder' ) ),
|
| 136 |
array( 'type' => 'text', 'slug' => 'custom-error-message', 'title' => __( 'Error Message', 'profile-builder' ), 'description' => __( "Set a custom error message that will be displayed to the user.", 'profile-builder' ) ),
|
| 137 |
array( 'type' => 'select', 'slug' => 'time-format', 'title' => __( 'Time Format', 'profile-builder' ), 'options' => array( '%12 Hours%12', '%24 Hours%24' ), 'description' => __( 'Specify the time format.', 'profile-builder' ) ),
|
|
@@ -1120,7 +1125,7 @@ function wppb_check_field_on_edit_add( $message, $fields, $required_fields, $met
|
|
| 1120 |
$fields_so_far = get_post_meta ( $post_id, $meta_name, true );
|
| 1121 |
|
| 1122 |
foreach ( $fields_so_far as $key => $value ){
|
| 1123 |
-
if ( $value['
|
| 1124 |
$message .= __( "That field is already added in this form\n", 'profile-builder' );
|
| 1125 |
}
|
| 1126 |
}
|
| 57 |
$manage_field_types[] = 'Select (Timezone)';
|
| 58 |
$manage_field_types[] = 'Select (User Role)';
|
| 59 |
$manage_field_types[] = 'Select (Currency)';
|
| 60 |
+
$manage_field_types[] = 'Select (CPT)';
|
| 61 |
$manage_field_types[] = 'Checkbox';
|
| 62 |
$manage_field_types[] = 'Checkbox (Terms and Conditions)';
|
| 63 |
$manage_field_types[] = 'Radio';
|
| 104 |
$default_currency_options[] = $currency_name;
|
| 105 |
}
|
| 106 |
|
| 107 |
+
//cpt select
|
| 108 |
+
$post_types = get_post_types( array( 'public' => true ), 'names' );
|
| 109 |
+
|
| 110 |
// set up the fields array
|
| 111 |
$fields = apply_filters( 'wppb_manage_fields', array(
|
| 112 |
|
| 136 |
array( 'type' => 'select', 'slug' => 'default-option-timezone', 'title' => __( 'Default Option', 'profile-builder' ), 'options' => wppb_timezone_select_options( 'back_end' ), 'description' => __( "Default option of the field", 'profile-builder' ) ),
|
| 137 |
array( 'type' => 'select', 'slug' => 'default-option-currency', 'title' => __( 'Default Option', 'profile-builder' ), 'values' => ( isset( $default_currency_values ) ) ? $default_currency_values : '', 'options' => ( isset( $default_currency_options ) ) ? $default_currency_options : '', 'description' => __( "Default option of the field", 'profile-builder' ) ),
|
| 138 |
array( 'type' => 'select', 'slug' => 'show-currency-symbol', 'title' => __( 'Show Currency Symbol', 'profile-builder' ), 'options' => array( 'No', 'Yes' ), 'default' => 'No', 'description' => __( 'Whether the currency symbol should be displayed after the currency name in the select option.', 'profile-builder' ) ),
|
| 139 |
+
array( 'type' => 'select', 'slug' => 'cpt', 'title' => __( 'Show Post Type', 'profile-builder' ), 'options' => $post_types, 'default' => 'post', 'description' => __( 'Posts from what post type will be displayed in the select.', 'profile-builder' ) ),
|
| 140 |
array( 'type' => 'text', 'slug' => 'validation-possible-values', 'title' => __( 'Allowable Values', 'profile-builder' ), 'description' => __( "Enter a comma separated list of possible values. Upon registration if the value provided by the user does not match one of these values, the user will not be registered.", 'profile-builder' ) ),
|
| 141 |
array( 'type' => 'text', 'slug' => 'custom-error-message', 'title' => __( 'Error Message', 'profile-builder' ), 'description' => __( "Set a custom error message that will be displayed to the user.", 'profile-builder' ) ),
|
| 142 |
array( 'type' => 'select', 'slug' => 'time-format', 'title' => __( 'Time Format', 'profile-builder' ), 'options' => array( '%12 Hours%12', '%24 Hours%24' ), 'description' => __( 'Specify the time format.', 'profile-builder' ) ),
|
| 1125 |
$fields_so_far = get_post_meta ( $post_id, $meta_name, true );
|
| 1126 |
|
| 1127 |
foreach ( $fields_so_far as $key => $value ){
|
| 1128 |
+
if ( $value['id'] == $posted_values['id'] )
|
| 1129 |
$message .= __( "That field is already added in this form\n", 'profile-builder' );
|
| 1130 |
}
|
| 1131 |
}
|
assets/js/jquery-epf-rf.js
CHANGED
|
@@ -9,7 +9,17 @@ function wppb_rf_epf_change_id( field, container_name, fieldObj ) {
|
|
| 9 |
buttonInContainer.removeAttr('onclick');
|
| 10 |
|
| 11 |
jQuery.post( ajaxurl , { action:"wppb_handle_rf_epf_id_change", field:field }, function(response) {
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
buttonInContainer.attr('onclick', buttonInContainer.attr("tempclick") );
|
| 14 |
buttonInContainer.removeAttr('tempclick');
|
| 15 |
|
| 9 |
buttonInContainer.removeAttr('onclick');
|
| 10 |
|
| 11 |
jQuery.post( ajaxurl , { action:"wppb_handle_rf_epf_id_change", field:field }, function(response) {
|
| 12 |
+
|
| 13 |
+
/**
|
| 14 |
+
* since version 2.0.2 we have the id directly on the option in the select so this ajax function is a little
|
| 15 |
+
redundant but can't be sure of the impact on other features so we will just add this
|
| 16 |
+
*/
|
| 17 |
+
id = fieldObj.find(":selected").attr( 'data-id' );
|
| 18 |
+
if( !id ){
|
| 19 |
+
id = response;
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
jQuery( '#id', fieldObj.parent().parent().parent() ).val( id );
|
| 23 |
buttonInContainer.attr('onclick', buttonInContainer.attr("tempclick") );
|
| 24 |
buttonInContainer.removeAttr('tempclick');
|
| 25 |
|
assets/js/jquery-manage-fields-live-change.js
CHANGED
|
@@ -312,6 +312,16 @@ var fields = {
|
|
| 312 |
'.row-overwrite-existing'
|
| 313 |
]
|
| 314 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 315 |
|
| 316 |
'Checkbox': { 'show_rows' : [
|
| 317 |
'.row-field-title',
|
| 312 |
'.row-overwrite-existing'
|
| 313 |
]
|
| 314 |
},
|
| 315 |
+
'Select (CPT)': { 'show_rows' : [
|
| 316 |
+
'.row-field-title',
|
| 317 |
+
'.row-meta-name',
|
| 318 |
+
'.row-description',
|
| 319 |
+
'.row-default-option',
|
| 320 |
+
'.row-cpt',
|
| 321 |
+
'.row-required',
|
| 322 |
+
'.row-overwrite-existing'
|
| 323 |
+
]
|
| 324 |
+
},
|
| 325 |
|
| 326 |
'Checkbox': { 'show_rows' : [
|
| 327 |
'.row-field-title',
|
features/email-confirmation/email-confirmation.php
CHANGED
|
@@ -178,59 +178,39 @@ function wppb_add_meta_to_user_on_activation( $user_id, $password, $meta ){
|
|
| 178 |
if ( $manage_fields != 'not_set' ){
|
| 179 |
foreach ( $manage_fields as $key => $value){
|
| 180 |
switch ( $value['field'] ) {
|
| 181 |
-
case 'Input':
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
case '
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
case '
|
| 192 |
-
if ( isset( $meta[$value['meta-name']] ) )
|
| 193 |
-
update_user_meta( $user_id, $value['meta-name'], trim( $meta[$value['meta-name']] ) );
|
| 194 |
-
break;
|
| 195 |
-
}
|
| 196 |
-
case 'Checkbox (Terms and Conditions)':{
|
| 197 |
-
if ( isset( $meta[$value['meta-name']] ) )
|
| 198 |
-
update_user_meta( $user_id, $value['meta-name'], trim( $meta[$value['meta-name']] ) );
|
| 199 |
-
break;
|
| 200 |
-
}
|
| 201 |
-
case 'Radio':{
|
| 202 |
-
if ( isset( $meta[$value['meta-name']] ) )
|
| 203 |
-
update_user_meta( $user_id, $value['meta-name'], trim( $meta[$value['meta-name']] ) );
|
| 204 |
-
break;
|
| 205 |
-
}
|
| 206 |
-
case 'Select':{
|
| 207 |
-
if ( isset( $meta[$value['meta-name']] ) )
|
| 208 |
-
update_user_meta( $user_id, $value['meta-name'], trim( $meta[$value['meta-name']] ) );
|
| 209 |
-
break;
|
| 210 |
-
}
|
| 211 |
-
case 'Select (Country)':{
|
| 212 |
-
if ( isset( $meta[$value['meta-name']] ) )
|
| 213 |
-
update_user_meta( $user_id, $value['meta-name'], trim( $meta[$value['meta-name']] ) );
|
| 214 |
-
break;
|
| 215 |
-
}
|
| 216 |
-
case 'Select (Multiple)':{
|
| 217 |
-
if ( isset( $meta[$value['meta-name']] ) )
|
| 218 |
-
update_user_meta( $user_id, $value['meta-name'], trim( $meta[$value['meta-name']] ) );
|
| 219 |
-
break;
|
| 220 |
-
}
|
| 221 |
-
case 'Select (Timezone)':{
|
| 222 |
if ( isset( $meta[$value['meta-name']] ) )
|
| 223 |
update_user_meta( $user_id, $value['meta-name'], trim( $meta[$value['meta-name']] ) );
|
| 224 |
break;
|
| 225 |
}
|
| 226 |
-
case '
|
| 227 |
-
if ( isset( $meta[$value['meta-name']] ) )
|
| 228 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 229 |
break;
|
| 230 |
}
|
| 231 |
-
case '
|
| 232 |
-
if ( isset( $meta[$value['meta-name']] ) )
|
| 233 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 234 |
break;
|
| 235 |
}
|
| 236 |
case 'Upload':{
|
|
@@ -310,8 +290,12 @@ function wppb_add_meta_to_user_on_activation( $user_id, $password, $meta ){
|
|
| 310 |
break;
|
| 311 |
}
|
| 312 |
}
|
| 313 |
-
default:
|
| 314 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 315 |
}
|
| 316 |
}
|
| 317 |
}
|
| 178 |
if ( $manage_fields != 'not_set' ){
|
| 179 |
foreach ( $manage_fields as $key => $value){
|
| 180 |
switch ( $value['field'] ) {
|
| 181 |
+
case 'Input':
|
| 182 |
+
case 'Input (Hidden)':
|
| 183 |
+
case 'Checkbox':
|
| 184 |
+
case 'Checkbox (Terms and Conditions)':
|
| 185 |
+
case 'Radio':
|
| 186 |
+
case 'Select':
|
| 187 |
+
case 'Select (Country)':
|
| 188 |
+
case 'Select (Multiple)':
|
| 189 |
+
case 'Select (Timezone)':
|
| 190 |
+
case 'Datepicker':
|
| 191 |
+
case 'Textarea':{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 192 |
if ( isset( $meta[$value['meta-name']] ) )
|
| 193 |
update_user_meta( $user_id, $value['meta-name'], trim( $meta[$value['meta-name']] ) );
|
| 194 |
break;
|
| 195 |
}
|
| 196 |
+
case 'Timepicker':{
|
| 197 |
+
if ( isset( $meta[$value['meta-name']] ) ) {
|
| 198 |
+
$time = $meta[$value['meta-name']];
|
| 199 |
+
if( !empty( $time['hours'] ) && !empty( $time['minutes'] ) ) {
|
| 200 |
+
update_user_meta( $user_id, $value['meta-name'], $time['hours'] . ':' . $time['minutes'] );
|
| 201 |
+
}
|
| 202 |
+
|
| 203 |
+
}
|
| 204 |
break;
|
| 205 |
}
|
| 206 |
+
case 'Map':{
|
| 207 |
+
if ( isset( $meta[$value['meta-name']] ) ) {
|
| 208 |
+
// Add new markers
|
| 209 |
+
if( is_array( $meta[$value['meta-name']] ) ) {
|
| 210 |
+
foreach( $meta[$value['meta-name']] as $key => $position )
|
| 211 |
+
update_user_meta( $user_id, $value['meta-name'] . '_' . $key, $position );
|
| 212 |
+
}
|
| 213 |
+
}
|
| 214 |
break;
|
| 215 |
}
|
| 216 |
case 'Upload':{
|
| 290 |
break;
|
| 291 |
}
|
| 292 |
}
|
| 293 |
+
default: {
|
| 294 |
+
if ( isset( $meta[$value['meta-name']] ) ) {
|
| 295 |
+
update_user_meta($user_id, $value['meta-name'], $meta[$value['meta-name']]);
|
| 296 |
+
}
|
| 297 |
+
do_action('wppb_add_meta_on_user_activation_' . Wordpress_Creation_Kit_PB::wck_generate_slug($value['field']), $user_id, $password, $meta);
|
| 298 |
+
}
|
| 299 |
}
|
| 300 |
}
|
| 301 |
}
|
front-end/class-formbuilder.php
CHANGED
|
@@ -33,7 +33,7 @@ class Profile_Builder_Form_Creator{
|
|
| 33 |
|
| 34 |
if ( file_exists ( WPPB_PLUGIN_DIR.'/front-end/extra-fields/extra-fields.php' ) )
|
| 35 |
require_once( WPPB_PLUGIN_DIR.'/front-end/extra-fields/extra-fields.php' );
|
| 36 |
-
|
| 37 |
$this->wppb_retrieve_custom_settings();
|
| 38 |
|
| 39 |
add_action( 'wp_footer', array( &$this, 'wppb_print_script' ) ); //print scripts
|
|
@@ -104,7 +104,7 @@ class Profile_Builder_Form_Creator{
|
|
| 104 |
$this->args['role'] = ( isset( $selected_role ) ? $selected_role : $this->args['role'] );
|
| 105 |
$this->args['login_after_register'] = ( isset( $page_settings[0]['automatically-log-in'] ) ? $page_settings[0]['automatically-log-in'] : $this->args['login_after_register'] );
|
| 106 |
$this->args['redirect_activated'] = ( isset( $page_settings[0]['redirect'] ) ? $page_settings[0]['redirect'] : $this->args['redirect_activated'] );
|
| 107 |
-
$this->args['redirect_url'] = (
|
| 108 |
$this->args['redirect_delay'] = ( isset( $page_settings[0]['display-messages'] ) ? $page_settings[0]['display-messages'] : $this->args['redirect_delay'] );
|
| 109 |
|
| 110 |
if( $this->args['redirect_activated'] == '-' ) {
|
|
@@ -134,10 +134,19 @@ class Profile_Builder_Form_Creator{
|
|
| 134 |
$username = null;
|
| 135 |
|
| 136 |
if( isset( $wppb_module_settings['wppb_customRedirect'] ) && $wppb_module_settings['wppb_customRedirect'] == 'show' && $this->args['redirect_priority'] != 'top' && function_exists( 'wppb_custom_redirect_url' ) ) {
|
| 137 |
-
if( $this->args['form_type'] == 'register' )
|
| 138 |
-
$this->args['redirect_url'] =
|
| 139 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 140 |
$this->args['redirect_url'] = $this->args['custom_redirect_after_edit_profile_url'] = wppb_custom_redirect_url( 'after_edit_profile', $this->args['redirect_url'], $username, $this->args['role'] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
}
|
| 142 |
}
|
| 143 |
}
|
|
@@ -198,7 +207,7 @@ class Profile_Builder_Form_Creator{
|
|
| 198 |
|
| 199 |
}
|
| 200 |
}
|
| 201 |
-
|
| 202 |
function wppb_get_redirect(){
|
| 203 |
if ( $this->args['login_after_register'] == 'Yes' )
|
| 204 |
return $this->wppb_log_in_user();
|
|
@@ -209,19 +218,17 @@ class Profile_Builder_Form_Creator{
|
|
| 209 |
if ( $this->args['form_type'] == 'register' && $this->args['redirect_activated'] == '-' ){
|
| 210 |
if( !empty( $this->args['custom_redirect_after_register_url'] ) )
|
| 211 |
$this->args['redirect_url'] = $this->args['custom_redirect_after_register_url'];
|
| 212 |
-
else return '';
|
| 213 |
}
|
| 214 |
|
| 215 |
/* if we don't have a preference on the form for redirect then if we have a custom redirect "after edit profile redirect" option redirect to that if not don't do anything */
|
| 216 |
if ( $this->args['form_type'] == 'edit_profile' && $this->args['redirect_activated'] == '-' ){
|
| 217 |
if( !empty( $this->args['custom_redirect_after_edit_profile_url'] ) )
|
| 218 |
$this->args['redirect_url'] = $this->args['custom_redirect_after_edit_profile_url'];
|
| 219 |
-
else return '';
|
| 220 |
}
|
| 221 |
|
| 222 |
$redirect_location = ( wppb_check_missing_http( $this->args['redirect_url'] ) ? 'http://'.$this->args['redirect_url'] : $this->args['redirect_url'] );
|
| 223 |
$redirect_url = apply_filters( 'wppb_redirect_url', '<a href="'.$redirect_location.'">'.__( 'here', 'profile-builder' ).'</a>' );
|
| 224 |
-
|
| 225 |
return apply_filters ( 'wppb_redirect_message_before_returning', '<p class="redirect_message">'.sprintf( wp_slash( __( 'You will soon be redirected automatically. If you see this page for more than %1$d seconds, please click %2$s.%3$s', 'profile-builder' ) ), $this->args['redirect_delay'], $redirect_url, '<meta http-equiv="Refresh" content="'.$this->args['redirect_delay'].';url='.$redirect_location.'" />' ).'</p>', $this->args );
|
| 226 |
}
|
| 227 |
|
|
@@ -253,10 +260,8 @@ class Profile_Builder_Form_Creator{
|
|
| 253 |
$location = home_url();
|
| 254 |
}
|
| 255 |
}else if ( $this->args['redirect_activated'] == '-' ){
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
else
|
| 259 |
-
$location = home_url();
|
| 260 |
}
|
| 261 |
else{
|
| 262 |
$location = ( wppb_check_missing_http( $this->args['redirect_url'] ) ? 'http://'.$this->args['redirect_url'] : $this->args['redirect_url'] );
|
|
@@ -392,7 +397,7 @@ class Profile_Builder_Form_Creator{
|
|
| 392 |
<p class="form-submit">
|
| 393 |
<?php
|
| 394 |
if( $this->args['form_type'] == 'register' )
|
| 395 |
-
$button_name = ( current_user_can( '
|
| 396 |
|
| 397 |
elseif( $this->args['form_type'] == 'edit_profile' )
|
| 398 |
$button_name = __( 'Update', 'profile-builder' );
|
|
@@ -538,7 +543,7 @@ class Profile_Builder_Form_Creator{
|
|
| 538 |
}
|
| 539 |
|
| 540 |
function wppb_register_user( $global_request, $userdata ){
|
| 541 |
-
|
| 542 |
$wppb_general_settings = get_option( 'wppb_general_settings' );
|
| 543 |
$user_id = null;
|
| 544 |
$new_user_signup = false;
|
|
@@ -634,7 +639,7 @@ class Profile_Builder_Form_Creator{
|
|
| 634 |
return;
|
| 635 |
|
| 636 |
/* add a hard cap: if we have more than 5000 users don't display the dropdown for performance considerations */
|
| 637 |
-
|
| 638 |
if( $user_count['total_users'] > apply_filters( 'wppb_edit_other_users_count_limit', 5000 ) )
|
| 639 |
return;
|
| 640 |
|
|
@@ -645,7 +650,7 @@ class Profile_Builder_Form_Creator{
|
|
| 645 |
|
| 646 |
$query_args['fields'] = array( 'ID', 'user_login', 'display_name' );
|
| 647 |
$query_args['role'] = apply_filters( 'wppb_edit_profile_user_dropdown_role', '' );
|
| 648 |
-
$users = get_users( $query_args );
|
| 649 |
if( !empty( $users ) ) {
|
| 650 |
?>
|
| 651 |
<form method="GET" action="" id="select_user_to_edit_form">
|
| 33 |
|
| 34 |
if ( file_exists ( WPPB_PLUGIN_DIR.'/front-end/extra-fields/extra-fields.php' ) )
|
| 35 |
require_once( WPPB_PLUGIN_DIR.'/front-end/extra-fields/extra-fields.php' );
|
| 36 |
+
|
| 37 |
$this->wppb_retrieve_custom_settings();
|
| 38 |
|
| 39 |
add_action( 'wp_footer', array( &$this, 'wppb_print_script' ) ); //print scripts
|
| 104 |
$this->args['role'] = ( isset( $selected_role ) ? $selected_role : $this->args['role'] );
|
| 105 |
$this->args['login_after_register'] = ( isset( $page_settings[0]['automatically-log-in'] ) ? $page_settings[0]['automatically-log-in'] : $this->args['login_after_register'] );
|
| 106 |
$this->args['redirect_activated'] = ( isset( $page_settings[0]['redirect'] ) ? $page_settings[0]['redirect'] : $this->args['redirect_activated'] );
|
| 107 |
+
$this->args['redirect_url'] = ( !empty( $page_settings[0]['url'] ) && $this->args['redirect_activated'] == 'Yes' ? $page_settings[0]['url'] : $this->args['redirect_url'] );
|
| 108 |
$this->args['redirect_delay'] = ( isset( $page_settings[0]['display-messages'] ) ? $page_settings[0]['display-messages'] : $this->args['redirect_delay'] );
|
| 109 |
|
| 110 |
if( $this->args['redirect_activated'] == '-' ) {
|
| 134 |
$username = null;
|
| 135 |
|
| 136 |
if( isset( $wppb_module_settings['wppb_customRedirect'] ) && $wppb_module_settings['wppb_customRedirect'] == 'show' && $this->args['redirect_priority'] != 'top' && function_exists( 'wppb_custom_redirect_url' ) ) {
|
| 137 |
+
if( $this->args['form_type'] == 'register' ) {
|
| 138 |
+
$this->args['redirect_url'] = wppb_custom_redirect_url( 'after_registration', $this->args['redirect_url'], $username, $this->args['role'] );
|
| 139 |
+
|
| 140 |
+
if( $this->args['redirect_activated'] == 'Yes' ) {
|
| 141 |
+
$this->args['custom_redirect_after_register_url'] = $this->args['redirect_url'];
|
| 142 |
+
}
|
| 143 |
+
} else if( $this->args['form_type'] == 'edit_profile' ) {
|
| 144 |
$this->args['redirect_url'] = $this->args['custom_redirect_after_edit_profile_url'] = wppb_custom_redirect_url( 'after_edit_profile', $this->args['redirect_url'], $username, $this->args['role'] );
|
| 145 |
+
|
| 146 |
+
if( $this->args['redirect_activated'] == 'Yes' ) {
|
| 147 |
+
$this->args['custom_redirect_after_register_url'] = $this->args['redirect_url'];
|
| 148 |
+
}
|
| 149 |
+
}
|
| 150 |
}
|
| 151 |
}
|
| 152 |
}
|
| 207 |
|
| 208 |
}
|
| 209 |
}
|
| 210 |
+
|
| 211 |
function wppb_get_redirect(){
|
| 212 |
if ( $this->args['login_after_register'] == 'Yes' )
|
| 213 |
return $this->wppb_log_in_user();
|
| 218 |
if ( $this->args['form_type'] == 'register' && $this->args['redirect_activated'] == '-' ){
|
| 219 |
if( !empty( $this->args['custom_redirect_after_register_url'] ) )
|
| 220 |
$this->args['redirect_url'] = $this->args['custom_redirect_after_register_url'];
|
|
|
|
| 221 |
}
|
| 222 |
|
| 223 |
/* if we don't have a preference on the form for redirect then if we have a custom redirect "after edit profile redirect" option redirect to that if not don't do anything */
|
| 224 |
if ( $this->args['form_type'] == 'edit_profile' && $this->args['redirect_activated'] == '-' ){
|
| 225 |
if( !empty( $this->args['custom_redirect_after_edit_profile_url'] ) )
|
| 226 |
$this->args['redirect_url'] = $this->args['custom_redirect_after_edit_profile_url'];
|
|
|
|
| 227 |
}
|
| 228 |
|
| 229 |
$redirect_location = ( wppb_check_missing_http( $this->args['redirect_url'] ) ? 'http://'.$this->args['redirect_url'] : $this->args['redirect_url'] );
|
| 230 |
$redirect_url = apply_filters( 'wppb_redirect_url', '<a href="'.$redirect_location.'">'.__( 'here', 'profile-builder' ).'</a>' );
|
| 231 |
+
|
| 232 |
return apply_filters ( 'wppb_redirect_message_before_returning', '<p class="redirect_message">'.sprintf( wp_slash( __( 'You will soon be redirected automatically. If you see this page for more than %1$d seconds, please click %2$s.%3$s', 'profile-builder' ) ), $this->args['redirect_delay'], $redirect_url, '<meta http-equiv="Refresh" content="'.$this->args['redirect_delay'].';url='.$redirect_location.'" />' ).'</p>', $this->args );
|
| 233 |
}
|
| 234 |
|
| 260 |
$location = home_url();
|
| 261 |
}
|
| 262 |
}else if ( $this->args['redirect_activated'] == '-' ){
|
| 263 |
+
$this->wppb_custom_redirect_check();
|
| 264 |
+
$location = $this->args['redirect_url'];
|
|
|
|
|
|
|
| 265 |
}
|
| 266 |
else{
|
| 267 |
$location = ( wppb_check_missing_http( $this->args['redirect_url'] ) ? 'http://'.$this->args['redirect_url'] : $this->args['redirect_url'] );
|
| 397 |
<p class="form-submit">
|
| 398 |
<?php
|
| 399 |
if( $this->args['form_type'] == 'register' )
|
| 400 |
+
$button_name = ( current_user_can( 'create_users' ) ? __( 'Add User', 'profile-builder' ) : __( 'Register', 'profile-builder' ) );
|
| 401 |
|
| 402 |
elseif( $this->args['form_type'] == 'edit_profile' )
|
| 403 |
$button_name = __( 'Update', 'profile-builder' );
|
| 543 |
}
|
| 544 |
|
| 545 |
function wppb_register_user( $global_request, $userdata ){
|
| 546 |
+
$wppb_module_settings = get_option( 'wppb_module_settings' );
|
| 547 |
$wppb_general_settings = get_option( 'wppb_general_settings' );
|
| 548 |
$user_id = null;
|
| 549 |
$new_user_signup = false;
|
| 639 |
return;
|
| 640 |
|
| 641 |
/* add a hard cap: if we have more than 5000 users don't display the dropdown for performance considerations */
|
| 642 |
+
$user_count = count_users();
|
| 643 |
if( $user_count['total_users'] > apply_filters( 'wppb_edit_other_users_count_limit', 5000 ) )
|
| 644 |
return;
|
| 645 |
|
| 650 |
|
| 651 |
$query_args['fields'] = array( 'ID', 'user_login', 'display_name' );
|
| 652 |
$query_args['role'] = apply_filters( 'wppb_edit_profile_user_dropdown_role', '' );
|
| 653 |
+
$users = get_users( apply_filters( 'wppb_edit_other_users_dropdown_query_args', $query_args ) );
|
| 654 |
if( !empty( $users ) ) {
|
| 655 |
?>
|
| 656 |
<form method="GET" action="" id="select_user_to_edit_form">
|
front-end/logout.php
CHANGED
|
@@ -12,7 +12,10 @@
|
|
| 12 |
|
| 13 |
$current_user = get_userdata( get_current_user_id() );
|
| 14 |
|
| 15 |
-
extract( shortcode_atts( array( 'text' => sprintf( __('You are currently logged in as %s. ','profile-builder') ,$current_user->user_login) , 'redirect' => wppb_curpageurl(), 'redirect_priority' => 'normal', 'link_text' => __('Log out »','profile-builder')), $atts ) );
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
if( PROFILE_BUILDER == 'Profile Builder Pro' ) {
|
| 18 |
$wppb_module_settings = get_option( 'wppb_module_settings' );
|
| 12 |
|
| 13 |
$current_user = get_userdata( get_current_user_id() );
|
| 14 |
|
| 15 |
+
extract( shortcode_atts( array( 'text' => sprintf( __('You are currently logged in as %s. ','profile-builder') ,$current_user->user_login) , 'redirect' => wppb_curpageurl(), 'redirect_url' => wppb_curpageurl(), 'redirect_priority' => 'normal', 'link_text' => __('Log out »','profile-builder')), $atts ) );
|
| 16 |
+
|
| 17 |
+
if( !empty( $redirect_url ) )
|
| 18 |
+
$redirect = $redirect_url;
|
| 19 |
|
| 20 |
if( PROFILE_BUILDER == 'Profile Builder Pro' ) {
|
| 21 |
$wppb_module_settings = get_option( 'wppb_module_settings' );
|
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.4.
|
| 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.4.
|
| 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.8
|
| 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.8' );
|
| 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
|
@@ -5,7 +5,7 @@ Tags: user registration, user registration form, user fields, extra user fields,
|
|
| 5 |
|
| 6 |
Requires at least: 3.1
|
| 7 |
Tested up to: 4.6.1
|
| 8 |
-
Stable tag: 2.4.
|
| 9 |
License: GPLv2 or later
|
| 10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
| 11 |
|
|
@@ -150,6 +150,12 @@ This plugin adds/removes user fields in the front-end. Both default and extra pr
|
|
| 150 |
10. Profile Builder Login Widget
|
| 151 |
|
| 152 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 153 |
= 2.4.7 =
|
| 154 |
* Fixed an issue with the redirect after registration autologin and string translations
|
| 155 |
* Changes to Addons page to meet wp directory requirements
|
| 5 |
|
| 6 |
Requires at least: 3.1
|
| 7 |
Tested up to: 4.6.1
|
| 8 |
+
Stable tag: 2.4.8
|
| 9 |
License: GPLv2 or later
|
| 10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
| 11 |
|
| 150 |
10. Profile Builder Login Widget
|
| 151 |
|
| 152 |
== Changelog ==
|
| 153 |
+
= 2.4.8 =
|
| 154 |
+
* Now when an administrator registers an user the Register button text has changed to Add User
|
| 155 |
+
* Multiple fixes regarding redirects
|
| 156 |
+
* Fixed issues with redirect_url shortcode parameter and changed the logout shortcode parameter to redirect_url from redirect
|
| 157 |
+
* Added the filter 'wppb_edit_other_users_dropdown_query_args' for changing the user query on the edit other users dropwdown
|
| 158 |
+
|
| 159 |
= 2.4.7 =
|
| 160 |
* Fixed an issue with the redirect after registration autologin and string translations
|
| 161 |
* Changes to Addons page to meet wp directory requirements
|
