User Registration – Custom Registration Form, Login Form And User Profile For WordPress - Version 1.7.3

Version Description

  • 04/10/2019 =
  • Fix - Form ID being empty.
  • Fix - Form ID check.
  • Fix - Field key not found in edit profile details.
Download this release

Release Info

Developer wpeverest
Plugin Icon 128x128 User Registration – Custom Registration Form, Login Form And User Profile For WordPress
Version 1.7.3
Comparing to
See all releases

Code changes from version 1.7.2 to 1.7.3

includes/admin/class-ur-admin-profile.php CHANGED
@@ -403,6 +403,7 @@ if ( ! class_exists( 'UR_Admin_Profile', false ) ) :
403
  * @param int $form_id
404
  */
405
  protected function get_form_fields( $all_meta_value, $form_id ) {
 
406
  $post_content_array = UR()->form->get_form(
407
  $form_id,
408
  array(
403
  * @param int $form_id
404
  */
405
  protected function get_form_fields( $all_meta_value, $form_id ) {
406
+ $form_id = ( $form_id ) ? $form_id : 0;
407
  $post_content_array = UR()->form->get_form(
408
  $form_id,
409
  array(
includes/class-ur-form-handler.php CHANGED
@@ -527,7 +527,7 @@ class UR_Form_Handler {
527
  $forms = array();
528
  $args = apply_filters( 'user_registration_get_form_args', $args );
529
 
530
- if ( ! empty( $id ) ) {
531
  $the_post = get_post( absint( $id ) );
532
 
533
  if ( $the_post && 'user_registration' === $the_post->post_type ) {
527
  $forms = array();
528
  $args = apply_filters( 'user_registration_get_form_args', $args );
529
 
530
+ if ( is_numeric( $id ) ) {
531
  $the_post = get_post( absint( $id ) );
532
 
533
  if ( $the_post && 'user_registration' === $the_post->post_type ) {
includes/class-ur-preview.php CHANGED
@@ -105,7 +105,7 @@ class UR_Preview {
105
  public static function form_preview_title( $title ) {
106
  $form_id = absint( $_GET['form_id'] ); // @codingStandardsIgnoreLine
107
 
108
- if ( in_the_loop() ) {
109
  $form_data = UR()->form->get_form( $form_id );
110
 
111
  if ( ! empty( $form_data ) ) {
105
  public static function form_preview_title( $title ) {
106
  $form_id = absint( $_GET['form_id'] ); // @codingStandardsIgnoreLine
107
 
108
+ if ( $form_id && in_the_loop() ) {
109
  $form_data = UR()->form->get_form( $form_id );
110
 
111
  if ( ! empty( $form_data ) ) {
includes/class-ur-shortcodes.php CHANGED
@@ -161,7 +161,7 @@ class UR_Shortcodes {
161
  * @since 1.0.1 Recaptcha only
162
  */
163
  private static function render_form( $form_id ) {
164
- $form_data_array = UR()->form->get_form( $form_id, array( 'content_only' => true ) );
165
  $form_row_ids = '';
166
 
167
  if ( ! empty( $form_data_array ) ) {
161
  * @since 1.0.1 Recaptcha only
162
  */
163
  private static function render_form( $form_id ) {
164
+ $form_data_array = ( $form_id ) ? UR()->form->get_form( $form_id, array( 'content_only' => true ) ) : array();
165
  $form_row_ids = '';
166
 
167
  if ( ! empty( $form_data_array ) ) {
includes/frontend/class-ur-frontend-form-handler.php CHANGED
@@ -47,7 +47,7 @@ class UR_Frontend_Form_Handler {
47
  public static function handle_form( $form_data, $form_id ) {
48
 
49
  self::$form_id = $form_id;
50
- $post_content_array = UR()->form->get_form( $form_id, array( 'content_only' => true ) );
51
 
52
  if ( gettype( $form_data ) != 'array' && gettype( $form_data ) != 'object' ) {
53
  $form_data = array();
47
  public static function handle_form( $form_data, $form_id ) {
48
 
49
  self::$form_id = $form_id;
50
+ $post_content_array = ( $form_id ) ? UR()->form->get_form( $form_id, array( 'content_only' => true ) ) : array();
51
 
52
  if ( gettype( $form_data ) != 'array' && gettype( $form_data ) != 'object' ) {
53
  $form_data = array();
includes/functions-ur-account.php CHANGED
@@ -112,6 +112,7 @@ function ur_get_account_menu_items() {
112
 
113
  $user_id = get_current_user_id();
114
  $form_id = get_user_meta( $user_id, 'ur_form_id', true );
 
115
 
116
  $profile = user_registration_form_data( $user_id, $form_id );
117
 
112
 
113
  $user_id = get_current_user_id();
114
  $form_id = get_user_meta( $user_id, 'ur_form_id', true );
115
+ $form_id = ( $form_id ) ? $form_id : 0;
116
 
117
  $profile = user_registration_form_data( $user_id, $form_id );
118
 
includes/functions-ur-core.php CHANGED
@@ -1360,7 +1360,7 @@ function ur_get_meta_key_label( $form_id ) {
1360
 
1361
  $key_label = array();
1362
 
1363
- $post_content_array = UR()->form->get_form( $form_id, array( 'content_only' => true ) );
1364
 
1365
  foreach ( $post_content_array as $post_content_row ) {
1366
  foreach ( $post_content_row as $post_content_grid ) {
@@ -1447,7 +1447,7 @@ function ur_is_json( $str ) {
1447
  */
1448
  function ur_has_date_field( $form_id ) {
1449
 
1450
- $post_content_array = UR()->form->get_form( $form_id, array( 'content_only' => true ) );
1451
 
1452
  if ( ! empty( $post_content_array ) ) {
1453
  foreach ( $post_content_array as $post_content_row ) {
@@ -1482,7 +1482,7 @@ function ur_get_shortcode_attr( $content ) {
1482
 
1483
  foreach ( $matches[0] as $key => $value ) {
1484
 
1485
- // $matches[3] return the shortcode attribute as string.
1486
  // replace space with '&' for parse_str() function.
1487
  $get = str_replace( ' ', '&', $matches[3][ $key ] );
1488
  parse_str( $get, $output );
1360
 
1361
  $key_label = array();
1362
 
1363
+ $post_content_array = ( $form_id ) ? UR()->form->get_form( $form_id, array( 'content_only' => true ) ) : array();
1364
 
1365
  foreach ( $post_content_array as $post_content_row ) {
1366
  foreach ( $post_content_row as $post_content_grid ) {
1447
  */
1448
  function ur_has_date_field( $form_id ) {
1449
 
1450
+ $post_content_array = ( $form_id ) ? UR()->form->get_form( $form_id, array( 'content_only' => true ) ) : array();
1451
 
1452
  if ( ! empty( $post_content_array ) ) {
1453
  foreach ( $post_content_array as $post_content_row ) {
1482
 
1483
  foreach ( $matches[0] as $key => $value ) {
1484
 
1485
+ // $matches[ 3 ] return the shortcode attribute as string.
1486
  // replace space with '&' for parse_str() function.
1487
  $get = str_replace( ' ', '&', $matches[3][ $key ] );
1488
  parse_str( $get, $output );
includes/functions-ur-template.php CHANGED
@@ -442,7 +442,7 @@ if ( ! function_exists( 'user_registration_form_data' ) ) {
442
  $all_meta_value = get_user_meta( $user_id );
443
  $fields = array();
444
 
445
- $post_content_array = UR()->form->get_form( $form_id, array( 'content_only' => true ) );
446
 
447
  $all_meta_value_keys = array();
448
  if ( gettype( $all_meta_value ) === 'array' ) {
442
  $all_meta_value = get_user_meta( $user_id );
443
  $fields = array();
444
 
445
+ $post_content_array = ( $form_id ) ? UR()->form->get_form( $form_id, array( 'content_only' => true ) ) : array();
446
 
447
  $all_meta_value_keys = array();
448
  if ( gettype( $all_meta_value ) === 'array' ) {
includes/shortcodes/class-ur-shortcode-my-account.php CHANGED
@@ -159,7 +159,7 @@ class UR_Shortcode_My_Account {
159
  $user_data = get_userdata( $user_id );
160
  $user_data = $user_data->data;
161
 
162
- $form_data_array = UR()->form->get_form( $form_id, array( 'content_only' => true ) );
163
 
164
  if ( ! empty( $form_data_array ) ) {
165
 
159
  $user_data = get_userdata( $user_id );
160
  $user_data = $user_data->data;
161
 
162
+ $form_data_array = ( $form_id ) ? UR()->form->get_form( $form_id, array( 'content_only' => true ) ) : array();
163
 
164
  if ( ! empty( $form_data_array ) ) {
165
 
languages/user-registration.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the User Registration package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: User Registration 1.7.2\n"
6
  "Report-Msgid-Bugs-To: wpeverest@gmail.com\n"
7
- "POT-Creation-Date: 2019-10-02 11:14:45+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -3641,7 +3641,7 @@ msgid "Confirm new password"
3641
  msgstr ""
3642
 
3643
  #: templates/myaccount/form-edit-password.php:61
3644
- #: templates/myaccount/form-edit-profile.php:127
3645
  msgid "Save changes"
3646
  msgstr ""
3647
 
2
  # This file is distributed under the same license as the User Registration package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: User Registration 1.7.3\n"
6
  "Report-Msgid-Bugs-To: wpeverest@gmail.com\n"
7
+ "POT-Creation-Date: 2019-10-04 05:41:12+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
3641
  msgstr ""
3642
 
3643
  #: templates/myaccount/form-edit-password.php:61
3644
+ #: templates/myaccount/form-edit-profile.php:126
3645
  msgid "Save changes"
3646
  msgstr ""
3647
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: user registration, registration, user profile, registration form, login fo
4
  Requires at least: 4.0
5
  Requires PHP: 5.3
6
  Tested up to: 5.2
7
- Stable tag: 1.7.2
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -128,6 +128,11 @@ All the users registered via the registration forms and their data can be access
128
 
129
  == Changelog ==
130
 
 
 
 
 
 
131
  = 1.7.2 - 02/10/2019 =
132
  * Refactor - Has date field function.
133
  * Refactor - Check username function.
4
  Requires at least: 4.0
5
  Requires PHP: 5.3
6
  Tested up to: 5.2
7
+ Stable tag: 1.7.3
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
128
 
129
  == Changelog ==
130
 
131
+ = 1.7.3 - 04/10/2019 =
132
+ * Fix - Form ID being empty.
133
+ * Fix - Form ID check.
134
+ * Fix - Field key not found in edit profile details.
135
+
136
  = 1.7.2 - 02/10/2019 =
137
  * Refactor - Has date field function.
138
  * Refactor - Check username function.
templates/myaccount/form-edit-profile.php CHANGED
@@ -79,17 +79,16 @@ do_action( 'user_registration_before_edit_profile_form' ); ?>
79
  }
80
 
81
  foreach ( $grid_data as $grid_data_key => $single_item ) {
82
- if ( $found_field ) {
83
- $key = 'user_registration_' . $single_item->general_setting->field_name;
 
84
  ?>
85
  <div class="ur-field-item field-<?php echo $single_item->field_key; ?>">
86
  <?php
87
- $field = $profile[ $key ];
88
  $readonly_fields = ur_readonly_profile_details_fields();
89
  if ( array_key_exists( $field['field_key'], $readonly_fields ) ) {
90
  $field['custom_attributes'] = array(
91
  'readonly' => 'readonly',
92
- // 'disabled' => 'disabled',
93
  );
94
  if ( isset( $readonly_fields[ $field['field_key'] ] ['value'] ) ) {
95
  $field['value'] = $readonly_fields[ $field['field_key'] ] ['value'];
79
  }
80
 
81
  foreach ( $grid_data as $grid_data_key => $single_item ) {
82
+ $key = 'user_registration_' . $single_item->general_setting->field_name;
83
+ if ( isset( $profile[ $key ] ) ) {
84
+ $field = $profile[ $key ];
85
  ?>
86
  <div class="ur-field-item field-<?php echo $single_item->field_key; ?>">
87
  <?php
 
88
  $readonly_fields = ur_readonly_profile_details_fields();
89
  if ( array_key_exists( $field['field_key'], $readonly_fields ) ) {
90
  $field['custom_attributes'] = array(
91
  'readonly' => 'readonly',
 
92
  );
93
  if ( isset( $readonly_fields[ $field['field_key'] ] ['value'] ) ) {
94
  $field['value'] = $readonly_fields[ $field['field_key'] ] ['value'];
user-registration.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: User Registration
4
  * Plugin URI: https://wpeverest.com/plugins/user-registration
5
  * Description: Drag and Drop user registration form and login form builder.
6
- * Version: 1.7.2
7
  * Author: WPEverest
8
  * Author URI: https://wpeverest.com
9
  * Text Domain: user-registration
@@ -31,7 +31,7 @@ if ( ! class_exists( 'UserRegistration' ) ) :
31
  *
32
  * @var string
33
  */
34
- public $version = '1.7.2';
35
 
36
  /**
37
  * Session instance.
3
  * Plugin Name: User Registration
4
  * Plugin URI: https://wpeverest.com/plugins/user-registration
5
  * Description: Drag and Drop user registration form and login form builder.
6
+ * Version: 1.7.3
7
  * Author: WPEverest
8
  * Author URI: https://wpeverest.com
9
  * Text Domain: user-registration
31
  *
32
  * @var string
33
  */
34
+ public $version = '1.7.3';
35
 
36
  /**
37
  * Session instance.