From f19be35d28f9c88154dff84b5bc784f845e1099f Mon Sep 17 00:00:00 2001 From: nikitozzzzzzz Date: Tue, 1 May 2018 14:13:29 +0300 Subject: [PATCH 1/7] - profile menu items duplicates; --- assets/css/um-profile.css | 3 ++- includes/core/class-enqueue.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/assets/css/um-profile.css b/assets/css/um-profile.css index 1586807e..0dd021d7 100644 --- a/assets/css/um-profile.css +++ b/assets/css/um-profile.css @@ -547,8 +547,9 @@ font-weight: normal; cursor: default !important; } +/* @media (min-width: 880px) { .um-profile-nav-item .um-tip-n { display: none !important; } -} \ No newline at end of file +}*/ diff --git a/includes/core/class-enqueue.php b/includes/core/class-enqueue.php index 1fe726e6..4365b686 100644 --- a/includes/core/class-enqueue.php +++ b/includes/core/class-enqueue.php @@ -463,7 +463,7 @@ if ( ! class_exists( 'um\core\Enqueue' ) ) { wp_register_script('um_responsive', um_url . 'assets/js/um-responsive' . $this->suffix . '.js' ); wp_enqueue_script('um_responsive'); - wp_register_style('um_responsive', um_url . 'assets/css/um-responsive.css' ); + wp_register_style('um_responsive', um_url . 'assets/css/um-responsive.css', array( 'um_profile' ) ); wp_enqueue_style('um_responsive'); } From 0a8658ae8bf5a7b0a81b914beddd22712a74c409 Mon Sep 17 00:00:00 2001 From: nikitozzzzzzz Date: Wed, 2 May 2018 12:16:46 +0300 Subject: [PATCH 2/7] - changed readme; --- readme.txt | 8 +++++++- ultimate-member.php | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/readme.txt b/readme.txt index 59d6914e..f691ded3 100644 --- a/readme.txt +++ b/readme.txt @@ -6,7 +6,7 @@ Donate link: Tags: community, member, membership, user-profile, user-registration Requires at least: 4.1 Tested up to: 4.9 -Stable tag: 2.0.12 +Stable tag: 2.0.13 License: GNU Version 2 or Any Later Version License URI: http://www.gnu.org/licenses/gpl-3.0.txt @@ -131,6 +131,12 @@ The plugin works with popular caching plugins by automatically excluding Ultimat = Important: UM2.0+ is a significant update to the code base from 1.3.88. Please make sure you take a full-site backup with restore point before updating the plugin = += 2.0.13: May 2, 2018 = + +* Bugfixes: + - Fixed and optimized user avatars + - Fixed Profile Menu on some installs + = 2.0.12: April 30, 2018 = * Bugfixes: diff --git a/ultimate-member.php b/ultimate-member.php index a083c671..bd87426e 100644 --- a/ultimate-member.php +++ b/ultimate-member.php @@ -3,7 +3,7 @@ Plugin Name: Ultimate Member Plugin URI: http://ultimatemember.com/ Description: The easiest way to create powerful online communities and beautiful user profiles with WordPress -Version: 2.0.12 +Version: 2.0.13 Author: Ultimate Member Author URI: http://ultimatemember.com/ Text Domain: ultimate-member From 3b871f82cda1ecfe328976fd4b01a5a804e9c719 Mon Sep 17 00:00:00 2001 From: Denis Baranov Date: Wed, 2 May 2018 14:25:48 +0300 Subject: [PATCH 3/7] add filter for fields ids --- includes/core/class-fields.php | 91 +++++++++++++++++++++++----------- 1 file changed, 62 insertions(+), 29 deletions(-) diff --git a/includes/core/class-fields.php b/includes/core/class-fields.php index 00ad82c6..0e40a431 100644 --- a/includes/core/class-fields.php +++ b/includes/core/class-fields.php @@ -40,16 +40,16 @@ if ( ! class_exists( 'um\core\Fields' ) ) { function checkbox( $id, $title ) { ?> -
-
- -
-
+
+
+ +
+
$arr ) { if ( um_profile( $k ) ) { ?> - + */ $type = apply_filters( "um_hook_for_field_{$type}", $type ); + switch ( $type ) { + case 'textarea': + case 'multiselect': + $field_id = $field_name = $key; + $field_value = $this->field_value( $key, $default, $data ); + break; + + case 'select': + case 'radio': + $form_key = str_replace( 'role_select', 'role', $key ); + $field_id = $form_key; + break; + } + + /** + * UM hook + * + * @type filter + * @title um_completeness_field_id + * @description use for change core id not allowed duplicate + * @input_vars + * [{"var":"$field_id","type":"string","desc":"Field id"}, + * {"var":"$data","type":"array","desc":"Field Data"}] + * {"var":"$args","type":"array","desc":"Optional field arguments"}] + * @change_log + * ["Since: 2.0.12"] + * @usage add_filter( 'um_edit_field_{$mode}_{$type}', 'function_name', 10, 2 ); + * @usage add_filter( 'um_completeness_field_id', 'function_name', 10, 3 ); + * @example + * + */ + $field_id = apply_filters( 'um_completeness_field_id', $field_id, $data, $args ); /* Begin by field type */ switch ( $type ) { @@ -1721,8 +1760,8 @@ if ( ! class_exists( 'um\core\Fields' ) ) { '; - if (!empty( $disabled )) { - $output .= $this->disabled_hidden_field( $field_name, $field_value ); + if (!empty( $disabled )) { + $output .= $this->disabled_hidden_field( $field_name, $field_value ); } if ($this->is_error( $key )) { @@ -2032,8 +2071,6 @@ if ( ! class_exists( 'um\core\Fields' ) ) { } $output .= '
'; - $field_name = $key; - $field_value = $this->field_value( $key, $default, $data ); if (isset( $data['html'] ) && $data['html'] != 0 && $key != "description") { @@ -2084,7 +2121,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) { // add the contents of the buffer to the output variable $output .= ob_get_clean(); - } else $output .= ''; + } else $output .= ''; $output .= '
'; @@ -2110,8 +2147,8 @@ if ( ! class_exists( 'um\core\Fields' ) ) { $output .= '
'; +// $output .= '
'; $output .= '
'; - $output .= '
'; $output .= ''; @@ -2313,8 +2350,6 @@ if ( ! class_exists( 'um\core\Fields' ) ) { /* Select dropdown */ case 'select': - $form_key = str_replace( 'role_select', 'role', $key ); - $output .= '
'; @@ -2434,10 +2469,10 @@ if ( ! class_exists( 'um\core\Fields' ) ) { } if( ! empty( $placeholder ) ) { - $placeholder = strip_tags( $placeholder ); - } + $placeholder = strip_tags( $placeholder ); + } - $output .= ''; /** * UM hook @@ -2631,7 +2666,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) { $output .= '
'; } - $output .= ''; if ( isset( $options ) && $options == 'builtin' ) { @@ -2768,8 +2803,6 @@ if ( ! class_exists( 'um\core\Fields' ) ) { /* Radio */ case 'radio': - $form_key = str_replace( 'role_radio', 'role', $key ); - if ( isset( $options ) ) { /** * UM hook From b23f76291980b19ca90d4d5772f84520aaee44a4 Mon Sep 17 00:00:00 2001 From: nikitozzzzzzz Date: Wed, 2 May 2018 15:46:09 +0300 Subject: [PATCH 4/7] - fixed Profile menu on some installs; - typo fixed; --- assets/css/um-responsive.css | 8 ++++++++ includes/admin/templates/form/login_customize.php | 2 +- includes/admin/templates/form/profile_customize.php | 2 +- includes/admin/templates/form/register_customize.php | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/assets/css/um-responsive.css b/assets/css/um-responsive.css index c125e09b..43558ccd 100644 --- a/assets/css/um-responsive.css +++ b/assets/css/um-responsive.css @@ -6,6 +6,14 @@ display: none; } +.um-profile-nav-item a.uimob340-show, +.um-profile-nav-item a.uimob500-show, +.um-profile-nav-item a.uimob800-show, +.um-profile-nav-item a.uimob960-show +{ + display: none; +} + div.uimob340 .uimob340-show, div.uimob500 .uimob500-show, div.uimob800 .uimob800-show, diff --git a/includes/admin/templates/form/login_customize.php b/includes/admin/templates/form/login_customize.php index a4ed6046..aafe97ab 100644 --- a/includes/admin/templates/form/login_customize.php +++ b/includes/admin/templates/form/login_customize.php @@ -65,7 +65,7 @@ array( 'id' => '_um_login_secondary_btn_word', 'type' => 'text', - 'label' => __( 'Primary Button Text', 'ultimate-member' ), + 'label' => __( 'Secondary Button Text', 'ultimate-member' ), 'tooltip' => __( 'Customize the button text', 'ultimate-member' ), 'value' => UM()->query()->get_meta_value( '_um_login_secondary_btn_word', null, UM()->options()->get( 'login_secondary_btn_word' ) ), 'conditional' => array( '_um_login_secondary_btn', '=', 1 ) diff --git a/includes/admin/templates/form/profile_customize.php b/includes/admin/templates/form/profile_customize.php index 06964965..6104eae0 100644 --- a/includes/admin/templates/form/profile_customize.php +++ b/includes/admin/templates/form/profile_customize.php @@ -90,7 +90,7 @@ array( 'id' => '_um_profile_secondary_btn_word', 'type' => 'text', - 'label' => __( 'Primary Button Text', 'ultimate-member' ), + 'label' => __( 'Secondary Button Text', 'ultimate-member' ), 'tooltip' => __( 'Customize the button text', 'ultimate-member' ), 'value' => UM()->query()->get_meta_value( '_um_profile_secondary_btn_word', null, UM()->options()->get( 'profile_secondary_btn_word' ) ), 'conditional' => array( '_um_profile_secondary_btn', '=', 1 ) diff --git a/includes/admin/templates/form/register_customize.php b/includes/admin/templates/form/register_customize.php index 4ac2e907..3d94efd2 100644 --- a/includes/admin/templates/form/register_customize.php +++ b/includes/admin/templates/form/register_customize.php @@ -80,7 +80,7 @@ array( 'id' => '_um_register_secondary_btn_word', 'type' => 'text', - 'label' => __( 'Primary Button Text', 'ultimate-member' ), + 'label' => __( 'Secondary Button Text', 'ultimate-member' ), 'tooltip' => __( 'Customize the button text', 'ultimate-member' ), 'value' => UM()->query()->get_meta_value( '_um_register_secondary_btn_word', null, UM()->options()->get( 'register_secondary_btn_word' ) ), 'conditional' => array( '_um_register_secondary_btn', '=', 1 ) From 9bf2fc308c27feca319aaee443d777fc5c61ab9f Mon Sep 17 00:00:00 2001 From: nikitozzzzzzz Date: Wed, 2 May 2018 15:58:57 +0300 Subject: [PATCH 5/7] - small review; --- includes/core/class-fields.php | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/includes/core/class-fields.php b/includes/core/class-fields.php index 0e40a431..e01ba943 100644 --- a/includes/core/class-fields.php +++ b/includes/core/class-fields.php @@ -40,16 +40,15 @@ if ( ! class_exists( 'um\core\Fields' ) ) { function checkbox( $id, $title ) { ?> -
-
- -
-
+
+
+ +
+
$arr ) { if ( um_profile( $k ) ) { ?> - + Date: Wed, 2 May 2018 16:26:38 +0300 Subject: [PATCH 6/7] - readme update; - small warning fix; --- includes/core/class-fields.php | 15 +++++++++------ readme.txt | 1 + 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/includes/core/class-fields.php b/includes/core/class-fields.php index e01ba943..9cab1a87 100644 --- a/includes/core/class-fields.php +++ b/includes/core/class-fields.php @@ -1675,6 +1675,9 @@ if ( ! class_exists( 'um\core\Fields' ) ) { $form_key = str_replace( 'role_select', 'role', $key ); $field_id = $form_key; break; + default: + $field_id = ''; + break; } /** @@ -2119,16 +2122,17 @@ if ( ! class_exists( 'um\core\Fields' ) ) { // add the contents of the buffer to the output variable $output .= ob_get_clean(); - } else $output .= ''; + } else { + $output .= ''; + } - $output .= ' -
'; + $output .= ''; - if (!empty( $disabled )) { + if ( ! empty( $disabled ) ) { $output .= $this->disabled_hidden_field( $field_name, $field_value ); } - if ($this->is_error( $key )) { + if ( $this->is_error( $key ) ) { $output .= $this->field_error( $this->show_error( $key ) ); } @@ -2145,7 +2149,6 @@ if ( ! class_exists( 'um\core\Fields' ) ) { $output .= '
'; -// $output .= '
'; $output .= '
'; $output .= '
'; diff --git a/readme.txt b/readme.txt index f691ded3..111b1fba 100644 --- a/readme.txt +++ b/readme.txt @@ -136,6 +136,7 @@ The plugin works with popular caching plugins by automatically excluding Ultimat * Bugfixes: - Fixed and optimized user avatars - Fixed Profile Menu on some installs + - Fixed fields IDs duplicates = 2.0.12: April 30, 2018 = From 0b21ba41398cf790ec86296a77a45703c9d58ffa Mon Sep 17 00:00:00 2001 From: nikitozzzzzzz Date: Wed, 2 May 2018 16:55:33 +0300 Subject: [PATCH 7/7] - update readme; --- assets/css/um-profile.css | 9 +-------- readme.txt | 1 + 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/assets/css/um-profile.css b/assets/css/um-profile.css index 0dd021d7..00a07b6a 100644 --- a/assets/css/um-profile.css +++ b/assets/css/um-profile.css @@ -545,11 +545,4 @@ font-weight: normal; .um-profile.um-viewing .um-field-checkbox, .um-profile.um-viewing .um-field-radio{ cursor: default !important; -} - -/* -@media (min-width: 880px) { - .um-profile-nav-item .um-tip-n { - display: none !important; - } -}*/ +} \ No newline at end of file diff --git a/readme.txt b/readme.txt index 111b1fba..847b4fee 100644 --- a/readme.txt +++ b/readme.txt @@ -137,6 +137,7 @@ The plugin works with popular caching plugins by automatically excluding Ultimat - Fixed and optimized user avatars - Fixed Profile Menu on some installs - Fixed fields IDs duplicates + - Fixed cache users count = 2.0.12: April 30, 2018 =