Ultimate Member – User Profile & Membership Plugin - Version 2.0.29

Version Description

Download this release

Release Info

Developer nsinelnikov
Plugin Icon 128x128 Ultimate Member – User Profile & Membership Plugin
Version 2.0.29
Comparing to
See all releases

Code changes from version 2.0.27 to 2.0.29

assets/js/um-scripts.js CHANGED
@@ -241,31 +241,62 @@ jQuery(document).ready(function() {
241
return false;
242
});
243
244
- jQuery(document).on('click', '.um-ajax-paginate', function(e){
245
- e.preventDefault();
246
- var parent = jQuery(this).parent();
247
- parent.addClass('loading');
248
- var args = jQuery(this).data('args');
249
- var hook = jQuery(this).data('hook');
250
- var container = jQuery(this).parents('.um').find('.um-ajax-items');
251
- jQuery.ajax({
252
- url: wp.ajax.settings.url,
253
- type: 'post',
254
- data: {
255
- action: 'um_ajax_paginate',
256
- hook: hook,
257
- args: args
258
- },
259
- complete: function(){
260
- parent.removeClass('loading');
261
- },
262
- success: function(data){
263
- parent.remove();
264
- container.append( data );
265
- }
266
- });
267
- return false;
268
- });
269
270
jQuery(document).on('click', '.um-ajax-action', function(e){
271
e.preventDefault();
241
return false;
242
});
243
244
+
245
+ jQuery( document.body ).on( 'click', '.um-ajax-paginate', function(e) {
246
+ e.preventDefault();
247
+
248
+ var obj = jQuery(this);
249
+ var parent = jQuery(this).parent();
250
+ parent.addClass( 'loading' );
251
+
252
+ var hook = jQuery(this).data('hook');
253
+ if ( 'um_load_posts' === hook ) {
254
+ var pages = jQuery(this).data('pages')*1;
255
+ var next_page = jQuery(this).data('page')*1 + 1;
256
+
257
+ jQuery.ajax({
258
+ url: wp.ajax.settings.url,
259
+ type: 'post',
260
+ data: {
261
+ action: 'um_ajax_paginate_posts',
262
+ author: jQuery(this).data('author'),
263
+ page: next_page
264
+ },
265
+ complete: function() {
266
+ parent.removeClass( 'loading' );
267
+ },
268
+ success: function( data ) {
269
+ parent.before( data );
270
+ if ( next_page === pages ) {
271
+ parent.remove();
272
+ } else {
273
+ obj.data( 'page', next_page );
274
+ }
275
+ }
276
+ });
277
+ } else {
278
+ var args = jQuery(this).data('args');
279
+ var container = jQuery(this).parents('.um').find('.um-ajax-items');
280
+
281
+ jQuery.ajax({
282
+ url: wp.ajax.settings.url,
283
+ type: 'post',
284
+ data: {
285
+ action: 'um_ajax_paginate',
286
+ hook: hook,
287
+ args: args
288
+ },
289
+ complete: function() {
290
+ parent.removeClass( 'loading' );
291
+ },
292
+ success: function(data){
293
+ parent.remove();
294
+ container.append( data );
295
+ }
296
+ });
297
+ }
298
+ });
299
+
300
301
jQuery(document).on('click', '.um-ajax-action', function(e){
302
e.preventDefault();
assets/js/um-scripts.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(){jQuery(document).on("click",".um-dropdown a",function(e){return!1}),jQuery(document).on("click",".um-dropdown a.real_url",function(e){window.location=jQuery(this).attr("href")}),jQuery(document).on("click",".um-trigger-menu-on-click",function(e){return jQuery(".um-dropdown").hide(),menu=jQuery(this).find(".um-dropdown"),menu.show(),!1}),jQuery(document).on("click",".um-dropdown-hide",function(e){UM_hide_menus()}),jQuery(document).on("click","a.um-manual-trigger",function(){var e=jQuery(this).attr("data-child"),t=jQuery(this).attr("data-parent");jQuery(this).parents(t).find(e).trigger("click")}),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}),jQuery(document).on("change",".um-field-area input[type=radio]",function(){var e=jQuery(this).parents(".um-field-area"),t=jQuery(this).parents("label");e.find(".um-field-radio").removeClass("active"),e.find(".um-field-radio").find("i").removeAttr("class").addClass("um-icon-android-radio-button-off"),t.addClass("active"),t.find("i").removeAttr("class").addClass("um-icon-android-radio-button-on")}),jQuery(document).on("change",".um-field-area input[type=checkbox]",function(){jQuery(this).parents(".um-field-area");var e=jQuery(this).parents("label");e.hasClass("active")?(e.removeClass("active"),e.find("i").removeAttr("class").addClass("um-icon-android-checkbox-outline-blank")):(e.addClass("active"),e.find("i").removeAttr("class").addClass("um-icon-android-checkbox-outline"))}),jQuery(".um-datepicker").each(function(){if(elem=jQuery(this),""!=elem.attr("data-disabled_weekdays"))var e=JSON.parse(elem.attr("data-disabled_weekdays"));else e=!1;var t=elem.attr("data-years"),a=elem.attr("data-date_min"),i=elem.attr("data-date_max"),r=a.split(","),n=i.split(","),u=r.length?new Date(r):null,o=r.length?new Date(n):null;if(u&&"Invalid Date"==u.toString()&&3==r.length){var d=r[1]+"/"+r[2]+"/"+r[0];u=new Date(Date.parse(d))}if(o&&"Invalid Date"==o.toString()&&3==n.length){var s=n[1]+"/"+n[2]+"/"+n[0];o=new Date(Date.parse(s))}elem.pickadate({selectYears:t,min:u,max:o,disable:e,format:elem.attr("data-format"),formatSubmit:"yyyy/mm/dd",hiddenName:!0,onOpen:function(){elem.blur()},onClose:function(){elem.blur()}})}),jQuery(".um-timepicker").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()}})}),jQuery(".um-rating").um_raty({half:!1,starType:"i",number:function(){return jQuery(this).attr("data-number")},score:function(){return jQuery(this).attr("data-score")},scoreName:function(){return jQuery(this).attr("data-key")},hints:!1,click:function(e,t){live_field=this.id,live_value=e,um_conditional()}}),jQuery(".um-rating-readonly").um_raty({half:!1,starType:"i",number:function(){return jQuery(this).attr("data-number")},score:function(){return jQuery(this).attr("data-score")},scoreName:function(){return jQuery(this).attr("data-key")},hints:!1,readOnly:!0}),jQuery(document).on("click",".um .um-single-image-preview a.cancel",function(e){e.preventDefault();var t=jQuery(this).parents(".um-field"),a=jQuery(this).parents(".um-field").find(".um-single-image-preview img").attr("src");return t.find(".um-single-image-preview img").attr("src",""),t.find(".um-single-image-preview").hide(),t.find(".um-btn-auto-width").html("Upload"),t.find("input[type=hidden]").val("empty_file"),jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_remove_file",src:a}}),!1}),jQuery(document).on("click",".um .um-single-file-preview a.cancel",function(e){e.preventDefault();var t=jQuery(this).parents(".um-field"),a=jQuery(this).parents(".um-field").find(".um-single-fileinfo a").attr("href");return t.find(".um-single-file-preview").hide(),t.find(".um-btn-auto-width").html("Upload"),t.find("input[type=hidden]").val("empty_file"),jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_remove_file",src:a}}),!1}),jQuery(".um-s1,.um-s2").css({display:"block"}),jQuery(".um-s1").select2({allowClear:!0}),jQuery(".um-s2").select2({allowClear:!1,minimumResultsForSearch:10}),jQuery(document).on("click",".um-field-group-head:not(.disabled)",function(){var e=jQuery(this).parents(".um-field-group"),t=e.data("max_entries");e.find(".um-field-group-body").is(":hidden")?e.find(".um-field-group-body").show():e.find(".um-field-group-body:first").clone().appendTo(e),increase_id=0,e.find(".um-field-group-body").each(function(){increase_id++,jQuery(this).find("input").each(function(){var e=jQuery(this);e.attr("id",e.data("key")+"-"+increase_id),e.attr("name",e.data("key")+"-"+increase_id),e.parent().parent().find("label").attr("for",e.data("key")+"-"+increase_id)})}),0<t&&e.find(".um-field-group-body").length==t&&jQuery(this).addClass("disabled")}),jQuery(document).on("click",".um-field-group-cancel",function(e){e.preventDefault();var t=jQuery(this).parents(".um-field-group"),a=t.data("max_entries");return 1<t.find(".um-field-group-body").length?jQuery(this).parents(".um-field-group-body").remove():jQuery(this).parents(".um-field-group-body").hide(),0<a&&t.find(".um-field-group-body").length<a&&t.find(".um-field-group-head").removeClass("disabled"),!1}),jQuery(document).on("click",".um-ajax-paginate",function(e){e.preventDefault();var t=jQuery(this).parent();t.addClass("loading");var a=jQuery(this).data("args"),i=jQuery(this).data("hook"),r=jQuery(this).parents(".um").find(".um-ajax-items");return jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_ajax_paginate",hook:i,args:a},complete:function(){t.removeClass("loading")},success:function(e){t.remove(),r.append(e)}}),!1}),jQuery(document).on("click",".um-ajax-action",function(e){e.preventDefault();var t=jQuery(this).data("hook"),a=jQuery(this).data("user_id"),arguments=jQuery(this).data("arguments");return jQuery(this).data("js-remove")&&jQuery(this).parents("."+jQuery(this).data("js-remove")).fadeOut("fast"),jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_muted_action",hook:t,user_id:a,arguments:arguments},success:function(e){}}),!1}),jQuery(document).on("click","#um-search-button",function(){jQuery(this).parents("form").submit()}),jQuery(".um-form input[class=um-button][type=submit]").removeAttr("disabled"),jQuery(document).one("click",".um:not(.um-account) .um-form input[class=um-button][type=submit]:not(.um-has-recaptcha)",function(){jQuery(this).attr("disabled","disabled"),jQuery(this).parents("form").submit()});var o={};function d(e,t,a,i){var r=e.data("um-parent");e.attr("name"),jQuery('select[name="'+r+'"]');e.find('option[value!=""]').remove(),e.hasClass("um-child-option-disabled")||e.removeAttr("disabled");i=[];var n="";if("yes"===t.post.members_directory){var u=new URLSearchParams(window.location.search);n=u.get(t.post.child_name)}jQuery.each(t.items,function(e,t){i.push({id:e,text:t,selected:t===n})}),e.select2("destroy"),e.select2({data:i,allowClear:!0,minimumResultsForSearch:10}),"yes"!==t.post.members_directory&&(void 0===t.field.default||e.data("um-original-value")?""!=e.data("um-original-value")&&e.val(e.data("um-original-value")).trigger("change"):e.val(t.field.default).trigger("change"),0==t.field.editable&&(e.addClass("um-child-option-disabled"),e.attr("disabled","disabled"))),o[a]=t}jQuery("select[data-um-parent]").each(function(){var r=jQuery(this),n=r.data("um-parent"),u=(r.data("um-ajax-url"),r.data("um-ajax-source"));r.val();r.attr("data-um-init-field",!0),jQuery(document).on("change",'select[name="'+n+'"]',function(){var t=jQuery(this),e=t.closest("form").find("input[type=hidden][name=form_id]").val(),a=t.val();if(""!=t.val()&&"object"!=typeof o[a]&&jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_select_options",parent_option_name:n,parent_option:t.val(),child_callback:u,child_name:r.attr("name"),members_directory:r.attr("data-mebers-directory"),form_id:e},success:function(e){"success"==e.status&&""!=t.val()&&d(r,e,a),void 0!==e.debug&&console.log(e)},error:function(e){console.log(e)}}),""!=t.val()&&"object"==typeof o[a]){var i=o[a];d(r,i,a)}""==t.val()&&(r.find('option[value!=""]').remove(),r.val("").trigger("change"))}),jQuery('select[name="'+n+'"]').trigger("change")})});
1
+ jQuery(document).ready(function(){jQuery(document).on("click",".um-dropdown a",function(e){return!1}),jQuery(document).on("click",".um-dropdown a.real_url",function(e){window.location=jQuery(this).attr("href")}),jQuery(document).on("click",".um-trigger-menu-on-click",function(e){return jQuery(".um-dropdown").hide(),menu=jQuery(this).find(".um-dropdown"),menu.show(),!1}),jQuery(document).on("click",".um-dropdown-hide",function(e){UM_hide_menus()}),jQuery(document).on("click","a.um-manual-trigger",function(){var e=jQuery(this).attr("data-child"),t=jQuery(this).attr("data-parent");jQuery(this).parents(t).find(e).trigger("click")}),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}),jQuery(document).on("change",".um-field-area input[type=radio]",function(){var e=jQuery(this).parents(".um-field-area"),t=jQuery(this).parents("label");e.find(".um-field-radio").removeClass("active"),e.find(".um-field-radio").find("i").removeAttr("class").addClass("um-icon-android-radio-button-off"),t.addClass("active"),t.find("i").removeAttr("class").addClass("um-icon-android-radio-button-on")}),jQuery(document).on("change",".um-field-area input[type=checkbox]",function(){jQuery(this).parents(".um-field-area");var e=jQuery(this).parents("label");e.hasClass("active")?(e.removeClass("active"),e.find("i").removeAttr("class").addClass("um-icon-android-checkbox-outline-blank")):(e.addClass("active"),e.find("i").removeAttr("class").addClass("um-icon-android-checkbox-outline"))}),jQuery(".um-datepicker").each(function(){if(elem=jQuery(this),""!=elem.attr("data-disabled_weekdays"))var e=JSON.parse(elem.attr("data-disabled_weekdays"));else e=!1;var t=elem.attr("data-years"),a=elem.attr("data-date_min"),i=elem.attr("data-date_max"),r=a.split(","),n=i.split(","),u=r.length?new Date(r):null,o=r.length?new Date(n):null;if(u&&"Invalid Date"==u.toString()&&3==r.length){var d=r[1]+"/"+r[2]+"/"+r[0];u=new Date(Date.parse(d))}if(o&&"Invalid Date"==o.toString()&&3==n.length){var s=n[1]+"/"+n[2]+"/"+n[0];o=new Date(Date.parse(s))}elem.pickadate({selectYears:t,min:u,max:o,disable:e,format:elem.attr("data-format"),formatSubmit:"yyyy/mm/dd",hiddenName:!0,onOpen:function(){elem.blur()},onClose:function(){elem.blur()}})}),jQuery(".um-timepicker").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()}})}),jQuery(".um-rating").um_raty({half:!1,starType:"i",number:function(){return jQuery(this).attr("data-number")},score:function(){return jQuery(this).attr("data-score")},scoreName:function(){return jQuery(this).attr("data-key")},hints:!1,click:function(e,t){live_field=this.id,live_value=e,um_conditional()}}),jQuery(".um-rating-readonly").um_raty({half:!1,starType:"i",number:function(){return jQuery(this).attr("data-number")},score:function(){return jQuery(this).attr("data-score")},scoreName:function(){return jQuery(this).attr("data-key")},hints:!1,readOnly:!0}),jQuery(document).on("click",".um .um-single-image-preview a.cancel",function(e){e.preventDefault();var t=jQuery(this).parents(".um-field"),a=jQuery(this).parents(".um-field").find(".um-single-image-preview img").attr("src");return t.find(".um-single-image-preview img").attr("src",""),t.find(".um-single-image-preview").hide(),t.find(".um-btn-auto-width").html("Upload"),t.find("input[type=hidden]").val("empty_file"),jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_remove_file",src:a}}),!1}),jQuery(document).on("click",".um .um-single-file-preview a.cancel",function(e){e.preventDefault();var t=jQuery(this).parents(".um-field"),a=jQuery(this).parents(".um-field").find(".um-single-fileinfo a").attr("href");return t.find(".um-single-file-preview").hide(),t.find(".um-btn-auto-width").html("Upload"),t.find("input[type=hidden]").val("empty_file"),jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_remove_file",src:a}}),!1}),jQuery(".um-s1,.um-s2").css({display:"block"}),jQuery(".um-s1").select2({allowClear:!0}),jQuery(".um-s2").select2({allowClear:!1,minimumResultsForSearch:10}),jQuery(document).on("click",".um-field-group-head:not(.disabled)",function(){var e=jQuery(this).parents(".um-field-group"),t=e.data("max_entries");e.find(".um-field-group-body").is(":hidden")?e.find(".um-field-group-body").show():e.find(".um-field-group-body:first").clone().appendTo(e),increase_id=0,e.find(".um-field-group-body").each(function(){increase_id++,jQuery(this).find("input").each(function(){var e=jQuery(this);e.attr("id",e.data("key")+"-"+increase_id),e.attr("name",e.data("key")+"-"+increase_id),e.parent().parent().find("label").attr("for",e.data("key")+"-"+increase_id)})}),0<t&&e.find(".um-field-group-body").length==t&&jQuery(this).addClass("disabled")}),jQuery(document).on("click",".um-field-group-cancel",function(e){e.preventDefault();var t=jQuery(this).parents(".um-field-group"),a=t.data("max_entries");return 1<t.find(".um-field-group-body").length?jQuery(this).parents(".um-field-group-body").remove():jQuery(this).parents(".um-field-group-body").hide(),0<a&&t.find(".um-field-group-body").length<a&&t.find(".um-field-group-head").removeClass("disabled"),!1}),jQuery(document.body).on("click",".um-ajax-paginate",function(e){e.preventDefault();var t=jQuery(this),a=jQuery(this).parent();a.addClass("loading");var i=jQuery(this).data("hook");if("um_load_posts"===i){var r=1*jQuery(this).data("pages"),n=1*jQuery(this).data("page")+1;jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_ajax_paginate_posts",author:jQuery(this).data("author"),page:n},complete:function(){a.removeClass("loading")},success:function(e){a.before(e),n===r?a.remove():t.data("page",n)}})}else{var u=jQuery(this).data("args"),o=jQuery(this).parents(".um").find(".um-ajax-items");jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_ajax_paginate",hook:i,args:u},complete:function(){a.removeClass("loading")},success:function(e){a.remove(),o.append(e)}})}}),jQuery(document).on("click",".um-ajax-action",function(e){e.preventDefault();var t=jQuery(this).data("hook"),a=jQuery(this).data("user_id"),arguments=jQuery(this).data("arguments");return jQuery(this).data("js-remove")&&jQuery(this).parents("."+jQuery(this).data("js-remove")).fadeOut("fast"),jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_muted_action",hook:t,user_id:a,arguments:arguments},success:function(e){}}),!1}),jQuery(document).on("click","#um-search-button",function(){jQuery(this).parents("form").submit()}),jQuery(".um-form input[class=um-button][type=submit]").removeAttr("disabled"),jQuery(document).one("click",".um:not(.um-account) .um-form input[class=um-button][type=submit]:not(.um-has-recaptcha)",function(){jQuery(this).attr("disabled","disabled"),jQuery(this).parents("form").submit()});var o={};function d(e,t,a,i){var r=e.data("um-parent");e.attr("name"),jQuery('select[name="'+r+'"]');e.find('option[value!=""]').remove(),e.hasClass("um-child-option-disabled")||e.removeAttr("disabled");i=[];var n="";if("yes"===t.post.members_directory){var u=new URLSearchParams(window.location.search);n=u.get(t.post.child_name)}jQuery.each(t.items,function(e,t){i.push({id:e,text:t,selected:t===n})}),e.select2("destroy"),e.select2({data:i,allowClear:!0,minimumResultsForSearch:10}),"yes"!==t.post.members_directory&&(void 0===t.field.default||e.data("um-original-value")?""!=e.data("um-original-value")&&e.val(e.data("um-original-value")).trigger("change"):e.val(t.field.default).trigger("change"),0==t.field.editable&&(e.addClass("um-child-option-disabled"),e.attr("disabled","disabled"))),o[a]=t}jQuery("select[data-um-parent]").each(function(){var r=jQuery(this),n=r.data("um-parent"),u=(r.data("um-ajax-url"),r.data("um-ajax-source"));r.val();r.attr("data-um-init-field",!0),jQuery(document).on("change",'select[name="'+n+'"]',function(){var t=jQuery(this),e=t.closest("form").find("input[type=hidden][name=form_id]").val(),a=t.val();if(""!=t.val()&&"object"!=typeof o[a]&&jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_select_options",parent_option_name:n,parent_option:t.val(),child_callback:u,child_name:r.attr("name"),members_directory:r.attr("data-mebers-directory"),form_id:e},success:function(e){"success"==e.status&&""!=t.val()&&d(r,e,a),void 0!==e.debug&&console.log(e)},error:function(e){console.log(e)}}),""!=t.val()&&"object"==typeof o[a]){var i=o[a];d(r,i,a)}""==t.val()&&(r.find('option[value!=""]').remove(),r.val("").trigger("change"))}),jQuery('select[name="'+n+'"]').trigger("change")})});
includes/admin/templates/extensions.php CHANGED
@@ -117,7 +117,21 @@ $premium['private-content'] = array(
117
'url' => 'https://ultimatemember.com/extensions/private-content/',
118
'image' => 'https://ultimatemember.com/wp-content/uploads/bb-plugin/cache/private-content-page-circle.png',
119
'name' => 'Private Content',
120
- 'desc' => 'With the private content extension you can provide logged in users with content that only they can access and view',
121
);
122
123
117
'url' => 'https://ultimatemember.com/extensions/private-content/',
118
'image' => 'https://ultimatemember.com/wp-content/uploads/bb-plugin/cache/private-content-page-circle.png',
119
'name' => 'Private Content',
120
+ 'desc' => 'Display private content to logged in users that only they can access',
121
+ );
122
+
123
+ $premium['groups'] = array(
124
+ 'url' => 'https://ultimatemember.com/extensions/groups/',
125
+ 'image' => 'https://ultimatemember.com/wp-content/uploads/edd/2018/10/groupimage.png',
126
+ 'name' => 'Groups',
127
+ 'desc' => 'Allow users to create and join groups around shared topics, interests etc.',
128
+ );
129
+
130
+ $premium['user-photos'] = array(
131
+ 'url' => 'https://ultimatemember.com/extensions/user-photos/',
132
+ 'image' => 'https://ultimatemember.com/wp-content/uploads/edd/2018/06/User-Photos.png',
133
+ 'name' => 'User Photos',
134
+ 'desc' => 'Allow users to upload photos to their profile',
135
);
136
137
includes/core/class-ajax-common.php CHANGED
@@ -36,7 +36,10 @@ if ( ! class_exists( 'um\core\AJAX_Common' ) ) {
36
37
add_action( 'wp_ajax_um_delete_profile_photo', array( UM()->profile(), 'ajax_delete_profile_photo' ) );
38
add_action( 'wp_ajax_um_delete_cover_photo', array( UM()->profile(), 'ajax_delete_cover_photo' ) );
39
add_action( 'wp_ajax_um_ajax_paginate', array( UM()->query(), 'ajax_paginate' ) );
40
add_action( 'wp_ajax_um_muted_action', array( UM()->form(), 'ajax_muted_action' ) );
41
42
add_action( 'wp_ajax_um_remove_file', array( UM()->files(), 'ajax_remove_file' ) );
36
37
add_action( 'wp_ajax_um_delete_profile_photo', array( UM()->profile(), 'ajax_delete_profile_photo' ) );
38
add_action( 'wp_ajax_um_delete_cover_photo', array( UM()->profile(), 'ajax_delete_cover_photo' ) );
39
+
40
add_action( 'wp_ajax_um_ajax_paginate', array( UM()->query(), 'ajax_paginate' ) );
41
+ add_action( 'wp_ajax_um_ajax_paginate_posts', array( UM()->user_posts(), 'load_posts' ) );
42
+
43
add_action( 'wp_ajax_um_muted_action', array( UM()->form(), 'ajax_muted_action' ) );
44
45
add_action( 'wp_ajax_um_remove_file', array( UM()->files(), 'ajax_remove_file' ) );
includes/core/class-fields.php CHANGED
@@ -2313,6 +2313,13 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
2313
} else {
2314
$file_url = UM()->files()->get_download_link( $this->set_id, $key, um_user( 'ID' ) );
2315
$file_dir = UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . $this->field_value( $key, $default, $data );
2316
}
2317
2318
if ( file_exists( $file_dir ) ) {
2313
} else {
2314
$file_url = UM()->files()->get_download_link( $this->set_id, $key, um_user( 'ID' ) );
2315
$file_dir = UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . $this->field_value( $key, $default, $data );
2316
+
2317
+ if ( ! file_exists( $file_dir ) ) {
2318
+ if ( is_multisite() ) {
2319
+ //multisite fix for old customers
2320
+ $file_dir = str_replace( DIRECTORY_SEPARATOR . 'sites' . DIRECTORY_SEPARATOR . get_current_blog_id() . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $file_dir );
2321
+ }
2322
+ }
2323
}
2324
2325
if ( file_exists( $file_dir ) ) {
includes/core/class-files.php CHANGED
@@ -161,11 +161,19 @@ if ( ! class_exists( 'um\core\Files' ) ) {
161
*/
162
function image_download( $user_id, $field_key, $field_value ) {
163
$file_path = UM()->uploader()->get_upload_base_dir() . $user_id . DIRECTORY_SEPARATOR . $field_value;
164
$file_info = get_user_meta( $user_id, $field_key . "_metadata", true );
165
166
$size = filesize( $file_path );
167
- $originalname = $file_info['original_name'];
168
- $type = $file_info['type'];
169
170
header('Content-Description: File Transfer');
171
header('Content-Type: ' . $type );
@@ -187,11 +195,19 @@ if ( ! class_exists( 'um\core\Files' ) ) {
187
*/
188
function file_download( $user_id, $field_key, $field_value ) {
189
$file_path = UM()->uploader()->get_upload_base_dir() . $user_id . DIRECTORY_SEPARATOR . $field_value;
190
$file_info = get_user_meta( $user_id, $field_key . "_metadata", true );
191
192
$size = filesize( $file_path );
193
- $originalname = $file_info['original_name'];
194
- $type = $file_info['type'];
195
196
header('Content-Description: File Transfer');
197
header('Content-Type: ' . $type );
161
*/
162
function image_download( $user_id, $field_key, $field_value ) {
163
$file_path = UM()->uploader()->get_upload_base_dir() . $user_id . DIRECTORY_SEPARATOR . $field_value;
164
+ if ( ! file_exists( $file_path ) ) {
165
+ if ( is_multisite() ) {
166
+ //multisite fix for old customers
167
+ $file_path = str_replace( DIRECTORY_SEPARATOR . 'sites' . DIRECTORY_SEPARATOR . get_current_blog_id() . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $file_path );
168
+ }
169
+ }
170
+
171
$file_info = get_user_meta( $user_id, $field_key . "_metadata", true );
172
173
+ $pathinfo = pathinfo( $file_path );
174
$size = filesize( $file_path );
175
+ $originalname = ! empty( $file_info['original_name'] ) ? $file_info['original_name'] : $pathinfo['basename'];
176
+ $type = ! empty( $file_info['type'] ) ? $file_info['type'] : $pathinfo['extension'];
177
178
header('Content-Description: File Transfer');
179
header('Content-Type: ' . $type );
195
*/
196
function file_download( $user_id, $field_key, $field_value ) {
197
$file_path = UM()->uploader()->get_upload_base_dir() . $user_id . DIRECTORY_SEPARATOR . $field_value;
198
+ if ( ! file_exists( $file_path ) ) {
199
+ if ( is_multisite() ) {
200
+ //multisite fix for old customers
201
+ $file_path = str_replace( DIRECTORY_SEPARATOR . 'sites' . DIRECTORY_SEPARATOR . get_current_blog_id() . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $file_path );
202
+ }
203
+ }
204
+
205
$file_info = get_user_meta( $user_id, $field_key . "_metadata", true );
206
207
+ $pathinfo = pathinfo( $file_path );
208
$size = filesize( $file_path );
209
+ $originalname = ! empty( $file_info['original_name'] ) ? $file_info['original_name'] : $pathinfo['basename'];
210
+ $type = ! empty( $file_info['type'] ) ? $file_info['type'] : $pathinfo['extension'];
211
212
header('Content-Description: File Transfer');
213
header('Content-Type: ' . $type );
includes/core/class-shortcodes.php CHANGED
@@ -272,14 +272,11 @@ if ( ! class_exists( 'um\core\Shortcodes' ) ) {
272
273
$file = um_path . "templates/{$tpl}.php";
274
$theme_file = get_stylesheet_directory() . "/ultimate-member/templates/{$tpl}.php";
275
-
276
-
277
if ( file_exists( $theme_file ) ) {
278
$file = $theme_file;
279
}
280
281
if ( file_exists( $file ) ) {
282
-
283
include $file;
284
}
285
}
272
273
$file = um_path . "templates/{$tpl}.php";
274
$theme_file = get_stylesheet_directory() . "/ultimate-member/templates/{$tpl}.php";
275
if ( file_exists( $theme_file ) ) {
276
$file = $theme_file;
277
}
278
279
if ( file_exists( $file ) ) {
280
include $file;
281
}
282
}
includes/core/class-user-posts.php CHANGED
@@ -20,32 +20,109 @@ if ( ! class_exists( 'um\core\User_posts' ) ) {
20
add_action( 'um_profile_content_posts', array( &$this, 'add_posts' ) );
21
add_action( 'um_profile_content_comments', array( &$this, 'add_comments' ) );
22
23
- add_action( 'um_ajax_load_posts__um_load_posts', array( &$this, 'load_posts' ) );
24
- add_action( 'um_ajax_load_posts__um_load_comments', array( &$this, 'load_comments' ) );
25
}
26
27
28
/**
29
- * Dynamic load of posts
30
- *
31
- * @param array $args
32
*/
33
- function load_posts( $args ) {
34
- $array = explode(',', $args );
35
- $post_type = $array[0];
36
- $posts_per_page = $array[1];
37
- $offset = $array[2];
38
- $author = $array[3];
39
40
- $offset_n = $posts_per_page + $offset;
41
42
- UM()->shortcodes()->modified_args = "$post_type,$posts_per_page,$offset_n,$author";
43
44
- UM()->shortcodes()->loop = UM()->query()->make("post_type=$post_type&posts_per_page=$posts_per_page&offset=$offset&author=$author");
45
46
- UM()->shortcodes()->load_template('profile/posts-single');
47
}
48
49
/**
50
* Dynamic load of comments
51
*
@@ -68,22 +145,6 @@ if ( ! class_exists( 'um\core\User_posts' ) ) {
68
}
69
70
71
- /**
72
- * Add posts
73
- */
74
- function add_posts() {
75
- UM()->shortcodes()->load_template( 'profile/posts' );
76
- }
77
-
78
-
79
- /**
80
- * Add comments
81
- */
82
- function add_comments() {
83
- UM()->shortcodes()->load_template( 'profile/comments' );
84
- }
85
-
86
-
87
/**
88
* Count posts by type
89
*
20
add_action( 'um_profile_content_posts', array( &$this, 'add_posts' ) );
21
add_action( 'um_profile_content_comments', array( &$this, 'add_comments' ) );
22
23
+ add_action( 'um_ajax_load_posts__um_load_comments', array( &$this, 'load_comments' ), 10, 1 );
24
}
25
26
27
/**
28
+ * Add posts
29
*/
30
+ function add_posts() {
31
32
+ $args = array(
33
+ 'post_type' => 'post',
34
+ 'posts_per_page' => 10,
35
+ 'offset' => 0,
36
+ 'author' => um_get_requested_user(),
37
+ 'post_status' => array( 'publish' )
38
+ );
39
40
+ /**
41
+ * UM hook
42
+ *
43
+ * @type filter
44
+ * @title um_profile_query_make_posts
45
+ * @description Some changes of WP_Query Posts Tab
46
+ * @input_vars
47
+ * [{"var":"$query_posts","type":"WP_Query","desc":"UM Posts Tab query"}]
48
+ * @change_log
49
+ * ["Since: 2.0"]
50
+ * @usage
51
+ * <?php add_filter( 'um_profile_query_make_posts', 'function_name', 10, 1 ); ?>
52
+ * @example
53
+ * <?php
54
+ * add_filter( 'um_profile_query_make_posts', 'my_profile_query_make_posts', 10, 1 );
55
+ * function my_profile_query_make_posts( $query_posts ) {
56
+ * // your code here
57
+ * return $query_posts;
58
+ * }
59
+ * ?>
60
+ */
61
+ $args = apply_filters( 'um_profile_query_make_posts', $args );
62
+ $posts = get_posts( $args );
63
64
+ $count_posts = wp_count_posts();
65
+ $count_posts = ! empty( $count_posts->publish ) ? $count_posts->publish : 0;
66
67
+ UM()->shortcodes()->set_args = array( 'posts' => $posts, 'count_posts' => $count_posts );
68
+ UM()->shortcodes()->load_template( 'profile/posts' );
69
}
70
71
+
72
+ /**
73
+ * Add comments
74
+ */
75
+ function add_comments() {
76
+ UM()->shortcodes()->load_template( 'profile/comments' );
77
+ }
78
+
79
+
80
+ /**
81
+ * Dynamic load of posts
82
+ *
83
+ */
84
+ function load_posts() {
85
+ $author = ! empty( $_POST['author'] ) ? $_POST['author'] : get_current_user_id();
86
+ $page = ! empty( $_POST['page'] ) ? $_POST['page'] : 0;
87
+
88
+ $args = array(
89
+ 'post_type' => 'post',
90
+ 'posts_per_page' => 10,
91
+ 'offset' => ( $page - 1 ) * 10,
92
+ 'author' => $author,
93
+ 'post_status' => array( 'publish' )
94
+ );
95
+
96
+ /**
97
+ * UM hook
98
+ *
99
+ * @type filter
100
+ * @title um_profile_query_make_posts
101
+ * @description Some changes of WP_Query Posts Tab
102
+ * @input_vars
103
+ * [{"var":"$query_posts","type":"WP_Query","desc":"UM Posts Tab query"}]
104
+ * @change_log
105
+ * ["Since: 2.0"]
106
+ * @usage
107
+ * <?php add_filter( 'um_profile_query_make_posts', 'function_name', 10, 1 ); ?>
108
+ * @example
109
+ * <?php
110
+ * add_filter( 'um_profile_query_make_posts', 'my_profile_query_make_posts', 10, 1 );
111
+ * function my_profile_query_make_posts( $query_posts ) {
112
+ * // your code here
113
+ * return $query_posts;
114
+ * }
115
+ * ?>
116
+ */
117
+ $args = apply_filters( 'um_profile_query_make_posts', $args );
118
+ $posts = get_posts( $args );
119
+
120
+ UM()->shortcodes()->set_args = array( 'posts' => $posts );
121
+ UM()->shortcodes()->load_template( 'profile/posts' );
122
+ wp_die();
123
+ }
124
+
125
+
126
/**
127
* Dynamic load of comments
128
*
145
}
146
147
148
/**
149
* Count posts by type
150
*
includes/core/class-user.php CHANGED
@@ -1214,12 +1214,14 @@ if ( ! class_exists( 'um\core\User' ) ) {
1214
?>
1215
*
1216
*/
1217
- function approve() {
1218
$user_id = um_user('ID');
1219
1220
- $status = get_user_meta( $user_id, 'account_status', true );
1221
- if ( 'approved' === $status ) {
1222
- return;
1223
}
1224
1225
delete_option( "um_cache_userdata_{$user_id}" );
1214
?>
1215
*
1216
*/
1217
+ function approve( $repeat = true ) {
1218
$user_id = um_user('ID');
1219
1220
+ if ( ! $repeat ) {
1221
+ $status = get_user_meta( $user_id, 'account_status', true );
1222
+ if ( 'approved' === $status ) {
1223
+ return;
1224
+ }
1225
}
1226
1227
delete_option( "um_cache_userdata_{$user_id}" );
includes/core/um-actions-login.php CHANGED
@@ -47,16 +47,18 @@ function um_submit_form_errors_hook_login( $args ) {
47
$user_name = $args['user_login'];
48
}
49
50
- if ( !username_exists( $user_name ) ) {
51
if ( $is_email ) {
52
UM()->form()->add_error( $field, __(' Sorry, we can\'t find an account with that email address','ultimate-member') );
53
} else {
54
UM()->form()->add_error( $field, __(' Sorry, we can\'t find an account with that username','ultimate-member') );
55
}
56
} else {
57
- if ( $args['user_password'] == '' ) {
58
- UM()->form()->add_error( 'user_password', __('Please enter your password','ultimate-member') );
59
- }
60
}
61
62
$user = get_user_by( 'login', $user_name );
@@ -100,26 +102,29 @@ add_action( 'um_submit_form_errors_hook_login', 'um_submit_form_errors_hook_logi
100
*/
101
function um_display_login_errors( $args ) {
102
$error = '';
103
-
104
- if( UM()->form()->count_errors() > 0 ) {
105
$errors = UM()->form()->errors;
106
// hook for other plugins to display error
107
$error_keys = array_keys( $errors );
108
- }
109
110
- if( isset( $args['custom_fields'] ) ){
111
- $custom_fields = $args['custom_fields'];
112
- }
113
114
- if( ! empty( $error_keys ) && ! empty( $custom_fields ) ){
115
- foreach( $error_keys as $error ){
116
- if( trim( $error ) && ! isset( $custom_fields[ $error ] ) && ! empty( $errors[ $error ] ) ){
117
- $error_message = apply_filters( 'login_errors', $errors[ $error ] );
118
- echo '<p class="um-notice err um-error-code-'.$error.'"><i class="um-icon-ios-close-empty" onclick="jQuery(this).parent().fadeOut();"></i>' . $error_message . '</p>';
119
}
120
}
121
}
122
}
123
add_action( 'um_before_login_fields', 'um_display_login_errors' );
124
125
@@ -421,12 +426,12 @@ function um_add_submit_button_to_login( $args ) {
421
422
<?php if ( isset($args['secondary_btn']) && $args['secondary_btn'] != 0 ) { ?>
423
424
- <div class="um-left um-half"><input type="submit" value="<?php echo __( $primary_btn_word,'ultimate-member'); ?>" class="um-button" id="um-submit-btn" /></div>
425
- <div class="um-right um-half"><a href="<?php echo $secondary_btn_url; ?>" class="um-button um-alt"><?php echo __( $secondary_btn_word,'ultimate-member'); ?></a></div>
426
427
<?php } else { ?>
428
429
- <div class="um-center"><input type="submit" value="<?php echo __( $args['primary_btn_word'],'ultimate-member'); ?>" class="um-button" id="um-submit-btn" /></div>
430
431
<?php } ?>
432
47
$user_name = $args['user_login'];
48
}
49
50
+ /*if ( !username_exists( $user_name ) ) {
51
if ( $is_email ) {
52
UM()->form()->add_error( $field, __(' Sorry, we can\'t find an account with that email address','ultimate-member') );
53
} else {
54
UM()->form()->add_error( $field, __(' Sorry, we can\'t find an account with that username','ultimate-member') );
55
}
56
} else {
57
+
58
+ }*/
59
+
60
+ if ( $args['user_password'] == '' ) {
61
+ UM()->form()->add_error( 'user_password', __('Please enter your password','ultimate-member') );
62
}
63
64
$user = get_user_by( 'login', $user_name );
102
*/
103
function um_display_login_errors( $args ) {
104
$error = '';
105
+
106
+ if ( UM()->form()->count_errors() > 0 ) {
107
$errors = UM()->form()->errors;
108
// hook for other plugins to display error
109
$error_keys = array_keys( $errors );
110
+ }
111
112
+ if ( isset( $args['custom_fields'] ) ) {
113
+ $custom_fields = $args['custom_fields'];
114
+ }
115
116
+ if ( ! empty( $error_keys ) && ! empty( $custom_fields ) ) {
117
+ foreach ( $error_keys as $error ) {
118
+ if ( trim( $error ) && ! isset( $custom_fields[ $error ] ) && ! empty( $errors[ $error ] ) ) {
119
+ $error_message = apply_filters( 'login_errors', $errors[ $error ], $error );
120
+ if ( empty( $error_message ) ) {
121
+ return;
122
}
123
+ echo '<p class="um-notice err um-error-code-' . esc_attr( $error ) . '"><i class="um-icon-ios-close-empty" onclick="jQuery(this).parent().fadeOut();"></i>' . $error_message . '</p>';
124
}
125
}
126
}
127
+ }
128
add_action( 'um_before_login_fields', 'um_display_login_errors' );
129
130
426
427
<?php if ( isset($args['secondary_btn']) && $args['secondary_btn'] != 0 ) { ?>
428
429
+ <div class="um-left um-half"><input type="submit" value="<?php esc_attr_e( $primary_btn_word, 'ultimate-member' ); ?>" class="um-button" id="um-submit-btn" /></div>
430
+ <div class="um-right um-half"><a href="<?php echo esc_attr( $secondary_btn_url ); ?>" class="um-button um-alt"><?php esc_attr_e( $secondary_btn_word,'ultimate-member'); ?></a></div>
431
432
<?php } else { ?>
433
434
+ <div class="um-center"><input type="submit" value="<?php esc_attr_e( $args['primary_btn_word'],'ultimate-member' ); ?>" class="um-button" id="um-submit-btn" /></div>
435
436
<?php } ?>
437
includes/core/um-actions-profile.php CHANGED
@@ -1195,15 +1195,15 @@ function um_add_submit_button_to_profile( $args ) {
1195
1196
<?php if (isset( $args['secondary_btn'] ) && $args['secondary_btn'] != 0) { ?>
1197
1198
- <div class="um-left um-half"><input type="submit" value="<?php echo $args['primary_btn_word']; ?>"
1199
class="um-button"/></div>
1200
- <div class="um-right um-half"><a href="<?php echo um_edit_my_profile_cancel_uri(); ?>"
1201
- class="um-button um-alt"><?php echo $args['secondary_btn_word']; ?></a>
1202
</div>
1203
1204
<?php } else { ?>
1205
1206
- <div class="um-center"><input type="submit" value="<?php echo $args['primary_btn_word']; ?>"
1207
class="um-button"/></div>
1208
1209
<?php } ?>
1195
1196
<?php if (isset( $args['secondary_btn'] ) && $args['secondary_btn'] != 0) { ?>
1197
1198
+ <div class="um-left um-half"><input type="submit" value="<?php esc_attr_e( $args['primary_btn_word'], 'ultimate-member' ); ?>"
1199
class="um-button"/></div>
1200
+ <div class="um-right um-half"><a href="<?php echo esc_attr( um_edit_my_profile_cancel_uri() ); ?>"
1201
+ class="um-button um-alt"><?php esc_attr_e( $args['secondary_btn_word'], 'ultimate-member' ); ?></a>
1202
</div>
1203
1204
<?php } else { ?>
1205
1206
+ <div class="um-center"><input type="submit" value="<?php esc_attr_e( $args['primary_btn_word'], 'ultimate-member' ); ?>"
1207
class="um-button"/></div>
1208
1209
<?php } ?>
includes/core/um-actions-register.php CHANGED
@@ -585,12 +585,12 @@ function um_add_submit_button_to_register( $args ) {
585
586
<?php if ( isset($args['secondary_btn']) && $args['secondary_btn'] != 0 ) { ?>
587
588
- <div class="um-left um-half"><input type="submit" value="<?php echo __( $primary_btn_word,'ultimate-member'); ?>" class="um-button" id="um-submit-btn" /></div>
589
- <div class="um-right um-half"><a href="<?php echo $secondary_btn_url; ?>" class="um-button um-alt"><?php echo __( $secondary_btn_word,'ultimate-member'); ?></a></div>
590
591
<?php } else { ?>
592
593
- <div class="um-center"><input type="submit" value="<?php echo __( $primary_btn_word,'ultimate-member'); ?>" class="um-button" id="um-submit-btn" /></div>
594
595
<?php } ?>
596
585
586
<?php if ( isset($args['secondary_btn']) && $args['secondary_btn'] != 0 ) { ?>
587
588
+ <div class="um-left um-half"><input type="submit" value="<?php esc_attr_e( $primary_btn_word,'ultimate-member' ) ?>" class="um-button" id="um-submit-btn" /></div>
589
+ <div class="um-right um-half"><a href="<?php echo esc_attr( $secondary_btn_url ); ?>" class="um-button um-alt"><?php esc_attr_e( $secondary_btn_word,'ultimate-member'); ?></a></div>
590
591
<?php } else { ?>
592
593
+ <div class="um-center"><input type="submit" value="<?php esc_attr_e( $primary_btn_word,'ultimate-member' ) ?>" class="um-button" id="um-submit-btn" /></div>
594
595
<?php } ?>
596
includes/core/um-filters-fields.php CHANGED
@@ -226,7 +226,20 @@ function um_profile_field_filter_hook__file( $value, $data ) {
226
$file_type = wp_check_filetype( $value );
227
$uri = UM()->files()->get_download_link( UM()->fields()->set_id, $data['metakey'], um_user( 'ID' ) );
228
229
if ( ! file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . $value ) ) {
230
$value = __( 'This file has been removed.', 'ultimate-member' );
231
} else {
232
$file_info = um_user( $data['metakey'] . "_metadata" );
@@ -260,11 +273,24 @@ function um_profile_field_filter_hook__image( $value, $data ) {
260
$uri = UM()->files()->get_download_link( UM()->fields()->set_id, $data['metakey'], um_user( 'ID' ) );
261
$title = ( isset( $data['title'] ) ) ? $data['title'] : __( 'Untitled photo', 'ultimate-member' );
262
263
// if value is an image tag
264
if( preg_match( '/\<img.*src=\"([^"]+).*/', $value, $matches ) ) {
265
$uri = $matches[1];
266
$value = '<div class="um-photo"><a href="#" class="um-photo-modal" data-src="' . esc_attr( $uri ) . '"><img src="' . esc_attr( $uri ) . '" alt="' . esc_attr( $title ) . '" title="' . esc_attr( $title ) . '" class="" /></a></div>';
267
- } else if ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . $value ) ) {
268
$value = '<div class="um-photo"><a href="#" class="um-photo-modal" data-src="' . esc_attr( $uri ) . '"><img src="' . esc_attr( $uri ) . '" alt="' . esc_attr( $title ) . '" title="' . esc_attr( $title ) . '" class="" /></a></div>';
269
} else {
270
$value = '';
@@ -637,6 +663,26 @@ function um_profile_field_filter_xss_validation( $value, $data, $type = '' ) {
637
add_filter( 'um_profile_field_filter_hook__','um_profile_field_filter_xss_validation', 10, 3 );
638
639
640
/**
641
* add role_select and role_radio to the $post_form
642
* It is necessary for that if on these fields the conditional logic
226
$file_type = wp_check_filetype( $value );
227
$uri = UM()->files()->get_download_link( UM()->fields()->set_id, $data['metakey'], um_user( 'ID' ) );
228
229
+ $removed = false;
230
if ( ! file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . $value ) ) {
231
+ if ( is_multisite() ) {
232
+ //multisite fix for old customers
233
+ $file_path = str_replace( DIRECTORY_SEPARATOR . 'sites' . DIRECTORY_SEPARATOR . get_current_blog_id() . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . $value );
234
+ if ( ! file_exists( $file_path ) ) {
235
+ $removed = true;
236
+ }
237
+ } else {
238
+ $removed = true;
239
+ }
240
+ }
241
+
242
+ if ( $removed ) {
243
$value = __( 'This file has been removed.', 'ultimate-member' );
244
} else {
245
$file_info = um_user( $data['metakey'] . "_metadata" );
273
$uri = UM()->files()->get_download_link( UM()->fields()->set_id, $data['metakey'], um_user( 'ID' ) );
274
$title = ( isset( $data['title'] ) ) ? $data['title'] : __( 'Untitled photo', 'ultimate-member' );
275
276
+ $removed = false;
277
+ if ( ! file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . $value ) ) {
278
+ if ( is_multisite() ) {
279
+ //multisite fix for old customers
280
+ $file_path = str_replace( DIRECTORY_SEPARATOR . 'sites' . DIRECTORY_SEPARATOR . get_current_blog_id() . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . $value );
281
+ if ( ! file_exists( $file_path ) ) {
282
+ $removed = true;
283
+ }
284
+ } else {
285
+ $removed = true;
286
+ }
287
+ }
288
+
289
// if value is an image tag
290
if( preg_match( '/\<img.*src=\"([^"]+).*/', $value, $matches ) ) {
291
$uri = $matches[1];
292
$value = '<div class="um-photo"><a href="#" class="um-photo-modal" data-src="' . esc_attr( $uri ) . '"><img src="' . esc_attr( $uri ) . '" alt="' . esc_attr( $title ) . '" title="' . esc_attr( $title ) . '" class="" /></a></div>';
293
+ } else if ( ! $removed ) {
294
$value = '<div class="um-photo"><a href="#" class="um-photo-modal" data-src="' . esc_attr( $uri ) . '"><img src="' . esc_attr( $uri ) . '" alt="' . esc_attr( $title ) . '" title="' . esc_attr( $title ) . '" class="" /></a></div>';
295
} else {
296
$value = '';
663
add_filter( 'um_profile_field_filter_hook__','um_profile_field_filter_xss_validation', 10, 3 );
664
665
666
+ /**
667
+ * Trim All form POST submitted data
668
+ *
669
+ * @param $post_form
670
+ * @param $mode
671
+ *
672
+ * @return mixed
673
+ */
674
+ function um_submit_form_data_trim_fields( $post_form, $mode ) {
675
+ foreach ( $post_form as $key => $field ) {
676
+ if ( is_string( $field ) ) {
677
+ $post_form[ $key ] = trim( $field );
678
+ }
679
+ }
680
+
681
+ return $post_form;
682
+ }
683
+ add_filter( 'um_submit_form_data', 'um_submit_form_data_trim_fields', 9, 2 );
684
+
685
+
686
/**
687
* add role_select and role_radio to the $post_form
688
* It is necessary for that if on these fields the conditional logic
includes/um-short-functions.php CHANGED
@@ -556,10 +556,19 @@ function um_user_submitted_registration( $style = false ) {
556
if ( UM()->fields()->get_field_type( $k ) == 'image' || UM()->fields()->get_field_type( $k ) == 'file' ) {
557
$file = basename( $v );
558
$filedata = get_user_meta( um_user( 'ID' ), $k . "_metadata", true );
559
if ( ! empty( $filedata['original_name'] ) ) {
560
- $v = '<a href="' . esc_attr( UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . '/' . $file ) . '">' . $filedata['original_name'] . '</a>';
561
} else {
562
- $v = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . '/' . $file;
563
}
564
}
565
@@ -1659,8 +1668,27 @@ function um_closest_num( $array, $number ) {
1659
*/
1660
function um_get_cover_uri( $image, $attrs ) {
1661
$uri = false;
1662
$ext = '.' . pathinfo( $image, PATHINFO_EXTENSION );
1663
1664
if ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "cover_photo{$ext}" ) ) {
1665
$uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/cover_photo{$ext}?" . current_time( 'timestamp' );
1666
}
@@ -1670,6 +1698,11 @@ function um_get_cover_uri( $image, $attrs ) {
1670
} elseif ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "cover_photo-{$attrs}{$ext}" ) ) {
1671
$uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/cover_photo-{$attrs}{$ext}?" . current_time( 'timestamp' );
1672
}
1673
return $uri;
1674
}
1675
@@ -1699,8 +1732,64 @@ function um_get_avatar_url( $get_avatar ) {
1699
*/
1700
function um_get_avatar_uri( $image, $attrs ) {
1701
$uri = false;
1702
$find = false;
1703
$ext = '.' . pathinfo( $image, PATHINFO_EXTENSION );
1704
/**
1705
* UM hook
1706
*
@@ -1723,30 +1812,10 @@ function um_get_avatar_uri( $image, $attrs ) {
1723
* ?>
1724
*/
1725
$cache_time = apply_filters( 'um_filter_avatar_cache_time', current_time( 'timestamp' ), um_user( 'ID' ) );
1726
- if ( $attrs == 'original' && file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo{$ext}" ) ) {
1727
- $uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/profile_photo{$ext}";
1728
- } elseif ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo-{$attrs}x{$attrs}{$ext}" ) ) {
1729
- $uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/profile_photo-{$attrs}x{$attrs}{$ext}";
1730
- } elseif ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo-{$attrs}{$ext}" ) ) {
1731
- $uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/profile_photo-{$attrs}{$ext}";
1732
- } else {
1733
- $sizes = UM()->options()->get( 'photo_thumb_sizes' );
1734
- if ( is_array( $sizes ) ) {
1735
- $find = um_closest_num( $sizes, $attrs );
1736
- }
1737
-
1738
- if ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo-{$find}x{$find}{$ext}" ) ) {
1739
- $uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/profile_photo-{$find}x{$find}{$ext}";
1740
- } elseif ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo-{$find}{$ext}" ) ) {
1741
- $uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/profile_photo-{$find}{$ext}";
1742
- } elseif ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo{$ext}" ) ) {
1743
- $uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/profile_photo{$ext}";
1744
- }
1745
- }
1746
-
1747
if ( ! empty( $cache_time ) ) {
1748
$uri .= "?{$cache_time}";
1749
}
1750
return $uri;
1751
}
1752
556
if ( UM()->fields()->get_field_type( $k ) == 'image' || UM()->fields()->get_field_type( $k ) == 'file' ) {
557
$file = basename( $v );
558
$filedata = get_user_meta( um_user( 'ID' ), $k . "_metadata", true );
559
+
560
+ $baseurl = UM()->uploader()->get_upload_base_url();
561
+ if ( ! file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . $file ) ) {
562
+ if ( is_multisite() ) {
563
+ //multisite fix for old customers
564
+ $baseurl = str_replace( '/sites/' . get_current_blog_id() . '/', '/', $baseurl );
565
+ }
566
+ }
567
+
568
if ( ! empty( $filedata['original_name'] ) ) {
569
+ $v = '<a href="' . esc_attr( $baseurl . um_user( 'ID' ) . '/' . $file ) . '">' . $filedata['original_name'] . '</a>';
570
} else {
571
+ $v = $baseurl . um_user( 'ID' ) . '/' . $file;
572
}
573
}
574
1668
*/
1669
function um_get_cover_uri( $image, $attrs ) {
1670
$uri = false;
1671
+ $uri_common = false;
1672
$ext = '.' . pathinfo( $image, PATHINFO_EXTENSION );
1673
1674
+ if ( is_multisite() ) {
1675
+ //multisite fix for old customers
1676
+ $multisite_fix_dir = UM()->uploader()->get_upload_base_dir();
1677
+ $multisite_fix_url = UM()->uploader()->get_upload_base_url();
1678
+ $multisite_fix_dir = str_replace( DIRECTORY_SEPARATOR . 'sites' . DIRECTORY_SEPARATOR . get_current_blog_id() . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $multisite_fix_dir );
1679
+ $multisite_fix_url = str_replace( '/sites/' . get_current_blog_id() . '/', '/', $multisite_fix_url );
1680
+
1681
+ if ( file_exists( $multisite_fix_dir . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "cover_photo{$ext}" ) ) {
1682
+ $uri_common = $multisite_fix_url . um_user( 'ID' ) . "/cover_photo{$ext}?" . current_time( 'timestamp' );
1683
+ }
1684
+
1685
+ if ( file_exists( $multisite_fix_dir . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "cover_photo-{$attrs}x{$attrs}{$ext}" ) ) {
1686
+ $uri_common = $multisite_fix_url . um_user( 'ID' ) . "/cover_photo-{$attrs}x{$attrs}{$ext}?". current_time( 'timestamp' );
1687
+ } elseif ( file_exists( $multisite_fix_dir . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "cover_photo-{$attrs}{$ext}" ) ) {
1688
+ $uri_common = $multisite_fix_url . um_user( 'ID' ) . "/cover_photo-{$attrs}{$ext}?" . current_time( 'timestamp' );
1689
+ }
1690
+ }
1691
+
1692
if ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "cover_photo{$ext}" ) ) {
1693
$uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/cover_photo{$ext}?" . current_time( 'timestamp' );
1694
}
1698
} elseif ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "cover_photo-{$attrs}{$ext}" ) ) {
1699
$uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/cover_photo-{$attrs}{$ext}?" . current_time( 'timestamp' );
1700
}
1701
+
1702
+ if ( ! empty( $uri_common ) && empty( $uri ) ) {
1703
+ $uri = $uri_common;
1704
+ }
1705
+
1706
return $uri;
1707
}
1708
1732
*/
1733
function um_get_avatar_uri( $image, $attrs ) {
1734
$uri = false;
1735
+ $uri_common = false;
1736
$find = false;
1737
$ext = '.' . pathinfo( $image, PATHINFO_EXTENSION );
1738
+
1739
+ if ( is_multisite() ) {
1740
+ //multisite fix for old customers
1741
+ $multisite_fix_dir = UM()->uploader()->get_upload_base_dir();
1742
+ $multisite_fix_url = UM()->uploader()->get_upload_base_url();
1743
+ $multisite_fix_dir = str_replace( DIRECTORY_SEPARATOR . 'sites' . DIRECTORY_SEPARATOR . get_current_blog_id() . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $multisite_fix_dir );
1744
+ $multisite_fix_url = str_replace( '/sites/' . get_current_blog_id() . '/', '/', $multisite_fix_url );
1745
+
1746
+ if ( $attrs == 'original' && file_exists( $multisite_fix_dir . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo{$ext}" ) ) {
1747
+ $uri_common = $multisite_fix_url . um_user( 'ID' ) . "/profile_photo{$ext}";
1748
+ } elseif ( file_exists( $multisite_fix_dir . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo-{$attrs}x{$attrs}{$ext}" ) ) {
1749
+ $uri_common = $multisite_fix_url . um_user( 'ID' ) . "/profile_photo-{$attrs}x{$attrs}{$ext}";
1750
+ } elseif ( file_exists( $multisite_fix_dir . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo-{$attrs}{$ext}" ) ) {
1751
+ $uri_common = $multisite_fix_url . um_user( 'ID' ) . "/profile_photo-{$attrs}{$ext}";
1752
+ } else {
1753
+ $sizes = UM()->options()->get( 'photo_thumb_sizes' );
1754
+ if ( is_array( $sizes ) ) {
1755
+ $find = um_closest_num( $sizes, $attrs );
1756
+ }
1757
+
1758
+ if ( file_exists( $multisite_fix_dir . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo-{$find}x{$find}{$ext}" ) ) {
1759
+ $uri_common = $multisite_fix_url . um_user( 'ID' ) . "/profile_photo-{$find}x{$find}{$ext}";
1760
+ } elseif ( file_exists( $multisite_fix_dir . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo-{$find}{$ext}" ) ) {
1761
+ $uri_common = $multisite_fix_url . um_user( 'ID' ) . "/profile_photo-{$find}{$ext}";
1762
+ } elseif ( file_exists( $multisite_fix_dir . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo{$ext}" ) ) {
1763
+ $uri_common = $multisite_fix_url . um_user( 'ID' ) . "/profile_photo{$ext}";
1764
+ }
1765
+ }
1766
+ }
1767
+
1768
+ if ( $attrs == 'original' && file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo{$ext}" ) ) {
1769
+ $uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/profile_photo{$ext}";
1770
+ } elseif ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo-{$attrs}x{$attrs}{$ext}" ) ) {
1771
+ $uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/profile_photo-{$attrs}x{$attrs}{$ext}";
1772
+ } elseif ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo-{$attrs}{$ext}" ) ) {
1773
+ $uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/profile_photo-{$attrs}{$ext}";
1774
+ } else {
1775
+ $sizes = UM()->options()->get( 'photo_thumb_sizes' );
1776
+ if ( is_array( $sizes ) ) {
1777
+ $find = um_closest_num( $sizes, $attrs );
1778
+ }
1779
+
1780
+ if ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo-{$find}x{$find}{$ext}" ) ) {
1781
+ $uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/profile_photo-{$find}x{$find}{$ext}";
1782
+ } elseif ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo-{$find}{$ext}" ) ) {
1783
+ $uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/profile_photo-{$find}{$ext}";
1784
+ } elseif ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo{$ext}" ) ) {
1785
+ $uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/profile_photo{$ext}";
1786
+ }
1787
+ }
1788
+
1789
+ if ( ! empty( $uri_common ) && empty( $uri ) ) {
1790
+ $uri = $uri_common;
1791
+ }
1792
+
1793
/**
1794
* UM hook
1795
*
1812
* ?>
1813
*/
1814
$cache_time = apply_filters( 'um_filter_avatar_cache_time', current_time( 'timestamp' ), um_user( 'ID' ) );
1815
if ( ! empty( $cache_time ) ) {
1816
$uri .= "?{$cache_time}";
1817
}
1818
+
1819
return $uri;
1820
}
1821
languages/ultimate-member-en_US.mo CHANGED
Binary file
languages/ultimate-member-en_US.po CHANGED
@@ -1,8 +1,8 @@
1
msgid ""
2
msgstr ""
3
"Project-Id-Version: Ultimate Member\n"
4
- "POT-Creation-Date: 2018-10-02 21:48+0300\n"
5
- "PO-Revision-Date: 2018-10-02 21:48+0300\n"
6
"Last-Translator: \n"
7
"Language-Team: \n"
8
"Language: en_US\n"
@@ -115,7 +115,7 @@ msgstr ""
115
116
#: includes/admin/core/class-admin-builder.php:609
117
#: includes/admin/core/class-admin-builder.php:763
118
- #: includes/core/class-fields.php:4026
119
msgid "Please login as administrator"
120
msgstr ""
121
@@ -3526,7 +3526,7 @@ msgstr ""
3526
#: includes/admin/templates/modal/dynamic_new_group.php:14
3527
#: includes/admin/templates/modal/fonticons.php:11
3528
#: includes/admin/templates/role/publish.php:24
3529
- #: includes/core/class-fields.php:2272 includes/core/class-fields.php:2362
3530
#: includes/core/um-actions-profile.php:554
3531
#: includes/core/um-actions-profile.php:693
3532
#: includes/core/um-actions-profile.php:726
@@ -4165,7 +4165,7 @@ msgstr ""
4165
msgid "You must add a shortcode to the content area"
4166
msgstr ""
4167
4168
- #: includes/core/class-builtin.php:663 includes/core/class-user.php:1536
4169
msgid "Only me"
4170
msgstr ""
4171
@@ -6294,7 +6294,7 @@ msgstr ""
6294
msgid "Change photo"
6295
msgstr ""
6296
6297
- #: includes/core/class-fields.php:2271 includes/core/class-fields.php:2361
6298
msgid "Processing..."
6299
msgstr ""
6300
@@ -6302,58 +6302,58 @@ msgstr ""
6302
msgid "Upload File"
6303
msgstr ""
6304
6305
- #: includes/core/class-fields.php:2328 includes/core/um-filters-fields.php:230
6306
msgid "This file has been removed."
6307
msgstr ""
6308
6309
- #: includes/core/class-fields.php:2331 includes/core/class-fields.php:2361
6310
msgid "Change file"
6311
msgstr ""
6312
6313
- #: includes/core/class-fields.php:2361
6314
msgid "Save"
6315
msgstr ""
6316
6317
- #: includes/core/class-fields.php:3784
6318
#, php-format
6319
msgid ""
6320
"Your profile is looking a little empty. Why not <a href=\"%s\">add</a> some "
6321
"information!"
6322
msgstr ""
6323
6324
- #: includes/core/class-fields.php:3786
6325
msgid "This user has not added any information to their profile yet."
6326
msgstr ""
6327
6328
- #: includes/core/class-files.php:240
6329
msgid "Invalid parameters"
6330
msgstr ""
6331
6332
- #: includes/core/class-files.php:245
6333
msgid "Invalid coordinates"
6334
msgstr ""
6335
6336
- #: includes/core/class-files.php:250
6337
msgid "Invalid file ownership"
6338
msgstr ""
6339
6340
- #: includes/core/class-files.php:303
6341
msgid "Invalid nonce"
6342
msgstr ""
6343
6344
- #: includes/core/class-files.php:323 includes/core/class-files.php:408
6345
msgid "A theme or plugin compatibility issue"
6346
msgstr ""
6347
6348
- #: includes/core/class-files.php:951
6349
msgid "Ultimate Member: Not a valid temp file"
6350
msgstr ""
6351
6352
- #: includes/core/class-files.php:1079
6353
msgid "Invalid user ID: "
6354
msgstr ""
6355
6356
- #: includes/core/class-files.php:1088 includes/core/class-files.php:1116
6357
msgid "Unauthorized to do this attempt."
6358
msgstr ""
6359
@@ -6513,17 +6513,17 @@ msgstr ""
6513
msgid "Wrong nonce"
6514
msgstr ""
6515
6516
- #: includes/core/class-shortcodes.php:358
6517
msgid ""
6518
"This content has been restricted to logged in users only. Please <a href="
6519
"\"{login_referrer}\">login</a> to view this content."
6520
msgstr ""
6521
6522
- #: includes/core/class-shortcodes.php:518
6523
msgid "You are already registered"
6524
msgstr ""
6525
6526
- #: includes/core/class-shortcodes.php:760
6527
msgid "Default Template"
6528
msgstr ""
6529
@@ -6778,31 +6778,23 @@ msgstr ""
6778
msgid "Please enter your email"
6779
msgstr ""
6780
6781
- #: includes/core/um-actions-login.php:52
6782
- msgid " Sorry, we can't find an account with that email address"
6783
- msgstr ""
6784
-
6785
- #: includes/core/um-actions-login.php:54
6786
- msgid " Sorry, we can't find an account with that username"
6787
- msgstr ""
6788
-
6789
- #: includes/core/um-actions-login.php:58
6790
msgid "Please enter your password"
6791
msgstr ""
6792
6793
- #: includes/core/um-actions-login.php:66
6794
msgid "Password is incorrect. Please try again."
6795
msgstr ""
6796
6797
- #: includes/core/um-actions-login.php:194
6798
msgid "This action has been prevented for security measures."
6799
msgstr ""
6800
6801
- #: includes/core/um-actions-login.php:418
6802
msgid "Keep me signed in"
6803
msgstr ""
6804
6805
- #: includes/core/um-actions-login.php:453
6806
msgid "Forgot your password?"
6807
msgstr ""
6808
@@ -6952,7 +6944,7 @@ msgstr ""
6952
msgid "Last login: %s"
6953
msgstr ""
6954
6955
- #: includes/core/um-filters-fields.php:261
6956
msgid "Untitled photo"
6957
msgstr ""
6958
@@ -6977,11 +6969,11 @@ msgstr ""
6977
msgid "Login as this user"
6978
msgstr ""
6979
6980
- #: includes/um-short-functions.php:571
6981
msgid "date submitted"
6982
msgstr ""
6983
6984
- #: includes/um-short-functions.php:577
6985
msgid "(empty)"
6986
msgstr ""
6987
@@ -7051,37 +7043,37 @@ msgstr ""
7051
msgid "This user has not made any comments."
7052
msgstr ""
7053
7054
- #: templates/profile/posts-single.php:16
7055
#, php-format
7056
msgid "%s ago"
7057
msgstr ""
7058
7059
- #: templates/profile/posts-single.php:17
7060
msgid "in"
7061
msgstr ""
7062
7063
- #: templates/profile/posts-single.php:18
7064
msgid "no comments"
7065
msgstr ""
7066
7067
- #: templates/profile/posts-single.php:18
7068
- msgid "1 comment"
7069
msgstr ""
7070
7071
- #: templates/profile/posts-single.php:18
7072
- #, php-format
7073
- msgid "% comments"
7074
msgstr ""
7075
7076
- #: templates/profile/posts-single.php:27 templates/profile/posts.php:35
7077
msgid "load more posts"
7078
msgstr ""
7079
7080
- #: templates/profile/posts.php:43
7081
msgid "You have not created any posts."
7082
msgstr ""
7083
7084
- #: templates/profile/posts.php:43
7085
msgid "This user has not created any posts."
7086
msgstr ""
7087
1
msgid ""
2
msgstr ""
3
"Project-Id-Version: Ultimate Member\n"
4
+ "POT-Creation-Date: 2018-10-08 23:32+0300\n"
5
+ "PO-Revision-Date: 2018-10-08 23:32+0300\n"
6
"Last-Translator: \n"
7
"Language-Team: \n"
8
"Language: en_US\n"
115
116
#: includes/admin/core/class-admin-builder.php:609
117
#: includes/admin/core/class-admin-builder.php:763
118
+ #: includes/core/class-fields.php:4033
119
msgid "Please login as administrator"
120
msgstr ""
121
3526
#: includes/admin/templates/modal/dynamic_new_group.php:14
3527
#: includes/admin/templates/modal/fonticons.php:11
3528
#: includes/admin/templates/role/publish.php:24
3529
+ #: includes/core/class-fields.php:2272 includes/core/class-fields.php:2369
3530
#: includes/core/um-actions-profile.php:554
3531
#: includes/core/um-actions-profile.php:693
3532
#: includes/core/um-actions-profile.php:726
4165
msgid "You must add a shortcode to the content area"
4166
msgstr ""
4167
4168
+ #: includes/core/class-builtin.php:663 includes/core/class-user.php:1538
4169
msgid "Only me"
4170
msgstr ""
4171
6294
msgid "Change photo"
6295
msgstr ""
6296
6297
+ #: includes/core/class-fields.php:2271 includes/core/class-fields.php:2368
6298
msgid "Processing..."
6299
msgstr ""
6300
6302
msgid "Upload File"
6303
msgstr ""
6304
6305
+ #: includes/core/class-fields.php:2335 includes/core/um-filters-fields.php:243
6306
msgid "This file has been removed."
6307
msgstr ""
6308
6309
+ #: includes/core/class-fields.php:2338 includes/core/class-fields.php:2368
6310
msgid "Change file"
6311
msgstr ""
6312
6313
+ #: includes/core/class-fields.php:2368
6314
msgid "Save"
6315
msgstr ""
6316
6317
+ #: includes/core/class-fields.php:3791
6318
#, php-format
6319
msgid ""
6320
"Your profile is looking a little empty. Why not <a href=\"%s\">add</a> some "
6321
"information!"
6322
msgstr ""
6323
6324
+ #: includes/core/class-fields.php:3793
6325
msgid "This user has not added any information to their profile yet."
6326
msgstr ""
6327
6328
+ #: includes/core/class-files.php:256
6329
msgid "Invalid parameters"
6330
msgstr ""
6331
6332
+ #: includes/core/class-files.php:261
6333
msgid "Invalid coordinates"
6334
msgstr ""
6335
6336
+ #: includes/core/class-files.php:266
6337
msgid "Invalid file ownership"
6338
msgstr ""
6339
6340
+ #: includes/core/class-files.php:319
6341
msgid "Invalid nonce"
6342
msgstr ""
6343
6344
+ #: includes/core/class-files.php:339 includes/core/class-files.php:424
6345
msgid "A theme or plugin compatibility issue"
6346
msgstr ""
6347
6348
+ #: includes/core/class-files.php:967
6349
msgid "Ultimate Member: Not a valid temp file"
6350
msgstr ""
6351
6352
+ #: includes/core/class-files.php:1095
6353
msgid "Invalid user ID: "
6354
msgstr ""
6355
6356
+ #: includes/core/class-files.php:1104 includes/core/class-files.php:1132
6357
msgid "Unauthorized to do this attempt."
6358
msgstr ""
6359
6513
msgid "Wrong nonce"
6514
msgstr ""
6515
6516
+ #: includes/core/class-shortcodes.php:355
6517
msgid ""
6518
"This content has been restricted to logged in users only. Please <a href="
6519
"\"{login_referrer}\">login</a> to view this content."
6520
msgstr ""
6521
6522
+ #: includes/core/class-shortcodes.php:515
6523
msgid "You are already registered"
6524
msgstr ""
6525
6526
+ #: includes/core/class-shortcodes.php:757
6527
msgid "Default Template"
6528
msgstr ""
6529
6778
msgid "Please enter your email"
6779
msgstr ""
6780
6781
+ #: includes/core/um-actions-login.php:61
6782
msgid "Please enter your password"
6783
msgstr ""
6784
6785
+ #: includes/core/um-actions-login.php:68
6786
msgid "Password is incorrect. Please try again."
6787
msgstr ""
6788
6789
+ #: includes/core/um-actions-login.php:199
6790
msgid "This action has been prevented for security measures."
6791
msgstr ""
6792
6793
+ #: includes/core/um-actions-login.php:423
6794
msgid "Keep me signed in"
6795
msgstr ""
6796
6797
+ #: includes/core/um-actions-login.php:458
6798
msgid "Forgot your password?"
6799
msgstr ""
6800
6944
msgid "Last login: %s"
6945
msgstr ""
6946
6947
+ #: includes/core/um-filters-fields.php:274
6948
msgid "Untitled photo"
6949
msgstr ""
6950
6969
msgid "Login as this user"
6970
msgstr ""
6971
6972
+ #: includes/um-short-functions.php:580
6973
msgid "date submitted"
6974
msgstr ""
6975
6976
+ #: includes/um-short-functions.php:586
6977
msgid "(empty)"
6978
msgstr ""
6979
7043
msgid "This user has not made any comments."
7044
msgstr ""
7045
7046
+ #: templates/profile/posts-single.php:21
7047
#, php-format
7048
msgid "%s ago"
7049
msgstr ""
7050
7051
+ #: templates/profile/posts-single.php:24
7052
msgid "in"
7053
msgstr ""
7054
7055
+ #: templates/profile/posts-single.php:30
7056
msgid "no comments"
7057
msgstr ""
7058
7059
+ #: templates/profile/posts-single.php:32
7060
+ #, php-format
7061
+ msgid "%s comments"
7062
msgstr ""
7063
7064
+ #: templates/profile/posts-single.php:34
7065
+ msgid "1 comment"
7066
msgstr ""
7067
7068
+ #: templates/profile/posts.php:21
7069
msgid "load more posts"
7070
msgstr ""
7071
7072
+ #: templates/profile/posts.php:32
7073
msgid "You have not created any posts."
7074
msgstr ""
7075
7076
+ #: templates/profile/posts.php:32
7077
msgid "This user has not created any posts."
7078
msgstr ""
7079
readme.txt CHANGED
@@ -6,7 +6,7 @@ Donate link:
6
Tags: community, member, membership, user-profile, user-registration
7
Requires at least: 4.7
8
Tested up to: 4.9
9
- Stable tag: 2.0.27
10
License: GNU Version 2 or Any Later Version
11
License URI: http://www.gnu.org/licenses/gpl-3.0.txt
12
@@ -67,6 +67,10 @@ Ultimate Member has a range of extensions that allow you to extend the power of
67
* [Google reCAPTCHA](https://ultimatemember.com/extensions/google-recaptcha/) - Stop bots on your registration & login forms with Google reCAPTCHA
68
* [Online Users](https://ultimatemember.com/extensions/online-users/) - Display what users are online with this extension
69
70
= Development * Translations =
71
72
If you're a developer and would like to contribute to the source code of the plugin you can do so via our [GitHub Repository](https://github.com/ultimatemember/ultimatemember).
@@ -133,6 +137,21 @@ The plugin works with popular caching plugins by automatically excluding Ultimat
133
134
= 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 =
135
136
= 2.0.27: October 2, 2018 =
137
138
* Bugfixes:
6
Tags: community, member, membership, user-profile, user-registration
7
Requires at least: 4.7
8
Tested up to: 4.9
9
+ Stable tag: 2.0.29
10
License: GNU Version 2 or Any Later Version
11
License URI: http://www.gnu.org/licenses/gpl-3.0.txt
12
67
* [Google reCAPTCHA](https://ultimatemember.com/extensions/google-recaptcha/) - Stop bots on your registration & login forms with Google reCAPTCHA
68
* [Online Users](https://ultimatemember.com/extensions/online-users/) - Display what users are online with this extension
69
70
+ = Theme =
71
+
72
+ Our official [theme](https://ultimatemember.com/theme/) is purpose built for websites that have logged in and out users. The [theme](https://ultimatemember.com/theme/) has deep integration with Ultimate Member plugin and the extensions, different header designs for logged-in/out users and works alongside the Beaver Builder and Elementor page builders.
73
+
74
= Development * Translations =
75
76
If you're a developer and would like to contribute to the source code of the plugin you can do so via our [GitHub Repository](https://github.com/ultimatemember/ultimatemember).
137
138
= 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 =
139
140
+ = 2.0.29: October 8, 2018 =
141
+
142
+ * Bugfixes:
143
+ - Fixed User Profile Posts pagination
144
+
145
+ = 2.0.28: October 5, 2018 =
146
+
147
+ * Bugfixes:
148
+ - Fixed Email notifications
149
+ - Fixed Download files/images for multisites
150
+ - Fixed Profile/Cover image for multisites
151
+ - Fixed XSS vulnerabilities (detected by @Serhack)
152
+ - Fixed trim fields on submit forms
153
+ - Fixed submitted info
154
+
155
= 2.0.27: October 2, 2018 =
156
157
* Bugfixes:
templates/profile/posts-single.php CHANGED
@@ -1,30 +1,40 @@
1
- <?php while (UM()->shortcodes()->loop->have_posts()) { UM()->shortcodes()->loop->the_post(); $post_id = get_the_ID(); ?>
2
3
- <div class="um-item">
4
- <div class="um-item-link"><i class="um-icon-ios-paper"></i><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></div>
5
-
6
- <?php if ( has_post_thumbnail( $post_id ) ) {
7
- $image_id = get_post_thumbnail_id( $post_id );
8
- $image_url = wp_get_attachment_image_src( $image_id, 'full', true );
9
- ?>
10
-
11
- <div class="um-item-img"><a href="<?php the_permalink(); ?>"><?php echo get_the_post_thumbnail( $post_id, 'medium' ); ?></a></div>
12
-
13
- <?php } ?>
14
-
15
- <div class="um-item-meta">
16
- <span><?php echo sprintf(__('%s ago','ultimate-member'), human_time_diff( get_the_time('U'), current_time('timestamp') ) ); ?></span>
17
- <span><?php echo __('in','ultimate-member');?>: <?php the_category( ', ' ); ?></span>
18
- <span><?php comments_number( __('no comments','ultimate-member'), __('1 comment','ultimate-member'), __('% comments','ultimate-member') ); ?></span>
19
- </div>
20
</div>
21
-
22
<?php } ?>
23
-
24
- <?php if ( isset(UM()->shortcodes()->modified_args) && UM()->shortcodes()->loop->have_posts() && UM()->shortcodes()->loop->found_posts >= 10 ) { ?>
25
-
26
- <div class="um-load-items">
27
- <a href="#" class="um-ajax-paginate um-button" data-hook="um_load_posts" data-args="<?php echo UM()->shortcodes()->modified_args; ?>"><?php _e('load more posts','ultimate-member'); ?></a>
28
- </div>
29
-
30
- <?php } ?>
1
+ <div class="um-item">
2
+ <div class="um-item-link">
3
+ <i class="um-icon-ios-paper"></i>
4
+ <a href="<?php echo get_permalink( $post ) ?>"><?php echo $post->post_title; ?></a>
5
+ </div>
6
7
+ <?php if ( has_post_thumbnail( $post->ID ) ) {
8
+ $image_id = get_post_thumbnail_id( $post->ID );
9
+ $image_url = wp_get_attachment_image_src( $image_id, 'full', true ); ?>
10
+
11
+ <div class="um-item-img">
12
+ <a href="<?php echo get_permalink( $post ) ?>">
13
+ <?php echo get_the_post_thumbnail( $post->ID, 'medium' ); ?>
14
+ </a>
15
</div>
16
+
17
<?php } ?>
18
+
19
+ <div class="um-item-meta">
20
+ <span>
21
+ <?php printf( __( '%s ago', 'ultimate-member' ), human_time_diff( get_the_time( 'U', $post->ID ), current_time( 'timestamp' ) ) ); ?>
22
+ </span>
23
+ <span>
24
+ <?php echo __( 'in', 'ultimate-member' ); ?>: <?php the_category( ', ', '', $post->ID ); ?>
25
+ </span>
26
+ <span>
27
+ <?php $num_comments = get_comments_number( $post->ID );
28
+
29
+ if ( $num_comments == 0 ) {
30
+ $comments = __( 'no comments', 'ultimate-member' );
31
+ } elseif ( $num_comments > 1 ) {
32
+ $comments = sprintf( __( '%s comments', 'ultimate-member' ), $num_comments );
33
+ } else {
34
+ $comments = __( '1 comment', 'ultimate-member' );
35
+ } ?>
36
+
37
+ <a href="<?php echo get_comments_link( $post->ID ) ?>"><?php echo $comments ?></a>
38
+ </span>
39
+ </div>
40
+ </div>
templates/profile/posts.php CHANGED
@@ -1,45 +1,37 @@
1
- <?php $query_posts = UM()->query()->make('post_type=post&posts_per_page=10&offset=0&author=' . um_get_requested_user() );
2
3
- /**
4
- * UM hook
5
- *
6
- * @type filter
7
- * @title um_profile_query_make_posts
8
- * @description Some changes of WP_Query Posts Tab
9
- * @input_vars
10
- * [{"var":"$query_posts","type":"WP_Query","desc":"UM Posts Tab query"}]
11
- * @change_log
12
- * ["Since: 2.0"]
13
- * @usage
14
- * <?php add_filter( 'um_profile_query_make_posts', 'function_name', 10, 1 ); ?>
15
- * @example
16
- * <?php
17
- * add_filter( 'um_profile_query_make_posts', 'my_profile_query_make_posts', 10, 1 );
18
- * function my_profile_query_make_posts( $query_posts ) {
19
- * // your code here
20
- * return $query_posts;
21
- * }
22
- * ?>
23
- */
24
- UM()->shortcodes()->loop = apply_filters( 'um_profile_query_make_posts', $query_posts );
25
26
- if ( UM()->shortcodes()->loop->have_posts() ) {
27
28
- UM()->shortcodes()->load_template( 'profile/posts-single' ); ?>
29
-
30
- <div class="um-ajax-items">
31
- <!--Ajax output-->
32
- <?php if ( UM()->shortcodes()->loop->found_posts >= 10 ) { ?>
33
-
34
- <div class="um-load-items">
35
- <a href="#" class="um-ajax-paginate um-button" data-hook="um_load_posts" data-args="post,10,10,<?php echo um_get_requested_user(); ?>"><?php _e('load more posts','ultimate-member'); ?></a>
36
- </div>
37
38
- <?php } ?>
39
- </div>
40
-
41
- <?php } else { ?>
42
43
- <div class="um-profile-note"><span><?php echo ( um_profile_id() == get_current_user_id() ) ? __('You have not created any posts.','ultimate-member') : __('This user has not created any posts.','ultimate-member'); ?></span></div>
44
-
45
- <?php } wp_reset_postdata(); ?>
1
+ <?php if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
2
+ //Only for AJAX loading posts
3
+ if ( ! empty( $posts ) ) {
4
+ foreach ( $posts as $post ) {
5
+ UM()->shortcodes()->set_args = array( 'post' => $post );
6
+ UM()->shortcodes()->load_template( 'profile/posts-single' );
7
+ }
8
+ }
9
+ } else {
10
+ if ( ! empty( $posts ) ) { ?>
11
+ <div class="um-ajax-items">
12
13
+ <?php foreach ( $posts as $post ) {
14
+ UM()->shortcodes()->set_args = array( 'post' => $post );
15
+ UM()->shortcodes()->load_template( 'profile/posts-single' );
16
+ }
17
18
+ if ( $count_posts > 10 ) { ?>
19
+ <div class="um-load-items">
20
+ <a href="javascript:void(0);" class="um-ajax-paginate um-button" data-hook="um_load_posts" data-author="<?php echo um_get_requested_user(); ?>" data-page="1" data-pages="<?php echo ceil( $count_posts / 10 ) ?>">
21
+ <?php _e( 'load more posts', 'ultimate-member' ); ?>
22
+ </a>
23
+ </div>
24
+ <?php } ?>
25
26
+ </div>
27
28
+ <?php } else { ?>
29
30
+ <div class="um-profile-note">
31
+ <span>
32
+ <?php echo ( um_profile_id() == get_current_user_id() ) ? __( 'You have not created any posts.', 'ultimate-member' ) : __( 'This user has not created any posts.', 'ultimate-member' ); ?>
33
+ </span>
34
+ </div>
35
+
36
+ <?php }
37
+ }
ultimate-member.php CHANGED
@@ -3,7 +3,7 @@
3
Plugin Name: Ultimate Member
4
Plugin URI: http://ultimatemember.com/
5
Description: The easiest way to create powerful online communities and beautiful user profiles with WordPress
6
- Version: 2.0.27
7
Author: Ultimate Member
8
Author URI: http://ultimatemember.com/
9
Text Domain: ultimate-member
3
Plugin Name: Ultimate Member
4
Plugin URI: http://ultimatemember.com/
5
Description: The easiest way to create powerful online communities and beautiful user profiles with WordPress
6
+ Version: 2.0.29
7
Author: Ultimate Member
8
Author URI: http://ultimatemember.com/
9
Text Domain: ultimate-member