Version Description
- Added Blog Details field type
- Email From Name and Subject should now display proper special characters in all cases
- Fix css issue with notice image on forms taking an inherit width instead of auto
- Fixed an issue with automatic login with redirect on Firefox
Download this release
Release Info
Developer | madalin.ungureanu |
Plugin | User registration & user profile – Profile Builder |
Version | 2.5.5 |
Comparing to | |
See all releases |
Code changes from version 2.5.4 to 2.5.5
- admin/admin-bar.php +9 -7
- admin/admin-functions.php +19 -15
- admin/manage-fields.php +13 -1
- assets/css/style-back-end.css +1 -0
- assets/css/style-front-end.css +29 -0
- assets/js/jquery-manage-fields-live-change.js +9 -0
- assets/js/jquery-pb-sitewide.js +13 -0
- assets/lib/wck-api/wordpress-creation-kit.php +1 -0
- features/email-confirmation/email-confirmation.php +12 -1
- features/functions.php +58 -2
- front-end/class-formbuilder.php +1 -1
- front-end/default-fields/blog-details/blog-details.php +231 -0
- front-end/default-fields/default-fields.php +3 -0
- front-end/recover.php +6 -13
- index.php +2 -2
- readme.txt +10 -4
admin/admin-bar.php
CHANGED
@@ -105,13 +105,15 @@ function wppb_replace_username_on_admin_bar( $wp_admin_bar ) {
|
|
105 |
|
106 |
if ( isset( $wppb_general_settings['loginWith'] ) && ( $wppb_general_settings['loginWith'] == 'email' ) ){
|
107 |
$current_user = wp_get_current_user();
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
|
|
|
|
115 |
}
|
116 |
|
117 |
return $wp_admin_bar;
|
105 |
|
106 |
if ( isset( $wppb_general_settings['loginWith'] ) && ( $wppb_general_settings['loginWith'] == 'email' ) ){
|
107 |
$current_user = wp_get_current_user();
|
108 |
+
|
109 |
+
if ( $current_user->ID != 0 ) {
|
110 |
+
$my_account_main = $wp_admin_bar->get_node('my-account');
|
111 |
+
$new_title1 = str_replace($current_user->display_name, $current_user->user_email, $my_account_main->title);
|
112 |
+
$wp_admin_bar->add_node(array('id' => 'my-account', 'title' => $new_title1));
|
113 |
+
|
114 |
+
$my_account_sub = $wp_admin_bar->get_node('user-info');
|
115 |
+
$wp_admin_bar->add_node(array('parent' => 'user-actions', 'id' => 'user-info', 'title' => get_avatar($current_user->ID, 64) . "<span class='display-name'>{$current_user->user_email}</span>", 'href' => get_edit_profile_url($current_user->ID), 'meta' => array('tabindex' => -1)));
|
116 |
+
}
|
117 |
}
|
118 |
|
119 |
return $wp_admin_bar;
|
admin/admin-functions.php
CHANGED
@@ -26,25 +26,29 @@ function wppb_field_format ( $field_title, $field ){
|
|
26 |
*
|
27 |
* @return string $form
|
28 |
*/
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
if ( $wppb_generalSettings['loginWith'] == 'email' )
|
33 |
-
if ( ( $value == 'Username ( Default - Username )' ) || ( $value == 'Username' ) )
|
34 |
-
$form .= '<div id="wppb-login-email-nag" class="wppb-backend-notice">' . sprintf( __( 'Login is set to be done using the E-mail. This field will NOT appear in the front-end! ( you can change these settings under the "%s" tab )', 'profile-builder' ), '<a href="'.admin_url( 'admin.php?page=profile-builder-general-settings' ).'" target="_blank">' . __('General Settings', 'profile-builder') . '</a>' ) . '</div>';
|
35 |
-
}
|
36 |
-
|
37 |
-
// add a notice to 'Default - Display name publicly as' field
|
38 |
global $wppb_results_field;
|
39 |
-
|
40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
-
|
43 |
}
|
44 |
-
add_filter( "wck_before_listed_wppb_manage_fields_element_0", 'wppb_manage_fields_display_field_title_slug', 10, 3 );
|
45 |
-
add_filter( "wck_before_listed_wppb_epf_fields_element_0", 'wppb_manage_fields_display_field_title_slug', 10, 3 );
|
46 |
-
add_filter( "wck_before_listed_wppb_rf_fields_element_0", 'wppb_manage_fields_display_field_title_slug', 10, 3 );
|
47 |
|
|
|
48 |
|
49 |
/**
|
50 |
* Check if field type is 'Default - Display name publicly as' so we can add a notification for it
|
26 |
*
|
27 |
* @return string $form
|
28 |
*/
|
29 |
+
|
30 |
+
function wppb_manage_fields_display_field_title_slug( $form ){
|
31 |
+
// add a notice to fields
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
global $wppb_results_field;
|
33 |
+
switch ($wppb_results_field){
|
34 |
+
case 'Default - Username':
|
35 |
+
$wppb_generalSettings = get_option( 'wppb_general_settings', 'not_found' );
|
36 |
+
if ( $wppb_generalSettings != 'not_found' && $wppb_generalSettings['loginWith'] == 'email' ) {
|
37 |
+
$form .= '<div id="wppb-login-email-nag" class="wppb-backend-notice">' . sprintf(__('Login is set to be done using the E-mail. This field will NOT appear in the front-end! ( you can change these settings under the "%s" tab )', 'profile-builder'), '<a href="' . admin_url('admin.php?page=profile-builder-general-settings') . '" target="_blank">' . __('General Settings', 'profile-builder') . '</a>') . '</div>';
|
38 |
+
}
|
39 |
+
break;
|
40 |
+
case 'Default - Display name publicly as':
|
41 |
+
$form .= '<div id="wppb-display-name-nag" class="wppb-backend-notice">' . __( 'Display name publicly as - only appears on the Edit Profile page!', 'profile-builder' ) . '</div>';
|
42 |
+
break;
|
43 |
+
case 'Default - Blog Details':
|
44 |
+
$form .= '<div id="wppb-blog-details-nag" class="wppb-backend-notice">' . __( 'Blog Details - only appears on the Registration page!', 'profile-builder' ) . '</div>';
|
45 |
+
break;
|
46 |
+
}
|
47 |
|
48 |
+
return $form;
|
49 |
}
|
|
|
|
|
|
|
50 |
|
51 |
+
add_filter( 'wck_after_content_element', 'wppb_manage_fields_display_field_title_slug' );
|
52 |
|
53 |
/**
|
54 |
* Check if field type is 'Default - Display name publicly as' so we can add a notification for it
|
admin/manage-fields.php
CHANGED
@@ -42,6 +42,9 @@ function wppb_manage_fields_submenu(){
|
|
42 |
$manage_field_types[] = 'Default - Repeat Password';
|
43 |
$manage_field_types[] = 'Default - Biographical Info';
|
44 |
$manage_field_types[] = 'Default - Display name publicly as';
|
|
|
|
|
|
|
45 |
|
46 |
if( PROFILE_BUILDER != 'Profile Builder Free' ) {
|
47 |
$manage_field_types[] = 'Heading';
|
@@ -212,6 +215,9 @@ function wppb_prepopulate_fields(){
|
|
212 |
$prepopulated_fields[] = array( 'field' => 'Default - Biographical Info', 'field-title' => __( 'Biographical Info', 'profile-builder' ), 'meta-name' => 'description', 'overwrite-existing' => 'No', 'id' => '14', 'description' => __( 'Share a little biographical information to fill out your profile. This may be shown publicly.', 'profile-builder' ), 'row-count' => '5', 'allowed-image-extensions' => '.*', 'allowed-upload-extensions' => '.*', 'avatar-size' => '100', 'date-format' => 'mm/dd/yy', 'terms-of-agreement' => '', 'options' => '', 'labels' => '', 'public-key' => '', 'private-key' => '', 'default-value' => '', 'default-option' => '', 'default-options' => '', 'required' => 'No' );
|
213 |
$prepopulated_fields[] = array( 'field' => 'Default - Password', 'field-title' => __( 'Password', 'profile-builder' ), 'meta-name' => '', 'overwrite-existing' => 'No', 'id' => '15', 'description' => __( 'Type your password.', 'profile-builder' ), 'row-count' => '5', 'allowed-image-extensions' => '.*', 'allowed-upload-extensions' => '.*', 'avatar-size' => '100', 'date-format' => 'mm/dd/yy', 'terms-of-agreement' => '', 'options' => '', 'labels' => '', 'public-key' => '', 'private-key' => '', 'default-value' => '', 'default-option' => '', 'default-options' => '', 'default-content' => '', 'required' => 'Yes' );
|
214 |
$prepopulated_fields[] = array( 'field' => 'Default - Repeat Password', 'field-title' => __( 'Repeat Password', 'profile-builder' ), 'meta-name' => '', 'overwrite-existing' => 'No', 'id' => '16', 'description' => __( 'Type your password again. ', 'profile-builder' ), 'row-count' => '5', 'allowed-image-extensions' => '.*', 'allowed-upload-extensions' => '.*', 'avatar-size' => '100', 'date-format' => 'mm/dd/yy', 'terms-of-agreement' => '', 'options' => '', 'labels' => '', 'public-key' => '', 'private-key' => '', 'default-value' => '', 'default-option' => '', 'default-options' => '', 'default-content' => '', 'required' => 'Yes' );
|
|
|
|
|
|
|
215 |
|
216 |
add_option ( 'wppb_manage_fields', apply_filters ( 'wppb_prepopulated_fields', $prepopulated_fields ) );
|
217 |
}
|
@@ -933,6 +939,11 @@ function wppb_return_unique_field_list( $only_default_fields = false ){
|
|
933 |
$unique_field_list[] = 'Default - Repeat Password';
|
934 |
$unique_field_list[] = 'Default - Biographical Info';
|
935 |
$unique_field_list[] = 'Default - Display name publicly as';
|
|
|
|
|
|
|
|
|
|
|
936 |
if( !$only_default_fields ){
|
937 |
$unique_field_list[] = 'Avatar';
|
938 |
$unique_field_list[] = 'reCAPTCHA';
|
@@ -1197,7 +1208,7 @@ function wppb_add_content_before_manage_fields(){
|
|
1197 |
<p>
|
1198 |
<?php
|
1199 |
if( PROFILE_BUILDER == 'Profile Builder Pro' )
|
1200 |
-
_e("If you're interested in displaying different fields in the registration and edit profile forms, please use the Multiple Registration & Edit Profile Forms
|
1201 |
else
|
1202 |
_e( "With Profile Builder Pro v2 you can display different fields in the registration and edit profile forms, using the Multiple Registration & Edit Profile Forms module.", "profile-builder" )
|
1203 |
?>
|
@@ -1246,6 +1257,7 @@ function wppb_wpml_compat_with_fields( $oldvalue, $_newvalue ){
|
|
1246 |
'Default - Password',
|
1247 |
'Default - Repeat Password',
|
1248 |
'Default - Biographical Info',
|
|
|
1249 |
'Default - Display name publicly as'
|
1250 |
);
|
1251 |
|
42 |
$manage_field_types[] = 'Default - Repeat Password';
|
43 |
$manage_field_types[] = 'Default - Biographical Info';
|
44 |
$manage_field_types[] = 'Default - Display name publicly as';
|
45 |
+
if ( wppb_can_users_signup_blog() ) {
|
46 |
+
$manage_field_types[] = 'Default - Blog Details';
|
47 |
+
}
|
48 |
|
49 |
if( PROFILE_BUILDER != 'Profile Builder Free' ) {
|
50 |
$manage_field_types[] = 'Heading';
|
215 |
$prepopulated_fields[] = array( 'field' => 'Default - Biographical Info', 'field-title' => __( 'Biographical Info', 'profile-builder' ), 'meta-name' => 'description', 'overwrite-existing' => 'No', 'id' => '14', 'description' => __( 'Share a little biographical information to fill out your profile. This may be shown publicly.', 'profile-builder' ), 'row-count' => '5', 'allowed-image-extensions' => '.*', 'allowed-upload-extensions' => '.*', 'avatar-size' => '100', 'date-format' => 'mm/dd/yy', 'terms-of-agreement' => '', 'options' => '', 'labels' => '', 'public-key' => '', 'private-key' => '', 'default-value' => '', 'default-option' => '', 'default-options' => '', 'required' => 'No' );
|
216 |
$prepopulated_fields[] = array( 'field' => 'Default - Password', 'field-title' => __( 'Password', 'profile-builder' ), 'meta-name' => '', 'overwrite-existing' => 'No', 'id' => '15', 'description' => __( 'Type your password.', 'profile-builder' ), 'row-count' => '5', 'allowed-image-extensions' => '.*', 'allowed-upload-extensions' => '.*', 'avatar-size' => '100', 'date-format' => 'mm/dd/yy', 'terms-of-agreement' => '', 'options' => '', 'labels' => '', 'public-key' => '', 'private-key' => '', 'default-value' => '', 'default-option' => '', 'default-options' => '', 'default-content' => '', 'required' => 'Yes' );
|
217 |
$prepopulated_fields[] = array( 'field' => 'Default - Repeat Password', 'field-title' => __( 'Repeat Password', 'profile-builder' ), 'meta-name' => '', 'overwrite-existing' => 'No', 'id' => '16', 'description' => __( 'Type your password again. ', 'profile-builder' ), 'row-count' => '5', 'allowed-image-extensions' => '.*', 'allowed-upload-extensions' => '.*', 'avatar-size' => '100', 'date-format' => 'mm/dd/yy', 'terms-of-agreement' => '', 'options' => '', 'labels' => '', 'public-key' => '', 'private-key' => '', 'default-value' => '', 'default-option' => '', 'default-options' => '', 'default-content' => '', 'required' => 'Yes' );
|
218 |
+
if ( wppb_can_users_signup_blog() ){
|
219 |
+
$prepopulated_fields[] = array( 'field' => 'Default - Blog Details', 'field-title' => __( 'Blog Details', 'profile-builder' ), 'meta-name' => '', 'overwrite-existing' => 'No', 'id' => '17', 'description' => '', 'row-count' => '5', 'allowed-image-extensions' => '.*', 'allowed-upload-extensions' => '.*', 'avatar-size' => '100', 'date-format' => 'mm/dd/yy', 'terms-of-agreement' => '', 'options' => '', 'labels' => '', 'public-key' => '', 'private-key' => '', 'default-value' => '', 'default-option' => '', 'default-options' => '', 'default-content' => '', 'required' => 'No' );
|
220 |
+
}
|
221 |
|
222 |
add_option ( 'wppb_manage_fields', apply_filters ( 'wppb_prepopulated_fields', $prepopulated_fields ) );
|
223 |
}
|
939 |
$unique_field_list[] = 'Default - Repeat Password';
|
940 |
$unique_field_list[] = 'Default - Biographical Info';
|
941 |
$unique_field_list[] = 'Default - Display name publicly as';
|
942 |
+
|
943 |
+
if ( wppb_can_users_signup_blog() ) {
|
944 |
+
$unique_field_list[] = 'Default - Blog Details';
|
945 |
+
}
|
946 |
+
|
947 |
if( !$only_default_fields ){
|
948 |
$unique_field_list[] = 'Avatar';
|
949 |
$unique_field_list[] = 'reCAPTCHA';
|
1208 |
<p>
|
1209 |
<?php
|
1210 |
if( PROFILE_BUILDER == 'Profile Builder Pro' )
|
1211 |
+
_e("If you're interested in displaying different fields in the registration and edit profile forms, please use the Multiple Registration & Edit Profile Forms Modules.", 'profile-builder');
|
1212 |
else
|
1213 |
_e( "With Profile Builder Pro v2 you can display different fields in the registration and edit profile forms, using the Multiple Registration & Edit Profile Forms module.", "profile-builder" )
|
1214 |
?>
|
1257 |
'Default - Password',
|
1258 |
'Default - Repeat Password',
|
1259 |
'Default - Biographical Info',
|
1260 |
+
'Default - Blog Details',
|
1261 |
'Default - Display name publicly as'
|
1262 |
);
|
1263 |
|
assets/css/style-back-end.css
CHANGED
@@ -431,6 +431,7 @@
|
|
431 |
}
|
432 |
|
433 |
.wppb-backend-notice{
|
|
|
434 |
line-height: 16px;
|
435 |
padding: 11px;
|
436 |
font-size: 14px;
|
431 |
}
|
432 |
|
433 |
.wppb-backend-notice{
|
434 |
+
display: inline-block;
|
435 |
line-height: 16px;
|
436 |
padding: 11px;
|
437 |
font-size: 14px;
|
assets/css/style-front-end.css
CHANGED
@@ -311,6 +311,21 @@ input#send_credentials_via_email{
|
|
311 |
font-family: 'Roboto', sans-serif;
|
312 |
}
|
313 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
314 |
|
315 |
/*--------------------------------------------------------------
|
316 |
4.0 Errors & Notices
|
@@ -384,6 +399,8 @@ input#send_credentials_via_email{
|
|
384 |
vertical-align: middle;
|
385 |
margin-top: -3px;
|
386 |
padding-left:5px;
|
|
|
|
|
387 |
}
|
388 |
|
389 |
.wppb-form-field > span.wppb-form-error{
|
@@ -394,6 +411,18 @@ input#send_credentials_via_email{
|
|
394 |
margin-left: 0;
|
395 |
}
|
396 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
397 |
|
398 |
|
399 |
|
311 |
font-family: 'Roboto', sans-serif;
|
312 |
}
|
313 |
|
314 |
+
.wppb-create-new-site{
|
315 |
+
width: 100%;
|
316 |
+
}
|
317 |
+
input#wppb_create_new_site_checkbox{
|
318 |
+
width: auto;
|
319 |
+
margin-right: 10px;
|
320 |
+
float: none;
|
321 |
+
}
|
322 |
+
label[for=wppb_create_new_site_checkbox]{
|
323 |
+
width:100%;
|
324 |
+
}
|
325 |
+
label[for=blog-privacy]{
|
326 |
+
width:100%;
|
327 |
+
}
|
328 |
+
|
329 |
|
330 |
/*--------------------------------------------------------------
|
331 |
4.0 Errors & Notices
|
399 |
vertical-align: middle;
|
400 |
margin-top: -3px;
|
401 |
padding-left:5px;
|
402 |
+
width: auto;
|
403 |
+
height: auto;
|
404 |
}
|
405 |
|
406 |
.wppb-form-field > span.wppb-form-error{
|
411 |
margin-left: 0;
|
412 |
}
|
413 |
|
414 |
+
/* Remove global Blog Details Field error */
|
415 |
+
#wppb-register-user .wppb-default-blog-details.wppb-field-error{
|
416 |
+
background-color: transparent !important;
|
417 |
+
border: 0px !important;
|
418 |
+
}
|
419 |
+
.wppb-default-blog-details > span.wppb-form-error{
|
420 |
+
display:none;
|
421 |
+
}
|
422 |
+
.wppb-blog-details-heading span {
|
423 |
+
margin-left: 0;
|
424 |
+
}
|
425 |
+
|
426 |
|
427 |
|
428 |
|
assets/js/jquery-manage-fields-live-change.js
CHANGED
@@ -190,6 +190,15 @@ var fields = {
|
|
190 |
}
|
191 |
},
|
192 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
193 |
'Heading': { 'show_rows' : [
|
194 |
'.row-field-title',
|
195 |
'.row-description',
|
190 |
}
|
191 |
},
|
192 |
|
193 |
+
'Default - Blog Details': { 'show_rows' : [
|
194 |
+
'.row-field-title',
|
195 |
+
'.row-description'
|
196 |
+
],
|
197 |
+
'properties': {
|
198 |
+
'meta_name_value' : ''
|
199 |
+
}
|
200 |
+
},
|
201 |
+
|
202 |
'Heading': { 'show_rows' : [
|
203 |
'.row-field-title',
|
204 |
'.row-description',
|
assets/js/jquery-pb-sitewide.js
CHANGED
@@ -95,6 +95,19 @@ jQuery( function(){
|
|
95 |
jQuery( '.row-facet-behaviour, .row-facet-limit', jQuery(this).parent().parent().parent()).hide();
|
96 |
jQuery( '.row-facet-behaviour #facet-behaviour', jQuery(this).parent().parent().parent()).val('narrow');
|
97 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
});
|
99 |
|
100 |
});
|
95 |
jQuery( '.row-facet-behaviour, .row-facet-limit', jQuery(this).parent().parent().parent()).hide();
|
96 |
jQuery( '.row-facet-behaviour #facet-behaviour', jQuery(this).parent().parent().parent()).val('narrow');
|
97 |
}
|
98 |
+
if( jQuery(this).val() == 'search' ){
|
99 |
+
jQuery( '#wppb-ul-faceted-args .row-facet-meta #facet-meta option[value="billing_country"] ').hide();
|
100 |
+
jQuery( '#wppb-ul-faceted-args .row-facet-meta #facet-meta option[value="shipping_country"] ').hide();
|
101 |
+
jQuery( '#wppb-ul-faceted-args .row-facet-meta #facet-meta option[value="billing_state"] ').hide();
|
102 |
+
jQuery( '#wppb-ul-faceted-args .row-facet-meta #facet-meta option[value="shipping_state"] ').hide();
|
103 |
+
}
|
104 |
+
else {
|
105 |
+
jQuery( '#wppb-ul-faceted-args .row-facet-meta #facet-meta option[value="billing_country"] ').show();
|
106 |
+
jQuery( '#wppb-ul-faceted-args .row-facet-meta #facet-meta option[value="shipping_country"] ').show();
|
107 |
+
jQuery( '#wppb-ul-faceted-args .row-facet-meta #facet-meta option[value="billing_state"] ').show();
|
108 |
+
jQuery( '#wppb-ul-faceted-args .row-facet-meta #facet-meta option[value="shipping_state"] ').show()
|
109 |
+
}
|
110 |
+
|
111 |
});
|
112 |
|
113 |
});
|
assets/lib/wck-api/wordpress-creation-kit.php
CHANGED
@@ -525,6 +525,7 @@ class Wordpress_Creation_Kit_PB{
|
|
525 |
}
|
526 |
$list .= '</ul>';
|
527 |
|
|
|
528 |
/* check if we have nested repeaters */
|
529 |
if( function_exists( 'wck_nr_check_for_nested_repeaters' ) ){
|
530 |
if( wck_nr_check_for_nested_repeaters( $fields ) === true ){
|
525 |
}
|
526 |
$list .= '</ul>';
|
527 |
|
528 |
+
$list = apply_filters( 'wck_after_content_element', $list, $meta, $id, $results, $element_id );
|
529 |
/* check if we have nested repeaters */
|
530 |
if( function_exists( 'wck_nr_check_for_nested_repeaters' ) ){
|
531 |
if( wck_nr_check_for_nested_repeaters( $fields ) === true ){
|
features/email-confirmation/email-confirmation.php
CHANGED
@@ -289,6 +289,18 @@ function wppb_add_meta_to_user_on_activation( $user_id, $password, $meta ){
|
|
289 |
break;
|
290 |
}
|
291 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
292 |
default: {
|
293 |
if ( isset( $meta[$value['meta-name']] ) ) {
|
294 |
update_user_meta($user_id, $value['meta-name'], $meta[$value['meta-name']]);
|
@@ -298,7 +310,6 @@ function wppb_add_meta_to_user_on_activation( $user_id, $password, $meta ){
|
|
298 |
}
|
299 |
}
|
300 |
}
|
301 |
-
|
302 |
do_action( 'wppb_add_other_meta_on_user_activation', $user_id, $meta );
|
303 |
}
|
304 |
|
289 |
break;
|
290 |
}
|
291 |
}
|
292 |
+
case 'Default - Blog Details':{
|
293 |
+
if ( is_multisite() && isset( $meta['wppb_create_new_site_checkbox'] ) && $meta['wppb_create_new_site_checkbox'] == 'yes' ) {
|
294 |
+
$blog_url = $meta['wppb_blog_url'];
|
295 |
+
$blog_title = $meta['wppb_blog_title'];
|
296 |
+
|
297 |
+
$privacy['public'] = ( isset( $meta['wppb_blog_privacy'] ) && 'Yes' == $meta['wppb_blog_privacy'] ) ? true : false;
|
298 |
+
$blog_details = wpmu_validate_blog_signup( $blog_url, $blog_title );
|
299 |
+
if ( empty($blog_details['errors']->errors['blogname']) && empty($blog_details['errors']->errors['blog_title'])) {
|
300 |
+
wpmu_create_blog( $blog_details['domain'], $blog_details['path'], $blog_details['blog_title'], $user_id, $privacy );
|
301 |
+
}
|
302 |
+
}
|
303 |
+
}
|
304 |
default: {
|
305 |
if ( isset( $meta[$value['meta-name']] ) ) {
|
306 |
update_user_meta($user_id, $value['meta-name'], $meta[$value['meta-name']]);
|
310 |
}
|
311 |
}
|
312 |
}
|
|
|
313 |
do_action( 'wppb_add_other_meta_on_user_activation', $user_id, $meta );
|
314 |
}
|
315 |
|
features/functions.php
CHANGED
@@ -158,7 +158,7 @@ if ( is_admin() ){
|
|
158 |
* @param string $message_from
|
159 |
*
|
160 |
*/
|
161 |
-
function wppb_mail( $to, $subject, $message, $message_from, $context = null ) {
|
162 |
$to = apply_filters( 'wppb_send_email_to', $to );
|
163 |
$send_email = apply_filters( 'wppb_send_email', true, $to, $subject, $message, $context );
|
164 |
|
@@ -170,7 +170,7 @@ function wppb_mail( $to, $subject, $message, $message_from, $context = null ) {
|
|
170 |
//we add this filter to enable html encoding
|
171 |
add_filter( 'wp_mail_content_type', create_function( '', 'return "text/html"; ' ) );
|
172 |
|
173 |
-
$sent = wp_mail( $to , $subject, $message );
|
174 |
|
175 |
do_action( 'wppb_after_sending_email', $sent, $to, $subject, $message, $send_email, $context );
|
176 |
|
@@ -911,3 +911,59 @@ function wppb_manage_required_attribute() {
|
|
911 |
}
|
912 |
}
|
913 |
add_action( 'wp_footer', 'wppb_manage_required_attribute' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
* @param string $message_from
|
159 |
*
|
160 |
*/
|
161 |
+
function wppb_mail( $to, $subject, $message, $message_from = null, $context = null ) {
|
162 |
$to = apply_filters( 'wppb_send_email_to', $to );
|
163 |
$send_email = apply_filters( 'wppb_send_email', true, $to, $subject, $message, $context );
|
164 |
|
170 |
//we add this filter to enable html encoding
|
171 |
add_filter( 'wp_mail_content_type', create_function( '', 'return "text/html"; ' ) );
|
172 |
|
173 |
+
$sent = wp_mail( $to , html_entity_decode( htmlspecialchars_decode( $subject, ENT_QUOTES ), ENT_QUOTES ), $message );
|
174 |
|
175 |
do_action( 'wppb_after_sending_email', $sent, $to, $subject, $message, $send_email, $context );
|
176 |
|
911 |
}
|
912 |
}
|
913 |
add_action( 'wp_footer', 'wppb_manage_required_attribute' );
|
914 |
+
|
915 |
+
function wpbb_specify_blog_details_on_signup_email( $message, $user_email, $user, $activation_key, $registration_page_url, $meta, $from_name, $context ){
|
916 |
+
$meta = unserialize($meta);
|
917 |
+
|
918 |
+
if ( is_multisite() && isset( $meta['wppb_create_new_site_checkbox'] ) && $meta['wppb_create_new_site_checkbox'] == 'yes' ) {
|
919 |
+
$blog_details = wpmu_validate_blog_signup( $meta['wppb_blog_url'], $meta['wppb_blog_title'] );
|
920 |
+
|
921 |
+
if ( empty($blog_details['errors']->errors['blogname']) && empty($blog_details['errors']->errors['blog_title'])) {
|
922 |
+
$blog_path = $blog_details['domain'] . $blog_details['path'];
|
923 |
+
$message .= __( '<br><br>Also, you will be able to visit your site at ', 'profile-builder' ) . '<a href="' . $blog_path . '">' . $blog_path . '</a>.';
|
924 |
+
}
|
925 |
+
}
|
926 |
+
return $message;
|
927 |
+
}
|
928 |
+
add_filter( 'wppb_signup_user_notification_email_content', 'wpbb_specify_blog_details_on_signup_email', 5, 8 );
|
929 |
+
|
930 |
+
function wpbb_specify_blog_details_on_registration_email( $user_message_content, $email, $password, $user_message_subject, $context ){
|
931 |
+
|
932 |
+
if ( is_multisite() ) {
|
933 |
+
$user = get_user_by( 'email', $email );
|
934 |
+
$blog_path = wppb_get_blog_url_of_user_id( $user->ID );
|
935 |
+
if ( ! empty ( $blog_path ) ) {
|
936 |
+
$user_message_content .= __( '<br><br>You can visit your site at ', 'profile-builder' ) . '<a href="' . $blog_path . '">' . $blog_path . '</a>.';
|
937 |
+
}
|
938 |
+
}
|
939 |
+
return $user_message_content;
|
940 |
+
|
941 |
+
}
|
942 |
+
add_filter( 'wppb_register_user_email_message_without_admin_approval', 'wpbb_specify_blog_details_on_registration_email', 5, 5 );
|
943 |
+
add_filter( 'wppb_register_user_email_message_with_admin_approval', 'wpbb_specify_blog_details_on_registration_email', 5, 5 );
|
944 |
+
|
945 |
+
|
946 |
+
function wppb_get_blog_url_of_user_id( $user_id, $ignore_privacy = true ){
|
947 |
+
$blog_id = get_user_meta( $user_id, 'primary_blog', true );
|
948 |
+
if ( is_multisite() && !empty( $blog_id ) ){
|
949 |
+
$blog_details = get_blog_details( $blog_id );
|
950 |
+
if ( $ignore_privacy || $blog_details->public ) {
|
951 |
+
return $blog_details->domain . $blog_details->path;
|
952 |
+
}
|
953 |
+
}
|
954 |
+
return '';
|
955 |
+
}
|
956 |
+
|
957 |
+
function wppb_can_users_signup_blog(){
|
958 |
+
if ( ! is_multisite() )
|
959 |
+
return false;
|
960 |
+
global $wpdb;
|
961 |
+
$current_site = get_current_site();
|
962 |
+
$sitemeta_options_query = $wpdb->prepare( "SELECT meta_value FROM {$wpdb->sitemeta} WHERE meta_key = 'registration' AND site_id = %d", $current_site->id );
|
963 |
+
$network_options_meta = $wpdb->get_results( $sitemeta_options_query );
|
964 |
+
|
965 |
+
if ( $network_options_meta[0]->meta_value == 'all' ){
|
966 |
+
return true;
|
967 |
+
}
|
968 |
+
return false;
|
969 |
+
}
|
front-end/class-formbuilder.php
CHANGED
@@ -279,7 +279,7 @@ class Profile_Builder_Form_Creator{
|
|
279 |
if ( $this->args['redirect_activated'] == 'No' || ( empty( $this->args['redirect_delay'] ) || $this->args['redirect_delay'] == '0' ) ) {
|
280 |
return "<script> window.location.replace( '". $location ."' ); </script>";
|
281 |
} else {
|
282 |
-
return
|
283 |
}
|
284 |
}
|
285 |
|
279 |
if ( $this->args['redirect_activated'] == 'No' || ( empty( $this->args['redirect_delay'] ) || $this->args['redirect_delay'] == '0' ) ) {
|
280 |
return "<script> window.location.replace( '". $location ."' ); </script>";
|
281 |
} else {
|
282 |
+
return $redirect_message;
|
283 |
}
|
284 |
}
|
285 |
|
front-end/default-fields/blog-details/blog-details.php
ADDED
@@ -0,0 +1,231 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/* handle field output */
|
3 |
+
function wppb_blog_details_handler( $output, $form_location, $field, $user_id, $field_check_errors, $request_data ){
|
4 |
+
|
5 |
+
// Display "Yes, I'd like to create a new site" checkbox if we're on the PB Register form and we are on Multisite with Network setting "Both sites and user accounts can be registered".
|
6 |
+
if ( ( $form_location != 'register' ) || ( ! wppb_can_users_signup_blog() ) ){
|
7 |
+
return $output;
|
8 |
+
}
|
9 |
+
|
10 |
+
//Check if Blog Details field is added in Manage Fields
|
11 |
+
$in_manage_fields = false;
|
12 |
+
$wppb_manage_fields = get_option( 'wppb_manage_fields', 'not_set' );
|
13 |
+
if ( $wppb_manage_fields != 'not_set' ){
|
14 |
+
foreach ( $wppb_manage_fields as $field ) {
|
15 |
+
if ( $field['field'] == 'Default - Blog Details' ) {
|
16 |
+
$in_manage_fields = true;
|
17 |
+
break;
|
18 |
+
}
|
19 |
+
}
|
20 |
+
}
|
21 |
+
if ( ! $in_manage_fields ) {
|
22 |
+
return $output;
|
23 |
+
}
|
24 |
+
|
25 |
+
|
26 |
+
$output = '<ul>';
|
27 |
+
|
28 |
+
$item_description = wppb_icl_t( 'plugin profile-builder-pro', 'default_field_'.$field['id'].'_description_translation', $field['description'] );
|
29 |
+
$heading = '<li class="wppb-form-field wppb-blog-details-heading"><h4>'.wppb_icl_t('plugin profile-builder-pro', 'custom_field_'.$field['id'].'_title_translation', $field['field-title']).'</h4><span class="wppb-description-delimiter">'.$item_description.'</span></li>';
|
30 |
+
$output .= apply_filters( 'wppb_blog_details_heading', $heading );
|
31 |
+
|
32 |
+
|
33 |
+
?><script type="text/javascript">
|
34 |
+
jQuery(document).ready(function(){
|
35 |
+
|
36 |
+
wppb_toggle_required_attrbute_for_blog_details();
|
37 |
+
jQuery("#wppb_create_new_site_checkbox").click(function(){
|
38 |
+
|
39 |
+
wppb_toggle_required_attrbute_for_blog_details();
|
40 |
+
jQuery(".wppb-blog-details-fields").toggle();
|
41 |
+
});
|
42 |
+
function wppb_toggle_required_attrbute_for_blog_details(){
|
43 |
+
|
44 |
+
// Trigger a custom event that will remove the HTML attribute -required- for hidden fields. This is necessary for browsers to allow form submission.
|
45 |
+
if(document.getElementById('wppb_create_new_site_checkbox').checked) {
|
46 |
+
jQuery(".wppb-blog-details-fields input" ).trigger( "wppbAddRequiredAttributeEvent" );
|
47 |
+
} else {
|
48 |
+
jQuery(".wppb-blog-details-fields input" ).trigger( "wppbRemoveRequiredAttributeEvent" );
|
49 |
+
}
|
50 |
+
}
|
51 |
+
});
|
52 |
+
</script> <?php
|
53 |
+
$checked = '';
|
54 |
+
if ( isset( $request_data['wppb_create_new_site_checkbox']) && ( $request_data['wppb_create_new_site_checkbox'] == 'yes') ) {
|
55 |
+
$checked = 'checked';
|
56 |
+
}else{
|
57 |
+
echo '<style> .wppb-blog-details-fields {display:none;} </style>';
|
58 |
+
}
|
59 |
+
$create_new_site_checkbox = '
|
60 |
+
<li class=" wppb-form-field wppb-create-new-site " id="wppb-create-new-site">
|
61 |
+
<label for="wppb_create_new_site_checkbox">
|
62 |
+
<input id="wppb_create_new_site_checkbox" type="checkbox" name="wppb_create_new_site_checkbox" value="yes" '.$checked.' autocomplete="off">
|
63 |
+
<strong>'. __('Yes, I\'d like to create a new site','profile-builder').'</strong> </label>
|
64 |
+
</li>';
|
65 |
+
$output .= apply_filters( 'wppb_blog_details_checkbox', $create_new_site_checkbox );
|
66 |
+
|
67 |
+
$output .= '<ul class="wppb-blog-details-fields">';
|
68 |
+
|
69 |
+
// Site URL
|
70 |
+
$item_description = __( 'Your site url will look like this:<br>', 'profile-builder' );
|
71 |
+
if ( is_subdomain_install() ) {
|
72 |
+
global $current_site;
|
73 |
+
$subdomain_base = apply_filters( 'wppb_blogs_subdomain_base', preg_replace( '|^www\.|', '', $current_site->domain ) . $current_site->path );
|
74 |
+
$domain = '"http://'. esc_attr( '<your-slug>.' ) . $subdomain_base;
|
75 |
+
} else {
|
76 |
+
$domain = '"' . esc_url( home_url( '/' ) ) . esc_attr( '<your-slug>' ) . '"';
|
77 |
+
}
|
78 |
+
$blog_url_input_value = '';
|
79 |
+
$blog_url_input_value = ( isset( $request_data['wppb_blog_url'] ) ? trim( $request_data['wppb_blog_url'] ) : $blog_url_input_value );
|
80 |
+
$error_mark = '<span class="wppb-required" title="'.wppb_required_field_error($field["field-title"]).'">*</span>';
|
81 |
+
|
82 |
+
$extra_attr = apply_filters( 'wppb_extra_attribute', '', $field, $form_location );
|
83 |
+
|
84 |
+
$error_class = '';
|
85 |
+
$is_error = wppb_check_individual_blog_fields( 'wppb_blog_url', $request_data, $form_location );
|
86 |
+
if ($is_error != '') {
|
87 |
+
$error_mark = '<img src="' . WPPB_PLUGIN_URL . 'assets/images/pencil_delete.png" title="' . wppb_required_field_error('') . '"/>';
|
88 |
+
$error_class = ' wppb-field-error';
|
89 |
+
}
|
90 |
+
|
91 |
+
$output .= '
|
92 |
+
<li class=" wppb-form-field wppb-blog-url ' . $error_class . '">
|
93 |
+
<label for="blog-url">' . __( 'Site URL slug', 'profile-builder' ) . $error_mark.'</label>
|
94 |
+
<input class="text-input default_field_blog_url" name="wppb_blog_url" maxlength="'. apply_filters( 'wppb_maximum_character_length', 70 ) .'" type="text" id="wppb_blog_url" value="'. esc_attr( wp_unslash( $blog_url_input_value ) ) .'" '. $extra_attr .' />';
|
95 |
+
$output .= '<span class="wppb-description-delimiter">'. $item_description . $domain . '</span>';
|
96 |
+
$output .= $is_error .'</li>';
|
97 |
+
|
98 |
+
|
99 |
+
|
100 |
+
// Site title
|
101 |
+
$blog_title_input_value = '';
|
102 |
+
$blog_title_input_value = ( isset( $request_data['wppb_blog_title'] ) ? trim( $request_data['wppb_blog_title'] ) : $blog_title_input_value );
|
103 |
+
$error_mark = '<span class="wppb-required" title="'.wppb_required_field_error($field["field-title"]).'">*</span>';
|
104 |
+
|
105 |
+
$extra_attr = apply_filters( 'wppb_extra_attribute', '', $field, $form_location );
|
106 |
+
|
107 |
+
$error_class = '';
|
108 |
+
$is_error = wppb_check_individual_blog_fields( 'wppb_blog_title', $request_data, $form_location );
|
109 |
+
if ($is_error != '') {
|
110 |
+
$error_mark = '<img src="' . WPPB_PLUGIN_URL . 'assets/images/pencil_delete.png" title="' . wppb_required_field_error('') . '"/>';
|
111 |
+
$error_class = ' wppb-field-error';
|
112 |
+
}
|
113 |
+
|
114 |
+
$output .= '
|
115 |
+
<li class=" wppb-form-field wppb-blog-title ' . $error_class . '">
|
116 |
+
<label for="blog-title">' . __( 'Site Title', 'profile-builder' ) . $error_mark.'</label>
|
117 |
+
<input class="text-input default_field_blog_title" name="wppb_blog_title" maxlength="'. apply_filters( 'wppb_maximum_character_length', 70 ) .'" type="text" id="wppb_blog_title" value="'. esc_attr( wp_unslash( $blog_title_input_value ) ) .'" '. $extra_attr .' />' .
|
118 |
+
$is_error . '</li>';
|
119 |
+
|
120 |
+
|
121 |
+
|
122 |
+
// Privacy
|
123 |
+
$blog_privacy_input_value = 'Yes';
|
124 |
+
$blog_privacy_input_value = ( isset( $request_data['wppb_blog_privacy'] ) ? trim( $request_data['wppb_blog_privacy'] ) : $blog_privacy_input_value );
|
125 |
+
$error_mark = '<span class="wppb-required" title="'.wppb_required_field_error($field["field-title"]).'">*</span>';
|
126 |
+
|
127 |
+
$radio_values = array( 'Yes', 'No' );
|
128 |
+
|
129 |
+
$error_class = '';
|
130 |
+
$is_error = wppb_check_individual_blog_fields( 'wppb_blog_privacy', $request_data, $form_location );
|
131 |
+
if ($is_error != '') {
|
132 |
+
$error_mark = '<img src="' . WPPB_PLUGIN_URL . 'assets/images/pencil_delete.png" title="' . wppb_required_field_error('') . '"/>';
|
133 |
+
$error_class = ' wppb-field-error';
|
134 |
+
}
|
135 |
+
|
136 |
+
$output .= '
|
137 |
+
<li class=" wppb-form-field wppb-blog-privacy ' . $error_class . ' ">
|
138 |
+
<label for="blog-privacy">'. __( 'Privacy: I would like my site to appear in search engines, and in public listings around this network.', 'profile-builder' ) . $error_mark.'</label>';
|
139 |
+
$output .= '<ul class="wppb-radios">';
|
140 |
+
foreach( $radio_values as $key => $value){
|
141 |
+
$output .= '<li><input value="'.esc_attr( trim( $value ) ).'" class="blog_privacy_radio '. apply_filters( 'wppb_fields_extra_css_class', '', $field ) .'" id="'.Wordpress_Creation_Kit_PB::wck_generate_slug( trim( $value ) ).'_'.$field['id'].'" name="wppb_blog_privacy" type="radio" '. $extra_attr .' ';
|
142 |
+
|
143 |
+
if ( $blog_privacy_input_value === trim( $value ) )
|
144 |
+
$output .= ' checked';
|
145 |
+
|
146 |
+
$output .= ' /><label for="'.Wordpress_Creation_Kit_PB::wck_generate_slug( trim( $value ) ).'_'.$field['id'].'" class="wppb-rc-value">'. trim( $radio_values[$key] ) .'</label></li>';
|
147 |
+
}
|
148 |
+
$output .= '</ul>' . $is_error . '</li>';
|
149 |
+
|
150 |
+
// end wppb-blog-details-fields
|
151 |
+
$output .= '</ul>';
|
152 |
+
|
153 |
+
$output .= '</ul>';
|
154 |
+
|
155 |
+
return apply_filters( 'wppb_blog_details_output', $output, $form_location, $field, $user_id, $field_check_errors, $request_data );
|
156 |
+
|
157 |
+
}
|
158 |
+
add_filter( 'wppb_output_form_field_default-blog-details', 'wppb_blog_details_handler', 10, 6 );
|
159 |
+
|
160 |
+
/* handle field save */
|
161 |
+
function wppb_create_blog_on_registration( $field, $user_id, $request_data, $form_location ){
|
162 |
+
if( $form_location == 'register' && $field['field'] == 'Default - Blog Details' && isset( $request_data['wppb_create_new_site_checkbox'] ) && $request_data['wppb_create_new_site_checkbox'] == 'yes' ) {
|
163 |
+
$blog_url = $request_data['wppb_blog_url'];
|
164 |
+
$blog_title = $request_data['wppb_blog_title'];
|
165 |
+
|
166 |
+
$usermeta['public'] = ( isset( $request_data['wppb_blog_privacy'] ) && 'Yes' == $request_data['wppb_blog_privacy'] ) ? true : false;
|
167 |
+
$blog_details = wpmu_validate_blog_signup( $blog_url, $blog_title );
|
168 |
+
if ( empty($blog_details['errors']->errors['blogname']) && empty($blog_details['errors']->errors['blog_title'])) {
|
169 |
+
wpmu_create_blog( $blog_details['domain'], $blog_details['path'], $blog_details['blog_title'], $user_id, $usermeta );
|
170 |
+
}
|
171 |
+
}
|
172 |
+
}
|
173 |
+
add_action( 'wppb_save_form_field', 'wppb_create_blog_on_registration', 10, 4 );
|
174 |
+
|
175 |
+
/* handle field validation */
|
176 |
+
function wppb_check_blog_details_values( $message, $field, $request_data, $form_location ){
|
177 |
+
if ( isset( $request_data['wppb_create_new_site_checkbox'] ) && $request_data['wppb_create_new_site_checkbox'] == 'yes' ){
|
178 |
+
$blog_fields_array = wppb_blog_details_fields_array();
|
179 |
+
foreach ( $blog_fields_array as $blog_field ){
|
180 |
+
if( ( isset( $request_data[$blog_field] ) && ( trim( $request_data[$blog_field] ) == '' ) ) || !isset( $request_data[$blog_field] ) ){
|
181 |
+
return wppb_required_field_error($blog_field);
|
182 |
+
}
|
183 |
+
}
|
184 |
+
}
|
185 |
+
return $message;
|
186 |
+
}
|
187 |
+
add_filter( 'wppb_check_form_field_default-blog-details', 'wppb_check_blog_details_values', 10, 4 );
|
188 |
+
|
189 |
+
/* Add blog details information to wp_signups table (when Email Confirmation is active) */
|
190 |
+
function wppb_add_blog_details_to_signup_table( $meta, $global_request, $role ){
|
191 |
+
if ( isset( $global_request['wppb_create_new_site_checkbox'] ) && $global_request['wppb_create_new_site_checkbox'] == 'yes' ) {
|
192 |
+
$blog_details_fields_array = wppb_blog_details_fields_array();
|
193 |
+
|
194 |
+
foreach ($blog_details_fields_array as $blog_field) {
|
195 |
+
$meta[$blog_field] = $global_request[$blog_field];
|
196 |
+
}
|
197 |
+
}
|
198 |
+
return $meta;
|
199 |
+
}
|
200 |
+
add_filter( 'wppb_add_to_user_signup_form_meta', 'wppb_add_blog_details_to_signup_table',10, 3 );
|
201 |
+
|
202 |
+
|
203 |
+
|
204 |
+
function wppb_blog_details_fields_array(){
|
205 |
+
return array(
|
206 |
+
'wppb_blog_title',
|
207 |
+
'wppb_blog_url',
|
208 |
+
'wppb_blog_privacy',
|
209 |
+
'wppb_create_new_site_checkbox'
|
210 |
+
);
|
211 |
+
}
|
212 |
+
|
213 |
+
function wppb_check_individual_blog_fields( $field_key, $request_data, $form_location ){
|
214 |
+
if ( isset( $request_data['wppb_create_new_site_checkbox'] ) && $request_data['wppb_create_new_site_checkbox'] == 'yes' ) {
|
215 |
+
if ( $field_key == 'wppb_blog_privacy' && ( ! isset( $request_data[$field_key] ) || ( isset( $request_data[$field_key] ) && ( trim( $request_data[$field_key] ) == '' ) ) ) ) {
|
216 |
+
return '<span class="wppb-form-error">' . wppb_required_field_error($field_key) . '</span>';
|
217 |
+
}
|
218 |
+
|
219 |
+
$wp_error = wpmu_validate_blog_signup($request_data['wppb_blog_url'], $request_data['wppb_blog_title']);
|
220 |
+
|
221 |
+
if ( $field_key == 'wppb_blog_url' && !empty($wp_error['errors']->errors['blogname'])){
|
222 |
+
return '<span class="wppb-form-error">' . $wp_error['errors']->errors['blogname'][0] . '</span>';
|
223 |
+
}
|
224 |
+
if ( $field_key == 'wppb_blog_title' && !empty($wp_error['errors']->errors['blog_title'])){
|
225 |
+
return '<span class="wppb-form-error">' . $wp_error['errors']->errors['blog_title'][0] . '</span>';
|
226 |
+
}
|
227 |
+
|
228 |
+
}
|
229 |
+
return '';
|
230 |
+
}
|
231 |
+
|
front-end/default-fields/default-fields.php
CHANGED
@@ -34,5 +34,8 @@ function wppb_include_default_fields_files() {
|
|
34 |
include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/headings/name.php' );
|
35 |
include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/headings/contact-info.php' );
|
36 |
include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/headings/about-yourself.php' );
|
|
|
|
|
|
|
37 |
}
|
38 |
wppb_include_default_fields_files();
|
34 |
include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/headings/name.php' );
|
35 |
include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/headings/contact-info.php' );
|
36 |
include_once( WPPB_PLUGIN_DIR.'/front-end/default-fields/headings/about-yourself.php' );
|
37 |
+
if ( wppb_can_users_signup_blog() ) {
|
38 |
+
include_once(WPPB_PLUGIN_DIR . '/front-end/default-fields/blog-details/blog-details.php');
|
39 |
+
}
|
40 |
}
|
41 |
wppb_include_default_fields_files();
|
front-end/recover.php
CHANGED
@@ -222,14 +222,12 @@ function wppb_front_end_password_recovery(){
|
|
222 |
$recoveruserMailMessage1 = sprintf( __('Someone requested that the password be reset for the following account: <b>%1$s</b><br/>If this was a mistake, just ignore this email and nothing will happen.<br/>To reset your password, visit the following link:%2$s', 'profile-builder'), $display_username_email, '<a href="'.esc_url( add_query_arg( array( 'loginName' => $requestedUserNicename, 'key' => $key ), wppb_curpageurl() ) ).'">'.esc_url( add_query_arg( array( 'loginName' => $requestedUserNicename, 'key' => $key ), wppb_curpageurl() ) ).'</a>');
|
223 |
$recoveruserMailMessage1 = apply_filters( 'wppb_recover_password_message_content_sent_to_user1', $recoveruserMailMessage1, $requestedUserID, $requestedUserLogin, $requestedUserEmail );
|
224 |
|
225 |
-
$recoveruserMailMessageTitle1 = sprintf(__('Password Reset from "%1$s"', 'profile-builder'), $blogname =
|
226 |
$recoveruserMailMessageTitle1 = apply_filters('wppb_recover_password_message_title_sent_to_user1', $recoveruserMailMessageTitle1, $requestedUserLogin);
|
227 |
|
228 |
-
//we add this filter to enable html encoding
|
229 |
-
add_filter('wp_mail_content_type',create_function('', 'return "text/html"; '));
|
230 |
//send mail to the user notifying him of the reset request
|
231 |
if (trim($recoveruserMailMessageTitle1) != ''){
|
232 |
-
$sent =
|
233 |
if ($sent === false){
|
234 |
$message = '<b>'. __( 'ERROR', 'profile-builder' ) .': </b>' . sprintf( __( 'There was an error while trying to send the activation link to %1$s!', 'profile-builder' ), $postedData );
|
235 |
$message = apply_filters( 'wppb_recover_password_sent_message_error_sending', $message );
|
@@ -281,21 +279,18 @@ function wppb_front_end_password_recovery(){
|
|
281 |
$recoveruserMailMessage2 = sprintf( __( 'You have successfully reset your password to: %1$s', 'profile-builder' ), $new_pass );
|
282 |
$recoveruserMailMessage2 = apply_filters( 'wppb_recover_password_message_content_sent_to_user2', $recoveruserMailMessage2, $display_username_email, $new_pass, $userID );
|
283 |
|
284 |
-
$recoveruserMailMessageTitle2 = sprintf( __('Password Successfully Reset for %1$s on "%2$s"', 'profile-builder' ), $display_username_email, $blogname =
|
285 |
$recoveruserMailMessageTitle2 = apply_filters( 'wppb_recover_password_message_title_sent_to_user2', $recoveruserMailMessageTitle2, $display_username_email );
|
286 |
|
287 |
-
//we add this filter to enable html encoding
|
288 |
-
add_filter( 'wp_mail_content_type',create_function( '', 'return "text/html"; ') );
|
289 |
-
|
290 |
//send mail to the user notifying him of the reset request
|
291 |
if ( trim( $recoveruserMailMessageTitle2 ) != '' )
|
292 |
-
|
293 |
|
294 |
//send email to admin
|
295 |
$recoveradminMailMessage = sprintf( __( '%1$s has requested a password change via the password reset feature.<br/>His/her new password is:%2$s', 'profile-builder' ), $display_username_email, $_POST['passw1'] );
|
296 |
$recoveradminMailMessage = apply_filters( 'wppb_recover_password_message_content_sent_to_admin', $recoveradminMailMessage, $display_username_email, $_POST['passw1'], $userID );
|
297 |
|
298 |
-
$recoveradminMailMessageTitle = sprintf( __( 'Password Successfully Reset for %1$s on "%2$s"', 'profile-builder' ), $display_username_email, $blogname =
|
299 |
$recoveradminMailMessageTitle = apply_filters( 'wppb_recover_password_message_title_sent_to_admin', $recoveradminMailMessageTitle, $display_username_email );
|
300 |
|
301 |
|
@@ -303,11 +298,9 @@ function wppb_front_end_password_recovery(){
|
|
303 |
$recoveradminMailMessageTitle = '';
|
304 |
$recoveradminMailMessageTitle = apply_filters( 'wppb_recover_password_message_title_sent_to_admin', $recoveradminMailMessageTitle, $display_username_email );
|
305 |
|
306 |
-
//we add this filter to enable html encoding
|
307 |
-
add_filter('wp_mail_content_type',create_function('', 'return "text/html"; '));
|
308 |
//send mail to the admin notifying him of of a user with a password reset request
|
309 |
if (trim($recoveradminMailMessageTitle) != '')
|
310 |
-
|
311 |
}
|
312 |
}
|
313 |
else{
|
222 |
$recoveruserMailMessage1 = sprintf( __('Someone requested that the password be reset for the following account: <b>%1$s</b><br/>If this was a mistake, just ignore this email and nothing will happen.<br/>To reset your password, visit the following link:%2$s', 'profile-builder'), $display_username_email, '<a href="'.esc_url( add_query_arg( array( 'loginName' => $requestedUserNicename, 'key' => $key ), wppb_curpageurl() ) ).'">'.esc_url( add_query_arg( array( 'loginName' => $requestedUserNicename, 'key' => $key ), wppb_curpageurl() ) ).'</a>');
|
223 |
$recoveruserMailMessage1 = apply_filters( 'wppb_recover_password_message_content_sent_to_user1', $recoveruserMailMessage1, $requestedUserID, $requestedUserLogin, $requestedUserEmail );
|
224 |
|
225 |
+
$recoveruserMailMessageTitle1 = sprintf(__('Password Reset from "%1$s"', 'profile-builder'), $blogname = get_option('blogname') );
|
226 |
$recoveruserMailMessageTitle1 = apply_filters('wppb_recover_password_message_title_sent_to_user1', $recoveruserMailMessageTitle1, $requestedUserLogin);
|
227 |
|
|
|
|
|
228 |
//send mail to the user notifying him of the reset request
|
229 |
if (trim($recoveruserMailMessageTitle1) != ''){
|
230 |
+
$sent = wppb_mail($requestedUserEmail, $recoveruserMailMessageTitle1, $recoveruserMailMessage1);
|
231 |
if ($sent === false){
|
232 |
$message = '<b>'. __( 'ERROR', 'profile-builder' ) .': </b>' . sprintf( __( 'There was an error while trying to send the activation link to %1$s!', 'profile-builder' ), $postedData );
|
233 |
$message = apply_filters( 'wppb_recover_password_sent_message_error_sending', $message );
|
279 |
$recoveruserMailMessage2 = sprintf( __( 'You have successfully reset your password to: %1$s', 'profile-builder' ), $new_pass );
|
280 |
$recoveruserMailMessage2 = apply_filters( 'wppb_recover_password_message_content_sent_to_user2', $recoveruserMailMessage2, $display_username_email, $new_pass, $userID );
|
281 |
|
282 |
+
$recoveruserMailMessageTitle2 = sprintf( __('Password Successfully Reset for %1$s on "%2$s"', 'profile-builder' ), $display_username_email, $blogname = get_option('blogname') );
|
283 |
$recoveruserMailMessageTitle2 = apply_filters( 'wppb_recover_password_message_title_sent_to_user2', $recoveruserMailMessageTitle2, $display_username_email );
|
284 |
|
|
|
|
|
|
|
285 |
//send mail to the user notifying him of the reset request
|
286 |
if ( trim( $recoveruserMailMessageTitle2 ) != '' )
|
287 |
+
wppb_mail( $user_info->user_email, $recoveruserMailMessageTitle2, $recoveruserMailMessage2 );
|
288 |
|
289 |
//send email to admin
|
290 |
$recoveradminMailMessage = sprintf( __( '%1$s has requested a password change via the password reset feature.<br/>His/her new password is:%2$s', 'profile-builder' ), $display_username_email, $_POST['passw1'] );
|
291 |
$recoveradminMailMessage = apply_filters( 'wppb_recover_password_message_content_sent_to_admin', $recoveradminMailMessage, $display_username_email, $_POST['passw1'], $userID );
|
292 |
|
293 |
+
$recoveradminMailMessageTitle = sprintf( __( 'Password Successfully Reset for %1$s on "%2$s"', 'profile-builder' ), $display_username_email, $blogname = get_option('blogname'), ENT_QUOTES );
|
294 |
$recoveradminMailMessageTitle = apply_filters( 'wppb_recover_password_message_title_sent_to_admin', $recoveradminMailMessageTitle, $display_username_email );
|
295 |
|
296 |
|
298 |
$recoveradminMailMessageTitle = '';
|
299 |
$recoveradminMailMessageTitle = apply_filters( 'wppb_recover_password_message_title_sent_to_admin', $recoveradminMailMessageTitle, $display_username_email );
|
300 |
|
|
|
|
|
301 |
//send mail to the admin notifying him of of a user with a password reset request
|
302 |
if (trim($recoveradminMailMessageTitle) != '')
|
303 |
+
wppb_mail(get_option('admin_email'), $recoveradminMailMessageTitle, $recoveradminMailMessage);
|
304 |
}
|
305 |
}
|
306 |
else{
|
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.5.
|
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.5.
|
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.5.5
|
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.5.5' );
|
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 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
|
5 |
|
6 |
Requires at least: 3.1
|
7 |
-
Tested up to: 4.7
|
8 |
-
Stable tag: 2.5.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -150,9 +150,15 @@ 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.5.4 =
|
154 |
-
* CSS changes for the Twenty Seventeen
|
155 |
-
* Fixed a notice caused sometimes by general settings
|
156 |
* Small changes to readme file
|
157 |
|
158 |
= 2.5.3 =
|
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
|
5 |
|
6 |
Requires at least: 3.1
|
7 |
+
Tested up to: 4.7.1
|
8 |
+
Stable tag: 2.5.5
|
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.5.5 =
|
154 |
+
* Added Blog Details field type
|
155 |
+
* Email From Name and Subject should now display proper special characters in all cases
|
156 |
+
* Fix css issue with notice image on forms taking an inherit width instead of auto
|
157 |
+
* Fixed an issue with automatic login with redirect on Firefox
|
158 |
+
|
159 |
= 2.5.4 =
|
160 |
+
* CSS changes for the Twenty Seventeen theme
|
161 |
+
* Fixed a notice caused sometimes by general settings option not setting properly
|
162 |
* Small changes to readme file
|
163 |
|
164 |
= 2.5.3 =
|