From ec477ba5f02aec8200cec25efc70da06a6f27084 Mon Sep 17 00:00:00 2001 From: Mykyta Synelnikov Date: Thu, 14 Dec 2023 12:09:49 +0200 Subject: [PATCH 01/33] - changed texts; --- includes/admin/core/class-admin-metabox.php | 4 ++-- includes/admin/templates/access/restrict_content.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/admin/core/class-admin-metabox.php b/includes/admin/core/class-admin-metabox.php index 8605036b..603426b8 100644 --- a/includes/admin/core/class-admin-metabox.php +++ b/includes/admin/core/class-admin-metabox.php @@ -466,7 +466,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) { array( 'id' => '_um_access_hide_from_queries', 'type' => 'checkbox', - 'label' => UM()->options()->get( 'disable_restriction_pre_queries' ) ? __( 'Hide from queries', 'ultimate-member' ) : __( 'Would you like to display 404 error on the term\'s archive page and terms\' posts single pages when users haven\'t access?', 'ultimate-member' ), + 'label' => UM()->options()->get( 'disable_restriction_pre_queries' ) ? __( 'Hide from queries', 'ultimate-member' ) : __( 'Would you like to display a 404 page for users who do not have access to this term on the term\'s archive page and terms\' posts single pages?', 'ultimate-member' ), 'description' => UM()->options()->get( 'disable_restriction_pre_queries' ) ? __( 'Exclude only from WP queries results', 'ultimate-member' ) : __( 'Recommended to be enabled. Restricted term\'s archive page and all terms\' posts will be hidden by exclusion from WP Query. The safest and most effective method that hides post and its comments from all requests, RSS feeds, etc. on your site', 'ultimate-member' ), 'value' => 1, 'conditional' => array( '_um_accessible', '!=', '0' ), @@ -618,7 +618,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) { array( 'id' => '_um_access_hide_from_queries', 'type' => 'checkbox', - 'label' => UM()->options()->get( 'disable_restriction_pre_queries' ) ? __( 'Hide from queries', 'ultimate-member' ) : __( 'Would you like to display 404 error on the term\'s archive page and terms\' posts single pages when users haven\'t access?', 'ultimate-member' ), + 'label' => UM()->options()->get( 'disable_restriction_pre_queries' ) ? __( 'Hide from queries', 'ultimate-member' ) : __( 'Would you like to display a 404 page for users who do not have access to this term on the term\'s archive page and terms\' posts single pages?', 'ultimate-member' ), 'description' => UM()->options()->get( 'disable_restriction_pre_queries' ) ? __( 'Exclude only from WP queries results', 'ultimate-member' ) : __( 'Recommended to be enabled. Restricted term\'s archive page and all terms\' posts will be hidden by exclusion from WP Query. The safest and most effective method that hides post and its comments from all requests, RSS feeds, etc. on your site', 'ultimate-member' ), 'value' => ! empty( $data['_um_access_hide_from_queries'] ) ? $data['_um_access_hide_from_queries'] : '', 'conditional' => array( '_um_accessible', '!=', '0' ), diff --git a/includes/admin/templates/access/restrict_content.php b/includes/admin/templates/access/restrict_content.php index 732847c1..8226afb6 100644 --- a/includes/admin/templates/access/restrict_content.php +++ b/includes/admin/templates/access/restrict_content.php @@ -81,7 +81,7 @@ if ( ! defined( 'ABSPATH' ) ) { array( 'id' => '_um_access_hide_from_queries', 'type' => 'checkbox', - 'label' => UM()->options()->get( 'disable_restriction_pre_queries' ) ? __( 'Hide from queries', 'ultimate-member' ) : __( 'Would you like to display 404 page when users haven\'t access?', 'ultimate-member' ), + 'label' => UM()->options()->get( 'disable_restriction_pre_queries' ) ? __( 'Hide from queries', 'ultimate-member' ) : __( 'Would you like to display a 404 page for users who do not have access to this page?', 'ultimate-member' ), 'tooltip' => UM()->options()->get( 'disable_restriction_pre_queries' ) ? __( 'Exclude only from WP queries results', 'ultimate-member' ) : __( 'Recommended to be enabled. Restricted post will be hidden by exclusion from WP Query. The safest and most effective method that hides post and its comments from all requests, RSS feeds, etc. on your site', 'ultimate-member' ), 'value' => ! empty( $data['_um_access_hide_from_queries'] ) ? $data['_um_access_hide_from_queries'] : '', 'conditional' => array( '_um_accessible', '!=', '0' ), From 352171747ab463bcf7d8a128b3bc0e6013d172f4 Mon Sep 17 00:00:00 2001 From: Mykyta Synelnikov Date: Thu, 21 Dec 2023 10:58:51 +0200 Subject: [PATCH 02/33] - changed version --- readme.txt | 5 +++++ ultimate-member.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 739c7210..1ea2ff79 100644 --- a/readme.txt +++ b/readme.txt @@ -166,6 +166,11 @@ No specific extensions are needed. But we highly recommended keep active these P IMPORTANT: PLEASE UPDATE THE PLUGIN TO AT LEAST VERSION 2.6.7 IMMEDIATELY. VERSION 2.6.7 PATCHES SECURITY PRIVILEGE ESCALATION VULNERABILITY. PLEASE SEE [THIS ARTICLE](https://docs.ultimatemember.com/article/1866-security-incident-update-and-recommended-actions) FOR MORE INFORMATION += 2.8.2: January xx, 2024 = + + + + = 2.8.1: December 20, 2023 = * Enhancements: diff --git a/ultimate-member.php b/ultimate-member.php index 713f4818..5d1faa76 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.8.1 + * Version: 2.8.2-alpha * Author: Ultimate Member * Author URI: http://ultimatemember.com/ * Text Domain: ultimate-member From d9d803a235092ffb099a26e69cc4391627cb754d Mon Sep 17 00:00:00 2001 From: yuriinalivaiko Date: Thu, 21 Dec 2023 13:03:39 +0200 Subject: [PATCH 03/33] - fixed text-align property for rtl lenguages --- assets/css/um.rtl.css | 6 +++++- assets/css/um.rtl.min.css | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/assets/css/um.rtl.css b/assets/css/um.rtl.css index cc6febb3..e5bd1f25 100644 --- a/assets/css/um.rtl.css +++ b/assets/css/um.rtl.css @@ -1,8 +1,12 @@ -.um { +.rtl .um { direction: rtl !important; text-align: right; } +.rtl .um:not(.um-admin) { + text-align: right; +} + .um-profile-photo { float: right; margin: 0 30px 0 0; diff --git a/assets/css/um.rtl.min.css b/assets/css/um.rtl.min.css index 608118c7..a1a24de2 100644 --- a/assets/css/um.rtl.min.css +++ b/assets/css/um.rtl.min.css @@ -1 +1 @@ -.um{direction:rtl!important;text-align:right}.um-profile-photo{float:right;margin:0 30px 0 0}.um-profile-photo a.um-profile-photo-img{float:right;left:auto}.um-cover+.um-header .um-profile-photo a.um-profile-photo-img{right:0}div.uimob500 .um-profile-photo a.um-profile-photo-img{right:auto}.um-profile-edit{right:auto;left:0;margin-left:10px;margin-right:0}div.uimob800 .um-header .um-profile-meta,div.uimob960 .um-header .um-profile-meta{padding-left:0!important;padding-right:200px!important}.um-name{float:right;margin-right:0}.um-profile-nav-item a{float:right;padding:6px 28px 6px 10px}.um-profile-nav-item i{left:auto;right:6px}.um-profile-nav-item a{float:right}.um-field-checkbox-state,.um-field-radio-state{right:1px;left:auto}.um-field-checkbox-option,.um-field-radio-option{margin:0 36px 0 0}.um-field-half{float:right}.um-field-half.right{float:left}.um-left{float:right}.um-right{float:left}.um-account-main,.um-account-side{float:right}.um-account-main div.um-account-heading i{margin-right:0;margin-left:10px}.um-account-side li a span.um-account-icon,.um-account-side li a.current span.um-account-icon,.um-account-side li a.current:hover span.um-account-icon{float:right;border-left:1px solid #ccc}.um-account-side li a span.um-account-title{padding-right:20px;float:right}.um-account-side li a span.um-account-arrow{right:auto;left:10px}.um-field-label .um-field-label-icon{float:right;margin:0 0 0 8px}p.um-notice i{right:auto;left:14px}.um-account.uimob340 .um-account-nav a,.um-account.uimob500 .um-account-nav a{padding-left:0;padding-right:40px}.um-account.uimob340 .um-account-nav span.ico,.um-account.uimob500 .um-account-nav span.ico{right:0}.um-account.uimob340 .um-account-nav span.arr,.um-account.uimob500 .um-account-nav span.arr{right:auto;left:0}.select2.select2-container .select2-selection .select2-selection__arrow{right:auto!important}.select2-container[dir=rtl] .select2-selection--single .select2-selection__rendered{padding-right:8px;text-align:right;padding-left:20px}.select2-container--default[dir=rtl] .select2-selection--single .select2-selection__clear{margin-left:4px}.um-single-file-preview a.cancel,.um-single-image-preview a.cancel{left:-15px;right:auto}.select2.select2-container .select2-selection{padding:0 12px 0 0!important}.select2-selection__clear{right:auto;left:1px}.cropper-container{margin:0 auto;left:auto!important}.um-field-label .um-tip{margin:0 8px 0 0}.tipsy-inner{text-align:right!important}.um span.um-req{margin:0 8px 0 0}.um-account-side li a span.um-account-icon,.um-account-side li a.current span.um-account-icon,.um-account-side li a.current:hover span.um-account-icon{border-right:none}.um-field-error .um-field-arrow{left:0;right:10px}.um-single-file-preview a.cancel,.um-single-image-preview a.cancel{left:0}.um-modal-body .um-single-file-preview a.cancel,.um-modal-body .um-single-image-preview a.cancel{left:-15px}.um-item-link{padding-right:0;padding-left:40px} \ No newline at end of file +.rtl .um{direction:rtl!important;text-align:right}.rtl .um:not(.um-admin){text-align:right}.um-profile-photo{float:right;margin:0 30px 0 0}.um-profile-photo a.um-profile-photo-img{float:right;left:auto}.um-cover + .um-header .um-profile-photo a.um-profile-photo-img{right:0}div.uimob500 .um-profile-photo a.um-profile-photo-img{right:auto}.um-profile-edit{right:auto;left:0;margin-left:10px;margin-right:0}div.uimob960 .um-header .um-profile-meta,div.uimob800 .um-header .um-profile-meta{padding-left:0!important;padding-right:200px!important}.um-name{float:right;margin-right:0}.um-profile-nav-item a{float:right;padding:6px 28px 6px 10px}.um-profile-nav-item i{left:auto;right:6px}.um-profile-nav-item a{float:right}.um-field-checkbox-state,.um-field-radio-state{right:1px;left:auto}.um-field-checkbox-option,.um-field-radio-option{margin:0 36px 0 0}.um-field-half{float:right}.um-field-half.right{float:left}.um-left{float:right}.um-right{float:left}.um-account-main,.um-account-side{float:right}.um-account-main div.um-account-heading i{margin-right:0;margin-left:10px}.um-account-side li a span.um-account-icon,.um-account-side li a.current span.um-account-icon,.um-account-side li a.current:hover span.um-account-icon{float:right;border-left:1px solid #ccc}.um-account-side li a span.um-account-title{padding-right:20px;float:right}.um-account-side li a span.um-account-arrow{right:auto;left:10px}.um-field-label .um-field-label-icon{float:right;margin:0 0 0 8px}p.um-notice i{right:auto;left:14px}.um-account.uimob340 .um-account-nav a,.um-account.uimob500 .um-account-nav a{padding-left:0;padding-right:40px}.um-account.uimob340 .um-account-nav span.ico,.um-account.uimob500 .um-account-nav span.ico{right:0}.um-account.uimob340 .um-account-nav span.arr,.um-account.uimob500 .um-account-nav span.arr{right:auto;left:0}.select2.select2-container .select2-selection .select2-selection__arrow{right:auto!important}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;text-align:right;padding-left:20px}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{margin-left:4px}.um-single-image-preview a.cancel,.um-single-file-preview a.cancel{left:-15px;right:auto}.select2.select2-container .select2-selection{padding:0 12px 0 0 !important}.select2-selection__clear{right:auto;left:1px}.cropper-container{margin:0 auto;left:auto!important}.um-field-label .um-tip{margin:0 8px 0 0}.tipsy-inner{text-align:right!important}.um span.um-req{margin:0 8px 0 0}.um-account-side li a span.um-account-icon,.um-account-side li a.current span.um-account-icon,.um-account-side li a.current:hover span.um-account-icon{border-right:none}.um-field-error .um-field-arrow{left:0;right:10px}.um-single-image-preview a.cancel,.um-single-file-preview a.cancel{left:0}.um-modal-body .um-single-image-preview a.cancel,.um-modal-body .um-single-file-preview a.cancel{left:-15px}.um-item-link{padding-right:0;padding-left:40px} \ No newline at end of file From 92c46ec93174ec0cfd260f966754b551f5daac5d Mon Sep 17 00:00:00 2001 From: yuriinalivaiko Date: Thu, 21 Dec 2023 20:14:22 +0200 Subject: [PATCH 04/33] - fixed AJAX conflict --- assets/js/common.js | 21 --------------------- assets/js/common.min.js | 2 +- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/assets/js/common.js b/assets/js/common.js index 0c8af614..7b8aa0bc 100644 --- a/assets/js/common.js +++ b/assets/js/common.js @@ -116,27 +116,6 @@ UM.common = { } } -jQuery.ajaxSetup({ - beforeSend: function( jqXHR, settings ) { - if ( settings.processData ) { - if ( settings.data !== '' ) { - settings.data += '&um_current_locale=' + um_common_variables.locale; - } else { - settings.data = 'um_current_locale=' + um_common_variables.locale; - } - } else { - settings.data = jQuery.extend( - settings.data, - { - um_current_locale: um_common_variables.locale - } - ); - } - - return true; - } -}); - jQuery(document).on( 'ajaxStart', function() { UM.common.tipsy.hide(); }); diff --git a/assets/js/common.min.js b/assets/js/common.min.js index 8312f3bb..ac914fd9 100644 --- a/assets/js/common.min.js +++ b/assets/js/common.min.js @@ -1 +1 @@ -"object"!=typeof window.UM&&(window.UM={}),"object"!=typeof UM.common&&(UM.common={}),UM.common={tipsy:{init:function(){"function"==typeof jQuery.fn.tipsy&&(jQuery(".um-tip-n").tipsy({gravity:"n",opacity:1,live:"a.live",offset:3}),jQuery(".um-tip-w").tipsy({gravity:"w",opacity:1,live:"a.live",offset:3}),jQuery(".um-tip-e").tipsy({gravity:"e",opacity:1,live:"a.live",offset:3}),jQuery(".um-tip-s").tipsy({gravity:"s",opacity:1,live:"a.live",offset:3}))},hide:function(){"function"==typeof jQuery.fn.tipsy&&(jQuery(".um-tip-n").tipsy("hide"),jQuery(".um-tip-w").tipsy("hide"),jQuery(".um-tip-e").tipsy("hide"),jQuery(".um-tip-s").tipsy("hide"),jQuery(".um .tipsy").remove())}},datetimePicker:{init:function(){jQuery(".um-datepicker:not(.picker__input)").each(function(){e=void 0!==(elem=jQuery(this)).attr("data-disabled_weekdays")&&""!=elem.attr("data-disabled_weekdays")&&JSON.parse(elem.attr("data-disabled_weekdays"));var e,t=null,a=(void 0!==elem.attr("data-years")&&(t=elem.attr("data-years")),elem.attr("data-date_min")),i=elem.attr("data-date_max"),n=[],o=[],a=(void 0!==a&&(n=a.split(",")),void 0!==i&&(o=i.split(",")),n.length?new Date(n):null),i=n.length?new Date(o):null,o=(a&&"Invalid Date"==a.toString()&&3==n.length&&(n=n[1]+"/"+n[2]+"/"+n[0],a=new Date(Date.parse(n))),i&&"Invalid Date"==i.toString()&&3==o.length&&(n=o[1]+"/"+o[2]+"/"+o[0],i=new Date(Date.parse(n))),{disable:e,format:elem.attr("data-format"),formatSubmit:"yyyy/mm/dd",hiddenName:!0,onOpen:function(){elem.blur()},onClose:function(){elem.blur()}});null!==t&&(o.selectYears=t),null!==a&&(o.min=a),null!==i&&(o.max=i),elem.pickadate(o)}),jQuery(".um-timepicker:not(.picker__input)").each(function(){(elem=jQuery(this)).pickatime({format:elem.attr("data-format"),interval:parseInt(elem.attr("data-intervals")),formatSubmit:"HH:i",hiddenName:!0,onOpen:function(){elem.blur()},onClose:function(){elem.blur()}})})}},select:{isSelected:function(e,t){return e===t?' selected="selected"':""}}},jQuery.ajaxSetup({beforeSend:function(e,t){return t.processData?""!==t.data?t.data+="&um_current_locale="+um_common_variables.locale:t.data="um_current_locale="+um_common_variables.locale:t.data=jQuery.extend(t.data,{um_current_locale:um_common_variables.locale}),!0}}),jQuery(document).on("ajaxStart",function(){UM.common.tipsy.hide()}),jQuery(document).on("ajaxSuccess",function(){UM.common.tipsy.init()}),jQuery(document).ready(function(){UM.common.tipsy.init(),UM.common.datetimePicker.init()}); \ No newline at end of file +"object"!=typeof window.UM&&(window.UM={}),"object"!=typeof UM.common&&(UM.common={}),UM.common={tipsy:{init:function(){"function"==typeof jQuery.fn.tipsy&&(jQuery(".um-tip-n").tipsy({gravity:"n",opacity:1,live:"a.live",offset:3}),jQuery(".um-tip-w").tipsy({gravity:"w",opacity:1,live:"a.live",offset:3}),jQuery(".um-tip-e").tipsy({gravity:"e",opacity:1,live:"a.live",offset:3}),jQuery(".um-tip-s").tipsy({gravity:"s",opacity:1,live:"a.live",offset:3}))},hide:function(){"function"==typeof jQuery.fn.tipsy&&(jQuery(".um-tip-n").tipsy("hide"),jQuery(".um-tip-w").tipsy("hide"),jQuery(".um-tip-e").tipsy("hide"),jQuery(".um-tip-s").tipsy("hide"),jQuery(".um .tipsy").remove())}},datetimePicker:{init:function(){jQuery(".um-datepicker:not(.picker__input)").each(function(){elem=jQuery(this),o=void 0!==elem.attr("data-disabled_weekdays")&&""!=elem.attr("data-disabled_weekdays")&&JSON.parse(elem.attr("data-disabled_weekdays"));var e=null;void 0!==elem.attr("data-years")&&(e=elem.attr("data-years"));var t=elem.attr("data-date_min"),i=elem.attr("data-date_max"),a=[],n=[];void 0!==t&&(a=t.split(",")),void 0!==i&&(n=i.split(","));t=a.length?new Date(a):null,i=a.length?new Date(n):null;t&&"Invalid Date"==t.toString()&&3==a.length&&(a=a[1]+"/"+a[2]+"/"+a[0],t=new Date(Date.parse(a))),i&&"Invalid Date"==i.toString()&&3==n.length&&(n=n[1]+"/"+n[2]+"/"+n[0],i=new Date(Date.parse(n)));var o={disable:o,format:elem.attr("data-format"),formatSubmit:"yyyy/mm/dd",hiddenName:!0,onOpen:function(){elem.blur()},onClose:function(){elem.blur()}};null!==e&&(o.selectYears=e),null!==t&&(o.min=t),null!==i&&(o.max=i),elem.pickadate(o)}),jQuery(".um-timepicker:not(.picker__input)").each(function(){elem=jQuery(this),elem.pickatime({format:elem.attr("data-format"),interval:parseInt(elem.attr("data-intervals")),formatSubmit:"HH:i",hiddenName:!0,onOpen:function(){elem.blur()},onClose:function(){elem.blur()}})})}},select:{isSelected:function(e,t){return e===t?' selected="selected"':""}}},jQuery(document).on("ajaxStart",function(){UM.common.tipsy.hide()}),jQuery(document).on("ajaxSuccess",function(){UM.common.tipsy.init()}),jQuery(document).ready(function(){UM.common.tipsy.init(),UM.common.datetimePicker.init()}); \ No newline at end of file From 9899eabf45944f228331621107e78347a6c0916d Mon Sep 17 00:00:00 2001 From: Mykyta Synelnikov Date: Fri, 22 Dec 2023 13:09:18 +0200 Subject: [PATCH 05/33] - used _.debounce when resize; --- assets/js/common-frontend.js | 2 +- assets/js/common-frontend.min.js | 2 +- assets/js/common.min.js | 2 +- assets/js/um-responsive.js | 7 +++++-- assets/js/um-responsive.min.js | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/assets/js/common-frontend.js b/assets/js/common-frontend.js index 767cf64f..fef49375 100644 --- a/assets/js/common-frontend.js +++ b/assets/js/common-frontend.js @@ -91,7 +91,7 @@ UM.frontend = { } }, destroy: function() { - if ( jQuery('.cropper-container').length > 0 ) { + if ( jQuery('.cropper-container').length > 0 && UM.frontend.cropper.obj ) { UM.frontend.cropper.obj.destroy(); // destroy Cropper.JS method UM.frontend.cropper.obj = null; // flush our own object } diff --git a/assets/js/common-frontend.min.js b/assets/js/common-frontend.min.js index 8748e4ea..aae402d3 100644 --- a/assets/js/common-frontend.min.js +++ b/assets/js/common-frontend.min.js @@ -1 +1 @@ -"object"!=typeof window.UM&&(window.UM={}),"object"!=typeof UM.frontend&&(UM.frontend={}),UM.frontend={cropper:{obj:null,init:function(){var o=jQuery(".um-modal .um-single-image-preview img").first();if(o.length&&""!==o.attr("src")){UM.frontend.cropper.obj&&UM.frontend.cropper.destroy();var t=jQuery(".um-modal .um-single-image-preview"),r=o.parent().data("crop"),n=o.parent().data("min_width"),i=o.parent().data("min_height"),a=o.parent().data("ratio"),d=jQuery(".um-modal").find("#um_upload_single").data("ratio"),d=(d&&(a=d.split(":")[0]),jQuery(window).height()-(jQuery(".um-modal-footer a").height()+20)-50-jQuery(".um-modal-header:visible").height());o.css({height:"auto"}),t.css({height:"auto"}),jQuery(window).height()<=400?(t.css({height:d+"px","max-height":d+"px"}),o.css({height:"auto"})):(o.css({height:"auto","max-height":d+"px"}),t.css({height:o.height(),"max-height":d+"px"}));let e;"square"===r?e={minWidth:n,minHeight:i,dragCrop:!1,aspectRatio:1,zoomable:!1,rotatable:!1,dashed:!1}:"cover"===r?(0 Date: Wed, 6 Dec 2023 18:25:13 +0200 Subject: [PATCH 06/33] - added shortcode um_profile_link --- includes/core/class-shortcodes.php | 40 ++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/includes/core/class-shortcodes.php b/includes/core/class-shortcodes.php index 8cb757de..53abbcee 100644 --- a/includes/core/class-shortcodes.php +++ b/includes/core/class-shortcodes.php @@ -74,6 +74,10 @@ if ( ! class_exists( 'um\core\Shortcodes' ) ) { add_shortcode( 'um_show_content', array( &$this, 'um_shortcode_show_content_for_role' ) ); add_shortcode( 'ultimatemember_searchform', array( &$this, 'ultimatemember_searchform' ) ); + if ( ! shortcode_exists( 'um_profile_link' ) ) { + add_shortcode( 'um_profile_link', array( &$this, 'um_profile_link' ) ); + } + add_filter( 'body_class', array( &$this, 'body_class' ), 0 ); add_filter( 'um_shortcode_args_filter', array( &$this, 'display_logout_form' ), 99 ); @@ -459,6 +463,42 @@ if ( ! class_exists( 'um\core\Shortcodes' ) ) { } + /** + * Display profile link. + * + * @since 2.8.0 + * + * Example 1: [um_profile_link] + * Example 2: [um_profile_link title="Go to profile" user_id="29"] + * + * @param array $attr { + * Attributes of the shortcode. + * + * @type string class A link class. + * @type string title A link text. + * @type int user_id User ID. Author ID if empty. + * } + * @return string|void Profile link HTML or profile link URL if the link text is empty. + */ + public function um_profile_link( $attr ) { + + $defaults_atts = array( + 'class' => 'um-link um-profile-link', + 'title' => '', + 'user_id' => is_singular() ? get_post()->post_author : ( is_author() ? get_the_author_meta( 'ID' ) : 0 ), + ); + + $atts = shortcode_atts( $defaults_atts, $attr, 'um_profile_link' ); + + if ( empty( $atts['user_id'] ) ) { + return; + } + $url = um_user_profile_url( $atts['user_id'] ); + + return empty( $atts['title'] ) ? $url : '' . esc_html( $atts['title'] ) . ''; + } + + /** * @param array $args * From 85f056040ed961574b877b1d7ca98e438a6f4f3f Mon Sep 17 00:00:00 2001 From: yuriinalivaiko Date: Mon, 1 Jan 2024 21:17:02 +0200 Subject: [PATCH 07/33] - fixed: the um class removed from the body classes --- includes/core/class-shortcodes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/core/class-shortcodes.php b/includes/core/class-shortcodes.php index 8cb757de..d8024f0a 100644 --- a/includes/core/class-shortcodes.php +++ b/includes/core/class-shortcodes.php @@ -257,7 +257,7 @@ if ( ! class_exists( 'um\core\Shortcodes' ) ) { foreach ( $array as $slug => $info ) { if ( um_is_core_page( $slug ) ) { - $classes[] = 'um'; + $classes[] = 'um-page'; $classes[] = 'um-page-' . $slug; if ( is_user_logged_in() ) { From 46fc7ba1bc3fc2664a25ce38415be4c862680f09 Mon Sep 17 00:00:00 2001 From: Mykyta Synelnikov Date: Wed, 3 Jan 2024 14:18:22 +0200 Subject: [PATCH 08/33] - increased debounce interval; --- assets/js/um-responsive.js | 2 +- assets/js/um-responsive.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/js/um-responsive.js b/assets/js/um-responsive.js index 4eb6f3bf..c753672f 100644 --- a/assets/js/um-responsive.js +++ b/assets/js/um-responsive.js @@ -13,7 +13,7 @@ jQuery(window).on( 'resize', _.debounce( function() { um_responsive(); um_modal_responsive(); -}, 100 ) ); +}, 300 ) ); wp.hooks.addAction( 'um_admin_modal_success_result', 'um_frontend_responsive', function( $adminModal ) { // Make responsive script only when live preview, diff --git a/assets/js/um-responsive.min.js b/assets/js/um-responsive.min.js index 8549ddb2..c05ec19e 100644 --- a/assets/js/um-responsive.min.js +++ b/assets/js/um-responsive.min.js @@ -1 +1 @@ -jQuery(window).on("load",function(){um_responsive(),um_modal_responsive()}),jQuery(window).on("resize",_.debounce(function(){responsive_Modal(),wp.hooks.doAction("um_window_resize"),um_responsive(),um_modal_responsive()},100)),wp.hooks.addAction("um_admin_modal_success_result","um_frontend_responsive",function(o){o.find(".um-admin-modal-body").find(".um").length&&um_responsive()}); \ No newline at end of file +jQuery(window).on("load",function(){um_responsive(),um_modal_responsive()}),jQuery(window).on("resize",_.debounce(function(){responsive_Modal(),wp.hooks.doAction("um_window_resize"),um_responsive(),um_modal_responsive()},300)),wp.hooks.addAction("um_admin_modal_success_result","um_frontend_responsive",function(o){o.find(".um-admin-modal-body").find(".um").length&&um_responsive()}); \ No newline at end of file From ceebdb3953a5005008cf30ce609137733238e68f Mon Sep 17 00:00:00 2001 From: Mykyta Synelnikov Date: Wed, 3 Jan 2024 14:43:00 +0200 Subject: [PATCH 09/33] - added class="fusion-lazyload-ignore" to empty images in modal window while upload avatar or cover photo. Avoid the conflict with Fusion Images lazyload functionality; --- includes/core/class-fields.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/core/class-fields.php b/includes/core/class-fields.php index 59cb850a..5aeae98a 100644 --- a/includes/core/class-fields.php +++ b/includes/core/class-fields.php @@ -2963,7 +2963,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) { } else { $img_value = UM()->files()->get_download_link( $this->set_id, $key, um_user( 'ID' ) ); } - $img = ''; + $img = ''; } else { $img = ''; } @@ -2981,7 +2981,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) { if ( empty( $disabled ) ) { $output .= ''; } - $output .= '
'; + $output .= '
'; if ( empty( $disabled ) ) { $output .= '' . esc_html( $data['button_text'] ) . ''; } @@ -3014,7 +3014,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) { } $nonce = wp_create_nonce( 'um_upload_nonce-' . $this->timestamp ); - $output .= '
'; + $output .= '
'; $output .= '
' . esc_html( $data['button_text'] ) . '
'; $output .= '