Ultimate Member – User Profile & Membership Plugin - Version 2.0.34

Version Description

Download this release

Release Info

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

Code changes from version 2.0.33 to 2.0.34

Files changed (53) hide show
  1. assets/js/pickadate/translations/{ca_ES.js → ca.js} +0 -0
  2. assets/js/pickadate/translations/{el_GR.js → el.js} +0 -0
  3. assets/js/pickadate/translations/{et_EE.js → et.js} +0 -0
  4. assets/js/pickadate/translations/{eu_ES.js → eu.js} +0 -0
  5. assets/js/pickadate/translations/{fi_FI.js → fi.js} +0 -0
  6. assets/js/pickadate/translations/{hr_HR.js → hr.js} +0 -0
  7. assets/js/pickadate/translations/{ja_JP.js → ja.js} +0 -0
  8. assets/js/pickadate/translations/{no_NO.js → nn_NO.js} +0 -0
  9. assets/js/pickadate/translations/{th_TH.js → th.js} +0 -0
  10. assets/js/pickadate/translations/{uk_UA.js → uk.js} +0 -0
  11. assets/js/pickadate/translations/{vi_VN.js → vi.js} +0 -0
  12. assets/js/um-functions.js +19 -13
  13. assets/js/um-functions.min.js +1 -1
  14. assets/js/um-scripts.js +9 -0
  15. assets/js/um-scripts.min.js +1 -1
  16. includes/admin/class-admin-functions.php +1 -1
  17. includes/admin/class-admin.php +16 -4
  18. includes/admin/core/class-admin-enqueue.php +4 -3
  19. includes/admin/core/class-admin-forms.php +49 -39
  20. includes/admin/core/class-admin-menu.php +1 -2
  21. includes/admin/core/class-admin-metabox.php +1 -3
  22. includes/admin/core/class-admin-settings.php +38 -36
  23. includes/admin/core/class-admin-upgrade.php +20 -5
  24. includes/class-dependencies.php +1 -0
  25. includes/class-extensions.php +230 -0
  26. includes/class-functions.php +2 -39
  27. includes/class-init.php +65 -5
  28. includes/core/class-ajax-common.php +0 -19
  29. includes/core/class-builtin.php +0 -2
  30. includes/core/class-common.php +0 -29
  31. includes/core/class-external-integrations.php +36 -0
  32. includes/core/class-fields.php +7 -6
  33. includes/core/class-form.php +4 -1
  34. includes/core/class-logout.php +29 -17
  35. includes/core/class-plugin-updater.php +40 -12
  36. includes/core/class-profile.php +4 -4
  37. includes/core/class-rewrite.php +0 -3
  38. includes/core/class-router.php +0 -115
  39. includes/core/class-shortcodes.php +7 -9
  40. includes/core/class-user.php +3 -3
  41. includes/core/um-actions-form.php +15 -15
  42. includes/core/um-actions-login.php +32 -26
  43. includes/core/um-actions-profile.php +11 -7
  44. includes/core/um-actions-register.php +13 -50
  45. includes/core/um-filters-fields.php +1 -2
  46. includes/core/um-filters-profile.php +10 -10
  47. includes/um-short-functions.php +257 -111
  48. languages/ultimate-member-en_US.mo +0 -0
  49. languages/ultimate-member-en_US.po +1017 -1023
  50. readme.txt +23 -2
  51. templates/profile.php +1 -1
  52. templates/profile/comments-single.php +35 -15
  53. ultimate-member.php +1 -8
assets/js/pickadate/translations/{ca_ES.js → ca.js} RENAMED
File without changes
assets/js/pickadate/translations/{el_GR.js → el.js} RENAMED
File without changes
assets/js/pickadate/translations/{et_EE.js → et.js} RENAMED
File without changes
assets/js/pickadate/translations/{eu_ES.js → eu.js} RENAMED
File without changes
assets/js/pickadate/translations/{fi_FI.js → fi.js} RENAMED
File without changes
assets/js/pickadate/translations/{hr_HR.js → hr.js} RENAMED
File without changes
assets/js/pickadate/translations/{ja_JP.js → ja.js} RENAMED
File without changes
assets/js/pickadate/translations/{no_NO.js → nn_NO.js} RENAMED
File without changes
assets/js/pickadate/translations/{th_TH.js → th.js} RENAMED
File without changes
assets/js/pickadate/translations/{uk_UA.js → uk.js} RENAMED
File without changes
assets/js/pickadate/translations/{vi_VN.js → vi.js} RENAMED
File without changes
assets/js/um-functions.js CHANGED
@@ -595,6 +595,14 @@ function um_new_modal( id, size, isPhoto, source ){
595
596
function um_modal_responsive() {
597
598
var modal = jQuery('.um-modal:visible');
599
var photo_modal = jQuery('.um-modal-body.photo:visible');
600
@@ -604,8 +612,8 @@ function um_modal_responsive() {
604
modal.removeClass('uimob500');
605
606
var photo_ = jQuery('.um-modal-photo img');
607
- var photo_maxw = jQuery(window).width() - 60;
608
- var photo_maxh = jQuery(window).height() - ( jQuery(window).height() * 0.25 );
609
610
photo_.css({'opacity': 0});
611
photo_.css({'max-width': photo_maxw });
@@ -618,44 +626,42 @@ function um_modal_responsive() {
618
619
photo_.animate({'opacity' : 1}, 1000);
620
621
- var half_gap = ( jQuery(window).height() - modal.innerHeight() ) / 2 + 'px';
622
modal.animate({ 'bottom' : half_gap }, 300);
623
624
} else if ( modal.length ) {
625
626
- var element_width = jQuery(window).width();
627
-
628
modal.removeClass('uimob340');
629
modal.removeClass('uimob500');
630
631
- if ( element_width <= 340 ) {
632
633
modal.addClass('uimob340');
634
initCrop_UM();
635
modal.animate({ 'bottom' : 0 }, 300);
636
637
- } else if ( element_width <= 500 ) {
638
639
modal.addClass('uimob500');
640
initCrop_UM();
641
modal.animate({ 'bottom' : 0 }, 300);
642
643
- } else if ( element_width <= 800 ) {
644
645
initCrop_UM();
646
- var half_gap = ( jQuery(window).height() - modal.innerHeight() ) / 2 + 'px';
647
modal.animate({ 'bottom' : half_gap }, 300);
648
649
- } else if ( element_width <= 960 ) {
650
651
initCrop_UM();
652
- var half_gap = ( jQuery(window).height() - modal.innerHeight() ) / 2 + 'px';
653
modal.animate({ 'bottom' : half_gap }, 300);
654
655
- } else if ( element_width > 960 ) {
656
657
initCrop_UM();
658
- var half_gap = ( jQuery(window).height() - modal.innerHeight() ) / 2 + 'px';
659
modal.animate({ 'bottom' : half_gap }, 300);
660
661
}
595
596
function um_modal_responsive() {
597
598
+ var w = window.innerWidth
599
+ || document.documentElement.clientWidth
600
+ || document.body.clientWidth;
601
+
602
+ var h = window.innerHeight
603
+ || document.documentElement.clientHeight
604
+ || document.body.clientHeight;
605
+
606
var modal = jQuery('.um-modal:visible');
607
var photo_modal = jQuery('.um-modal-body.photo:visible');
608
612
modal.removeClass('uimob500');
613
614
var photo_ = jQuery('.um-modal-photo img');
615
+ var photo_maxw = w - 60;
616
+ var photo_maxh = h - ( h * 0.25 );
617
618
photo_.css({'opacity': 0});
619
photo_.css({'max-width': photo_maxw });
626
627
photo_.animate({'opacity' : 1}, 1000);
628
629
+ var half_gap = ( h - modal.innerHeight() ) / 2 + 'px';
630
modal.animate({ 'bottom' : half_gap }, 300);
631
632
} else if ( modal.length ) {
633
634
modal.removeClass('uimob340');
635
modal.removeClass('uimob500');
636
637
+ if ( w <= 340 ) {
638
639
modal.addClass('uimob340');
640
initCrop_UM();
641
modal.animate({ 'bottom' : 0 }, 300);
642
643
+ } else if ( w <= 500 ) {
644
645
modal.addClass('uimob500');
646
initCrop_UM();
647
modal.animate({ 'bottom' : 0 }, 300);
648
649
+ } else if ( w <= 800 ) {
650
651
initCrop_UM();
652
+ var half_gap = ( h - modal.innerHeight() ) / 2 + 'px';
653
modal.animate({ 'bottom' : half_gap }, 300);
654
655
+ } else if ( w <= 960 ) {
656
657
initCrop_UM();
658
+ var half_gap = ( h - modal.innerHeight() ) / 2 + 'px';
659
modal.animate({ 'bottom' : half_gap }, 300);
660
661
+ } else if ( w > 960 ) {
662
663
initCrop_UM();
664
+ var half_gap = ( h - modal.innerHeight() ) / 2 + 'px';
665
modal.animate({ 'bottom' : half_gap }, 300);
666
667
}
assets/js/um-functions.min.js CHANGED
@@ -1 +1 @@
1
- function UM_check_password_matched(){jQuery(document).on("keyup","input[data-key=user_password],input[data-key=confirm_user_password]",function(e){var t=jQuery("input[data-key=user_password]").val(),a=jQuery("input[data-key=confirm_user_password]").val(),o=jQuery("input[data-key=user_password],input[data-key=confirm_user_password]");t||a?t!==a?o.removeClass("um-validate-matched").addClass("um-validate-not-matched"):o.removeClass("um-validate-not-matched").addClass("um-validate-matched"):o.removeClass("um-validate-matched").removeClass("um-validate-not-matched")})}function UM_hide_menus(){menu=jQuery(".um-dropdown"),menu.parents("div").find("a").removeClass("active"),menu.hide()}function UM_domenus(){jQuery(".um-dropdown").each(function(){var e=jQuery(this),t=jQuery(this).attr("data-element"),a=jQuery(this).attr("data-position");jQuery(t).addClass("um-trigger-menu-on-"+e.attr("data-trigger")),jQuery(window).width()<=1200&&"div.um-profile-edit"==t&&(a="lc"),"lc"==a&&(jQuery(t).find("img").width()<200?left_p=(jQuery(t).width()-jQuery(t).find("img").width())/2+(jQuery(t).find("img").width()-200)/2:left_p=(jQuery(t).width()-jQuery(t).find("img").width())/2,top_=parseInt(jQuery(t).find("a").css("top")),top_?(top_p=jQuery(t).find("img").height()+4+top_,left_gap=4):(top_p=jQuery(t).find("img").height()+4,left_gap=0),4==top_p&&"div.um-cover"==t?top_p=jQuery(t).height()/2+e.height()/2:4==top_p&&(top_p=jQuery(t).height()+20),gap_right=jQuery(t).width()+17,e.css({top:0,width:200,left:"auto",right:gap_right+"px","text-align":"center"}),e.find(".um-dropdown-arr").find("i").removeClass().addClass("um-icon-arrow-right-b"),e.find(".um-dropdown-arr").css({top:"4px",left:"auto",right:"-17px"})),"bc"==a&&(jQuery(t).find("img").width()<200?left_p=(jQuery(t).width()-jQuery(t).find("img").width())/2+(jQuery(t).find("img").width()-200)/2:left_p=(jQuery(t).width()-jQuery(t).find("img").width())/2,top_=parseInt(jQuery(t).find("a").css("top")),top_?(top_p=jQuery(t).find("img").height()+4+top_,left_gap=4):(top_p=jQuery(t).find("img").height()+4,left_gap=0),4==top_p&&"div.um-cover"==t?top_p=jQuery(t).height()/2+e.height()/2:4==top_p&&(top_p=jQuery(t).height()+20),e.css({top:top_p,width:200,left:left_p+left_gap,right:"auto","text-align":"center"}),e.find(".um-dropdown-arr").find("i").removeClass().addClass("um-icon-arrow-up-b"),e.find(".um-dropdown-arr").css({top:"-17px",left:e.width()/2-12,right:"auto"}))})}function um_responsive(){jQuery(".um").each(function(){element_width=jQuery(this).width(),element_width<=340?(jQuery(this).removeClass("uimob340"),jQuery(this).removeClass("uimob500"),jQuery(this).removeClass("uimob800"),jQuery(this).removeClass("uimob960"),jQuery(this).addClass("uimob340")):element_width<=500?(jQuery(this).removeClass("uimob340"),jQuery(this).removeClass("uimob500"),jQuery(this).removeClass("uimob800"),jQuery(this).removeClass("uimob960"),jQuery(this).addClass("uimob500")):element_width<=800?(jQuery(this).removeClass("uimob340"),jQuery(this).removeClass("uimob500"),jQuery(this).removeClass("uimob800"),jQuery(this).removeClass("uimob960"),jQuery(this).addClass("uimob800")):element_width<=960?(jQuery(this).removeClass("uimob340"),jQuery(this).removeClass("uimob500"),jQuery(this).removeClass("uimob800"),jQuery(this).removeClass("uimob960"),jQuery(this).addClass("uimob960")):960<element_width&&(jQuery(this).removeClass("uimob340"),jQuery(this).removeClass("uimob500"),jQuery(this).removeClass("uimob800"),jQuery(this).removeClass("uimob960")),0<jQuery(".um-account-nav").length&&jQuery(".um-account-side").is(":visible")&&0==jQuery(".um-account-tab:visible").length&&jQuery(".um-account-side li a.current").trigger("click"),jQuery(this).css("opacity",1)}),jQuery(".um-cover, .um-member-cover, .um-cover-e").each(function(){var e=jQuery(this),t=e.data("ratio"),a=e.width(),o=t.split(":");calcHeight=Math.round(a/o[0])+"px",e.height(calcHeight),e.find(".um-cover-add").height(calcHeight)}),jQuery(".um-members").each(function(){UM_Member_Grid(jQuery(this))}),UM_domenus()}function UM_Member_Grid(e){e.masonry({itemSelector:".um-member",columnWidth:".um-member",gutter:".um-gutter-sizer"})}function initImageUpload_UM(r){r.data("upload_help_text")?upload_help_text='<span class="help">'+r.data("upload_help_text")+"</span>":upload_help_text="",r.data("icon")?icon='<span class="icon"><i class="'+r.data("icon")+'"></i></span>':icon="",r.data("upload_text")?upload_text='<span class="str">'+r.data("upload_text")+"</span>":upload_text="";var e=0;jQuery("#um_upload_single:visible").data("user_id")&&(e=jQuery("#um_upload_single:visible").data("user_id")),r.uploadFile({url:wp.ajax.settings.url,method:"POST",multiple:!1,formData:{action:"um_imageupload",key:r.data("key"),set_id:r.data("set_id"),set_mode:r.data("set_mode"),_wpnonce:r.data("nonce"),timestamp:r.data("timestamp"),user_id:e},fileName:r.data("key"),allowedTypes:r.data("allowed_types"),maxFileSize:r.data("max_size"),dragDropStr:icon+upload_text+upload_help_text,sizeErrorStr:r.data("max_size_error"),extErrorStr:r.data("extension_error"),maxFileCountErrorStr:r.data("max_files_error"),maxFileCount:1,showDelete:!1,showAbort:!1,showDone:!1,showFileCounter:!1,showStatusAfterSuccess:!0,returnType:"json",onSubmit:function(e){r.parents(".um-modal-body").find(".um-error-block").remove()},onSuccess:function(e,t,a){r.selectedFiles=0,t.success&&0==t.success||void 0!==t.data.error?(r.parents(".um-modal-body").append('<div class="um-error-block">'+t.data.error+"</div>"),r.parents(".um-modal-body").find(".upload-statusbar").hide(0),um_modal_responsive()):jQuery.each(t.data,function(e,t){var a=r.parents(".um-modal-body").find(".um-single-image-preview img"),o=r.parents(".um-modal-body").find(".um-single-image-preview"),i=new Date;a.attr("src",t.url+"?"+i.getTime()),a.data("file",t.file),a.load(function(){r.parents(".um-modal-body").find(".um-modal-btn.um-finish-upload.disabled").removeClass("disabled"),r.parents(".um-modal-body").find(".ajax-upload-dragdrop,.upload-statusbar").hide(0),o.show(0),um_modal_responsive()})})},onError:function(e){console.log(e)}})}function initFileUpload_UM(o){o.data("upload_help_text")?upload_help_text='<span class="help">'+o.data("upload_help_text")+"</span>":upload_help_text="",o.data("icon")?icon='<span class="icon"><i class="'+o.data("icon")+'"></i></span>':icon="",o.data("upload_text")?upload_text='<span class="str">'+o.data("upload_text")+"</span>":upload_text="",jQuery("#um_upload_single:visible").data("user_id")&&(user_id=jQuery("#um_upload_single:visible").data("user_id")),o.uploadFile({url:wp.ajax.settings.url,method:"POST",multiple:!1,formData:{action:"um_fileupload",key:o.data("key"),set_id:o.data("set_id"),user_id:o.data("user_id"),set_mode:o.data("set_mode"),_wpnonce:o.data("nonce"),timestamp:o.data("timestamp")},fileName:o.data("key"),allowedTypes:o.data("allowed_types"),maxFileSize:o.data("max_size"),dragDropStr:icon+upload_text+upload_help_text,sizeErrorStr:o.data("max_size_error"),extErrorStr:o.data("extension_error"),maxFileCountErrorStr:o.data("max_files_error"),maxFileCount:1,showDelete:!1,showAbort:!1,showDone:!1,showFileCounter:!1,showStatusAfterSuccess:!0,onSubmit:function(e){o.parents(".um-modal-body").find(".um-error-block").remove()},onSuccess:function(e,t,a){o.selectedFiles=0,t.success&&0==t.success||void 0!==t.data.error?(o.parents(".um-modal-body").append('<div class="um-error-block">'+t.data.error+"</div>"),o.parents(".um-modal-body").find(".upload-statusbar").hide(0)):jQuery.each(t.data,function(e,t){o.parents(".um-modal-body").find(".um-modal-btn.um-finish-upload.disabled").removeClass("disabled"),o.parents(".um-modal-body").find(".ajax-upload-dragdrop,.upload-statusbar").hide(0),o.parents(".um-modal-body").find(".um-single-file-preview").show(0),"icon"==e?o.parents(".um-modal-body").find(".um-single-fileinfo i").removeClass().addClass(t):"icon_bg"==e?o.parents(".um-modal-body").find(".um-single-fileinfo span.icon").css({"background-color":t}):"filename"==e?o.parents(".um-modal-body").find(".um-single-fileinfo a").attr("data-file",t):"original_name"==e?(o.parents(".um-modal-body").find(".um-single-fileinfo a").attr("data-orignal-name",t),o.parents(".um-modal-body").find(".um-single-fileinfo span.filename").html(t)):"url"==e&&o.parents(".um-modal-body").find(".um-single-fileinfo a").attr("href",t)}),setTimeout(function(){um_modal_responsive()},1e3)},onError:function(e){console.log(e)}})}function initCrop_UM(){var t=jQuery(".um-modal .um-single-image-preview img").first(),e=jQuery(".um-modal .um-single-image-preview"),a=t.parent().attr("data-crop"),o=t.parent().attr("data-min_width"),i=t.parent().attr("data-min_height"),r=t.parent().attr("data-ratio");if(jQuery(".um-modal").find("#um_upload_single").attr("data-ratio"))r=(r=jQuery(".um-modal").find("#um_upload_single").attr("data-ratio")).split(":")[0];if(t.length&&""!=t.attr("src")){var u=jQuery(window).height()-(jQuery(".um-modal-footer a").height()+20)-50-jQuery(".um-modal-header:visible").height();if(t.css({height:"auto"}),e.css({height:"auto"}),jQuery(window).height()<=400?(e.css({height:u+"px","max-height":u+"px"}),t.css({height:"auto"})):(t.css({height:"auto","max-height":u+"px"}),e.css({height:t.height(),"max-height":u+"px"})),"square"==a)var d={minWidth:o,minHeight:i,dragCrop:!1,aspectRatio:1,zoomable:!1,rotatable:!1,dashed:!1,done:function(e){t.parent().attr("data-coord",Math.round(e.x)+","+Math.round(e.y)+","+Math.round(e.width)+","+Math.round(e.height))}};else if("cover"==a){0<Math.round(o/r)&&(i=Math.round(o/r));d={minWidth:o,minHeight:i,dragCrop:!1,aspectRatio:r,zoomable:!1,rotatable:!1,dashed:!1,done:function(e){t.parent().attr("data-coord",Math.round(e.x)+","+Math.round(e.y)+","+Math.round(e.width)+","+Math.round(e.height))}}}else if("user"==a)d={minWidth:o,minHeight:i,dragCrop:!0,aspectRatio:"auto",zoomable:!1,rotatable:!1,dashed:!1,done:function(e){t.parent().attr("data-coord",Math.round(e.x)+","+Math.round(e.y)+","+Math.round(e.width)+","+Math.round(e.height))}};0!=a&&(t.cropper(d),jQuery(".um-single-image-preview img.cropper-hidden").cropper("destroy"),jQuery(".um-single-image-preview img.lazyloaded").addClass("cropper-hidden"),jQuery(".um-single-image-preview img.lazyloaded").removeClass("lazyloaded"),jQuery(".um-single-image-preview .cropper-container").append('<div class="um-clear"></div>'))}}function um_new_modal(e,t,a,o){if(0==jQuery("body").find(".um-modal-overlay").length)if(jQuery(".tipsy").hide(),UM_hide_menus(),jQuery("body,html,textarea").css("overflow","hidden"),jQuery(document).bind("touchmove",function(e){e.preventDefault()}),jQuery(".um-modal").on("touchmove",function(e){e.stopPropagation()}),a?jQuery("body").append('<div class="um-modal-overlay"></div><div class="um-modal is-photo"></div>'):jQuery("body").append('<div class="um-modal-overlay"></div><div class="um-modal no-photo"></div>'),jQuery("#"+e).prependTo(".um-modal"),a){jQuery(".um-modal").find(".um-modal-photo").html("<img />");var i=jQuery(".um-modal-photo img"),r=jQuery(window).width()-60,u=jQuery(window).height()-.25*jQuery(window).height();i.attr("src",o),i.load(function(){jQuery("#"+e).show(),jQuery(".um-modal").show(),i.css({opacity:0}),i.css({"max-width":r}),i.css({"max-height":u}),jQuery(".um-modal").css({width:i.width(),"margin-left":"-"+i.width()/2+"px"}),i.animate({opacity:1},1e3),um_modal_responsive()})}else jQuery("#"+e).show(),jQuery(".um-modal").show(),um_modal_size(t),initImageUpload_UM(jQuery(".um-modal:visible").find(".um-single-image-upload")),initFileUpload_UM(jQuery(".um-modal:visible").find(".um-single-file-upload")),um_modal_responsive()}function um_modal_responsive(){var e=jQuery(".um-modal:visible");if(jQuery(".um-modal-body.photo:visible").length){e.removeClass("uimob340"),e.removeClass("uimob500");var t=jQuery(".um-modal-photo img"),a=jQuery(window).width()-60,o=jQuery(window).height()-.25*jQuery(window).height();t.css({opacity:0}),t.css({"max-width":a}),t.css({"max-height":o}),jQuery(".um-modal").css({width:t.width(),"margin-left":"-"+t.width()/2+"px"}),t.animate({opacity:1},1e3);var i=(jQuery(window).height()-e.innerHeight())/2+"px";e.animate({bottom:i},300)}else if(e.length){var r=jQuery(window).width();if(e.removeClass("uimob340"),e.removeClass("uimob500"),r<=340)e.addClass("uimob340"),initCrop_UM(),e.animate({bottom:0},300);else if(r<=500)e.addClass("uimob500"),initCrop_UM(),e.animate({bottom:0},300);else if(r<=800){initCrop_UM();i=(jQuery(window).height()-e.innerHeight())/2+"px";e.animate({bottom:i},300)}else if(r<=960){initCrop_UM();i=(jQuery(window).height()-e.innerHeight())/2+"px";e.animate({bottom:i},300)}else if(960<r){initCrop_UM();i=(jQuery(window).height()-e.innerHeight())/2+"px";e.animate({bottom:i},300)}}}function um_remove_modal(){jQuery("img.cropper-hidden").cropper("destroy"),jQuery("body,html,textarea").css("overflow","auto"),jQuery(document).unbind("touchmove"),jQuery('.um-modal div[id^="um_"]').hide().appendTo("body"),jQuery(".um-modal,.um-modal-overlay").remove()}function um_modal_size(e){jQuery(".um-modal:visible").addClass(e)}function um_modal_add_attr(e,t){jQuery(".um-modal:visible").data(e,t)}function prepare_Modal(){0==jQuery(".um-popup-overlay").length&&(jQuery("body").append('<div class="um-popup-overlay"></div>'),jQuery("body").append('<div class="um-popup"></div>'),jQuery(".um-popup").addClass("loading"),jQuery("body,html").css({overflow:"hidden"}))}function remove_Modal(){jQuery(".um-popup-overlay").length&&(jQuery(document).trigger("um_before_modal_removed"),jQuery(".um-popup-autogrow:visible").length?jQuery(".um-popup-autogrow:visible").mCustomScrollbar("destroy"):jQuery(".um-popup-autogrow2:visible").length&&jQuery(".um-popup-autogrow2:visible").mCustomScrollbar("destroy"),jQuery(".tipsy").remove(),jQuery(".um-popup").empty().remove(),jQuery(".um-popup-overlay").empty().remove(),jQuery("body,html").css({overflow:"auto"}))}function show_Modal(e){jQuery(".um-popup-overlay").length&&(jQuery(".um-popup").removeClass("loading").html(e),jQuery(".um-tip-n").tipsy({gravity:"n",opacity:1,offset:3}),jQuery(".um-tip-w").tipsy({gravity:"w",opacity:1,offset:3}),jQuery(".um-tip-e").tipsy({gravity:"e",opacity:1,offset:3}),jQuery(".um-tip-s").tipsy({gravity:"s",opacity:1,offset:3}))}function responsive_Modal(){jQuery(".um-popup-overlay").length&&(ag_height=jQuery(window).height()-jQuery(".um-popup um-popup-header").outerHeight()-jQuery(".um-popup .um-popup-footer").outerHeight()-80,350<ag_height&&(ag_height=350),jQuery(".um-popup-autogrow:visible").length?(jQuery(".um-popup-autogrow:visible").css({height:ag_height+"px"}),jQuery(".um-popup-autogrow:visible").mCustomScrollbar({theme:"dark-3",mouseWheelPixels:500}).mCustomScrollbar("scrollTo","bottom",{scrollInertia:0})):jQuery(".um-popup-autogrow2:visible").length&&(jQuery(".um-popup-autogrow2:visible").css({"max-height":ag_height+"px"}),jQuery(".um-popup-autogrow2:visible").mCustomScrollbar({theme:"dark-3",mouseWheelPixels:500})))}function um_reset_field(e){jQuery(e).find("div.um-field-area").find("input,textarea,select").not(":button, :submit, :reset, :hidden").val("").removeAttr("checked").removeAttr("selected")}function um_selected(e,t){if(e==t)return"selected='selected'"}jQuery(function(){jQuery(".um-search form *").keypress(function(e){if(13==e.which)return jQuery(".um-search form").submit(),!1}),2==jQuery("input[data-key=user_password],input[data-key=confirm_user_password]").length&&UM_check_password_matched()});
1
+ function UM_check_password_matched(){jQuery(document).on("keyup","input[data-key=user_password],input[data-key=confirm_user_password]",function(e){var t=jQuery("input[data-key=user_password]").val(),a=jQuery("input[data-key=confirm_user_password]").val(),o=jQuery("input[data-key=user_password],input[data-key=confirm_user_password]");t||a?t!==a?o.removeClass("um-validate-matched").addClass("um-validate-not-matched"):o.removeClass("um-validate-not-matched").addClass("um-validate-matched"):o.removeClass("um-validate-matched").removeClass("um-validate-not-matched")})}function UM_hide_menus(){menu=jQuery(".um-dropdown"),menu.parents("div").find("a").removeClass("active"),menu.hide()}function UM_domenus(){jQuery(".um-dropdown").each(function(){var e=jQuery(this),t=jQuery(this).attr("data-element"),a=jQuery(this).attr("data-position");jQuery(t).addClass("um-trigger-menu-on-"+e.attr("data-trigger")),jQuery(window).width()<=1200&&"div.um-profile-edit"==t&&(a="lc"),"lc"==a&&(jQuery(t).find("img").width()<200?left_p=(jQuery(t).width()-jQuery(t).find("img").width())/2+(jQuery(t).find("img").width()-200)/2:left_p=(jQuery(t).width()-jQuery(t).find("img").width())/2,top_=parseInt(jQuery(t).find("a").css("top")),top_?(top_p=jQuery(t).find("img").height()+4+top_,left_gap=4):(top_p=jQuery(t).find("img").height()+4,left_gap=0),4==top_p&&"div.um-cover"==t?top_p=jQuery(t).height()/2+e.height()/2:4==top_p&&(top_p=jQuery(t).height()+20),gap_right=jQuery(t).width()+17,e.css({top:0,width:200,left:"auto",right:gap_right+"px","text-align":"center"}),e.find(".um-dropdown-arr").find("i").removeClass().addClass("um-icon-arrow-right-b"),e.find(".um-dropdown-arr").css({top:"4px",left:"auto",right:"-17px"})),"bc"==a&&(jQuery(t).find("img").width()<200?left_p=(jQuery(t).width()-jQuery(t).find("img").width())/2+(jQuery(t).find("img").width()-200)/2:left_p=(jQuery(t).width()-jQuery(t).find("img").width())/2,top_=parseInt(jQuery(t).find("a").css("top")),top_?(top_p=jQuery(t).find("img").height()+4+top_,left_gap=4):(top_p=jQuery(t).find("img").height()+4,left_gap=0),4==top_p&&"div.um-cover"==t?top_p=jQuery(t).height()/2+e.height()/2:4==top_p&&(top_p=jQuery(t).height()+20),e.css({top:top_p,width:200,left:left_p+left_gap,right:"auto","text-align":"center"}),e.find(".um-dropdown-arr").find("i").removeClass().addClass("um-icon-arrow-up-b"),e.find(".um-dropdown-arr").css({top:"-17px",left:e.width()/2-12,right:"auto"}))})}function um_responsive(){jQuery(".um").each(function(){element_width=jQuery(this).width(),element_width<=340?(jQuery(this).removeClass("uimob340"),jQuery(this).removeClass("uimob500"),jQuery(this).removeClass("uimob800"),jQuery(this).removeClass("uimob960"),jQuery(this).addClass("uimob340")):element_width<=500?(jQuery(this).removeClass("uimob340"),jQuery(this).removeClass("uimob500"),jQuery(this).removeClass("uimob800"),jQuery(this).removeClass("uimob960"),jQuery(this).addClass("uimob500")):element_width<=800?(jQuery(this).removeClass("uimob340"),jQuery(this).removeClass("uimob500"),jQuery(this).removeClass("uimob800"),jQuery(this).removeClass("uimob960"),jQuery(this).addClass("uimob800")):element_width<=960?(jQuery(this).removeClass("uimob340"),jQuery(this).removeClass("uimob500"),jQuery(this).removeClass("uimob800"),jQuery(this).removeClass("uimob960"),jQuery(this).addClass("uimob960")):960<element_width&&(jQuery(this).removeClass("uimob340"),jQuery(this).removeClass("uimob500"),jQuery(this).removeClass("uimob800"),jQuery(this).removeClass("uimob960")),0<jQuery(".um-account-nav").length&&jQuery(".um-account-side").is(":visible")&&0==jQuery(".um-account-tab:visible").length&&jQuery(".um-account-side li a.current").trigger("click"),jQuery(this).css("opacity",1)}),jQuery(".um-cover, .um-member-cover, .um-cover-e").each(function(){var e=jQuery(this),t=e.data("ratio"),a=e.width(),o=t.split(":");calcHeight=Math.round(a/o[0])+"px",e.height(calcHeight),e.find(".um-cover-add").height(calcHeight)}),jQuery(".um-members").each(function(){UM_Member_Grid(jQuery(this))}),UM_domenus()}function UM_Member_Grid(e){e.masonry({itemSelector:".um-member",columnWidth:".um-member",gutter:".um-gutter-sizer"})}function initImageUpload_UM(r){r.data("upload_help_text")?upload_help_text='<span class="help">'+r.data("upload_help_text")+"</span>":upload_help_text="",r.data("icon")?icon='<span class="icon"><i class="'+r.data("icon")+'"></i></span>':icon="",r.data("upload_text")?upload_text='<span class="str">'+r.data("upload_text")+"</span>":upload_text="";var e=0;jQuery("#um_upload_single:visible").data("user_id")&&(e=jQuery("#um_upload_single:visible").data("user_id")),r.uploadFile({url:wp.ajax.settings.url,method:"POST",multiple:!1,formData:{action:"um_imageupload",key:r.data("key"),set_id:r.data("set_id"),set_mode:r.data("set_mode"),_wpnonce:r.data("nonce"),timestamp:r.data("timestamp"),user_id:e},fileName:r.data("key"),allowedTypes:r.data("allowed_types"),maxFileSize:r.data("max_size"),dragDropStr:icon+upload_text+upload_help_text,sizeErrorStr:r.data("max_size_error"),extErrorStr:r.data("extension_error"),maxFileCountErrorStr:r.data("max_files_error"),maxFileCount:1,showDelete:!1,showAbort:!1,showDone:!1,showFileCounter:!1,showStatusAfterSuccess:!0,returnType:"json",onSubmit:function(e){r.parents(".um-modal-body").find(".um-error-block").remove()},onSuccess:function(e,t,a){r.selectedFiles=0,t.success&&0==t.success||void 0!==t.data.error?(r.parents(".um-modal-body").append('<div class="um-error-block">'+t.data.error+"</div>"),r.parents(".um-modal-body").find(".upload-statusbar").hide(0),um_modal_responsive()):jQuery.each(t.data,function(e,t){var a=r.parents(".um-modal-body").find(".um-single-image-preview img"),o=r.parents(".um-modal-body").find(".um-single-image-preview"),i=new Date;a.attr("src",t.url+"?"+i.getTime()),a.data("file",t.file),a.load(function(){r.parents(".um-modal-body").find(".um-modal-btn.um-finish-upload.disabled").removeClass("disabled"),r.parents(".um-modal-body").find(".ajax-upload-dragdrop,.upload-statusbar").hide(0),o.show(0),um_modal_responsive()})})},onError:function(e){console.log(e)}})}function initFileUpload_UM(o){o.data("upload_help_text")?upload_help_text='<span class="help">'+o.data("upload_help_text")+"</span>":upload_help_text="",o.data("icon")?icon='<span class="icon"><i class="'+o.data("icon")+'"></i></span>':icon="",o.data("upload_text")?upload_text='<span class="str">'+o.data("upload_text")+"</span>":upload_text="",jQuery("#um_upload_single:visible").data("user_id")&&(user_id=jQuery("#um_upload_single:visible").data("user_id")),o.uploadFile({url:wp.ajax.settings.url,method:"POST",multiple:!1,formData:{action:"um_fileupload",key:o.data("key"),set_id:o.data("set_id"),user_id:o.data("user_id"),set_mode:o.data("set_mode"),_wpnonce:o.data("nonce"),timestamp:o.data("timestamp")},fileName:o.data("key"),allowedTypes:o.data("allowed_types"),maxFileSize:o.data("max_size"),dragDropStr:icon+upload_text+upload_help_text,sizeErrorStr:o.data("max_size_error"),extErrorStr:o.data("extension_error"),maxFileCountErrorStr:o.data("max_files_error"),maxFileCount:1,showDelete:!1,showAbort:!1,showDone:!1,showFileCounter:!1,showStatusAfterSuccess:!0,onSubmit:function(e){o.parents(".um-modal-body").find(".um-error-block").remove()},onSuccess:function(e,t,a){o.selectedFiles=0,t.success&&0==t.success||void 0!==t.data.error?(o.parents(".um-modal-body").append('<div class="um-error-block">'+t.data.error+"</div>"),o.parents(".um-modal-body").find(".upload-statusbar").hide(0)):jQuery.each(t.data,function(e,t){o.parents(".um-modal-body").find(".um-modal-btn.um-finish-upload.disabled").removeClass("disabled"),o.parents(".um-modal-body").find(".ajax-upload-dragdrop,.upload-statusbar").hide(0),o.parents(".um-modal-body").find(".um-single-file-preview").show(0),"icon"==e?o.parents(".um-modal-body").find(".um-single-fileinfo i").removeClass().addClass(t):"icon_bg"==e?o.parents(".um-modal-body").find(".um-single-fileinfo span.icon").css({"background-color":t}):"filename"==e?o.parents(".um-modal-body").find(".um-single-fileinfo a").attr("data-file",t):"original_name"==e?(o.parents(".um-modal-body").find(".um-single-fileinfo a").attr("data-orignal-name",t),o.parents(".um-modal-body").find(".um-single-fileinfo span.filename").html(t)):"url"==e&&o.parents(".um-modal-body").find(".um-single-fileinfo a").attr("href",t)}),setTimeout(function(){um_modal_responsive()},1e3)},onError:function(e){console.log(e)}})}function initCrop_UM(){var t=jQuery(".um-modal .um-single-image-preview img").first(),e=jQuery(".um-modal .um-single-image-preview"),a=t.parent().attr("data-crop"),o=t.parent().attr("data-min_width"),i=t.parent().attr("data-min_height"),r=t.parent().attr("data-ratio");if(jQuery(".um-modal").find("#um_upload_single").attr("data-ratio"))r=(r=jQuery(".um-modal").find("#um_upload_single").attr("data-ratio")).split(":")[0];if(t.length&&""!=t.attr("src")){var u=jQuery(window).height()-(jQuery(".um-modal-footer a").height()+20)-50-jQuery(".um-modal-header:visible").height();if(t.css({height:"auto"}),e.css({height:"auto"}),jQuery(window).height()<=400?(e.css({height:u+"px","max-height":u+"px"}),t.css({height:"auto"})):(t.css({height:"auto","max-height":u+"px"}),e.css({height:t.height(),"max-height":u+"px"})),"square"==a)var d={minWidth:o,minHeight:i,dragCrop:!1,aspectRatio:1,zoomable:!1,rotatable:!1,dashed:!1,done:function(e){t.parent().attr("data-coord",Math.round(e.x)+","+Math.round(e.y)+","+Math.round(e.width)+","+Math.round(e.height))}};else if("cover"==a){0<Math.round(o/r)&&(i=Math.round(o/r));d={minWidth:o,minHeight:i,dragCrop:!1,aspectRatio:r,zoomable:!1,rotatable:!1,dashed:!1,done:function(e){t.parent().attr("data-coord",Math.round(e.x)+","+Math.round(e.y)+","+Math.round(e.width)+","+Math.round(e.height))}}}else if("user"==a)d={minWidth:o,minHeight:i,dragCrop:!0,aspectRatio:"auto",zoomable:!1,rotatable:!1,dashed:!1,done:function(e){t.parent().attr("data-coord",Math.round(e.x)+","+Math.round(e.y)+","+Math.round(e.width)+","+Math.round(e.height))}};0!=a&&(t.cropper(d),jQuery(".um-single-image-preview img.cropper-hidden").cropper("destroy"),jQuery(".um-single-image-preview img.lazyloaded").addClass("cropper-hidden"),jQuery(".um-single-image-preview img.lazyloaded").removeClass("lazyloaded"),jQuery(".um-single-image-preview .cropper-container").append('<div class="um-clear"></div>'))}}function um_new_modal(e,t,a,o){if(0==jQuery("body").find(".um-modal-overlay").length)if(jQuery(".tipsy").hide(),UM_hide_menus(),jQuery("body,html,textarea").css("overflow","hidden"),jQuery(document).bind("touchmove",function(e){e.preventDefault()}),jQuery(".um-modal").on("touchmove",function(e){e.stopPropagation()}),a?jQuery("body").append('<div class="um-modal-overlay"></div><div class="um-modal is-photo"></div>'):jQuery("body").append('<div class="um-modal-overlay"></div><div class="um-modal no-photo"></div>'),jQuery("#"+e).prependTo(".um-modal"),a){jQuery(".um-modal").find(".um-modal-photo").html("<img />");var i=jQuery(".um-modal-photo img"),r=jQuery(window).width()-60,u=jQuery(window).height()-.25*jQuery(window).height();i.attr("src",o),i.load(function(){jQuery("#"+e).show(),jQuery(".um-modal").show(),i.css({opacity:0}),i.css({"max-width":r}),i.css({"max-height":u}),jQuery(".um-modal").css({width:i.width(),"margin-left":"-"+i.width()/2+"px"}),i.animate({opacity:1},1e3),um_modal_responsive()})}else jQuery("#"+e).show(),jQuery(".um-modal").show(),um_modal_size(t),initImageUpload_UM(jQuery(".um-modal:visible").find(".um-single-image-upload")),initFileUpload_UM(jQuery(".um-modal:visible").find(".um-single-file-upload")),um_modal_responsive()}function um_modal_responsive(){var e=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,a=jQuery(".um-modal:visible");if(jQuery(".um-modal-body.photo:visible").length){a.removeClass("uimob340"),a.removeClass("uimob500");var o=jQuery(".um-modal-photo img"),i=e-60,r=t-.25*t;o.css({opacity:0}),o.css({"max-width":i}),o.css({"max-height":r}),jQuery(".um-modal").css({width:o.width(),"margin-left":"-"+o.width()/2+"px"}),o.animate({opacity:1},1e3);var u=(t-a.innerHeight())/2+"px";a.animate({bottom:u},300)}else if(a.length)if(a.removeClass("uimob340"),a.removeClass("uimob500"),e<=340)a.addClass("uimob340"),initCrop_UM(),a.animate({bottom:0},300);else if(e<=500)a.addClass("uimob500"),initCrop_UM(),a.animate({bottom:0},300);else if(e<=800){initCrop_UM();u=(t-a.innerHeight())/2+"px";a.animate({bottom:u},300)}else if(e<=960){initCrop_UM();u=(t-a.innerHeight())/2+"px";a.animate({bottom:u},300)}else if(960<e){initCrop_UM();u=(t-a.innerHeight())/2+"px";a.animate({bottom:u},300)}}function um_remove_modal(){jQuery("img.cropper-hidden").cropper("destroy"),jQuery("body,html,textarea").css("overflow","auto"),jQuery(document).unbind("touchmove"),jQuery('.um-modal div[id^="um_"]').hide().appendTo("body"),jQuery(".um-modal,.um-modal-overlay").remove()}function um_modal_size(e){jQuery(".um-modal:visible").addClass(e)}function um_modal_add_attr(e,t){jQuery(".um-modal:visible").data(e,t)}function prepare_Modal(){0==jQuery(".um-popup-overlay").length&&(jQuery("body").append('<div class="um-popup-overlay"></div>'),jQuery("body").append('<div class="um-popup"></div>'),jQuery(".um-popup").addClass("loading"),jQuery("body,html").css({overflow:"hidden"}))}function remove_Modal(){jQuery(".um-popup-overlay").length&&(jQuery(document).trigger("um_before_modal_removed"),jQuery(".um-popup-autogrow:visible").length?jQuery(".um-popup-autogrow:visible").mCustomScrollbar("destroy"):jQuery(".um-popup-autogrow2:visible").length&&jQuery(".um-popup-autogrow2:visible").mCustomScrollbar("destroy"),jQuery(".tipsy").remove(),jQuery(".um-popup").empty().remove(),jQuery(".um-popup-overlay").empty().remove(),jQuery("body,html").css({overflow:"auto"}))}function show_Modal(e){jQuery(".um-popup-overlay").length&&(jQuery(".um-popup").removeClass("loading").html(e),jQuery(".um-tip-n").tipsy({gravity:"n",opacity:1,offset:3}),jQuery(".um-tip-w").tipsy({gravity:"w",opacity:1,offset:3}),jQuery(".um-tip-e").tipsy({gravity:"e",opacity:1,offset:3}),jQuery(".um-tip-s").tipsy({gravity:"s",opacity:1,offset:3}))}function responsive_Modal(){jQuery(".um-popup-overlay").length&&(ag_height=jQuery(window).height()-jQuery(".um-popup um-popup-header").outerHeight()-jQuery(".um-popup .um-popup-footer").outerHeight()-80,350<ag_height&&(ag_height=350),jQuery(".um-popup-autogrow:visible").length?(jQuery(".um-popup-autogrow:visible").css({height:ag_height+"px"}),jQuery(".um-popup-autogrow:visible").mCustomScrollbar({theme:"dark-3",mouseWheelPixels:500}).mCustomScrollbar("scrollTo","bottom",{scrollInertia:0})):jQuery(".um-popup-autogrow2:visible").length&&(jQuery(".um-popup-autogrow2:visible").css({"max-height":ag_height+"px"}),jQuery(".um-popup-autogrow2:visible").mCustomScrollbar({theme:"dark-3",mouseWheelPixels:500})))}function um_reset_field(e){jQuery(e).find("div.um-field-area").find("input,textarea,select").not(":button, :submit, :reset, :hidden").val("").removeAttr("checked").removeAttr("selected")}function um_selected(e,t){if(e==t)return"selected='selected'"}jQuery(function(){jQuery(".um-search form *").keypress(function(e){if(13==e.which)return jQuery(".um-search form").submit(),!1}),2==jQuery("input[data-key=user_password],input[data-key=confirm_user_password]").length&&UM_check_password_matched()});
assets/js/um-scripts.js CHANGED
@@ -186,6 +186,15 @@ jQuery(document).ready(function() {
186
187
jQuery('.um-s1,.um-s2').css({'display':'block'});
188
189
jQuery(".um-s1").select2({
190
191
allowClear: true,
186
187
jQuery('.um-s1,.um-s2').css({'display':'block'});
188
189
+ if( jQuery(".um-s1").length > 0 ){
190
+ jQuery(".um-s1").each(function () {
191
+ var select = jQuery(this);
192
+ if( select.val() === '' && select.attr('data-default') ) {
193
+ select.val(select.attr('data-default'));
194
+ }
195
+ });
196
+ }
197
+
198
jQuery(".um-s1").select2({
199
200
allowClear: true,
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 s=r[1]+"/"+r[2]+"/"+r[0];u=new Date(Date.parse(s))}if(o&&"Invalid Date"==o.toString()&&3==n.length){var d=n[1]+"/"+n[2]+"/"+n[0];o=new Date(Date.parse(d))}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_apply_conditions(jQuery(this),!1)}}),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,nonce:um_scripts.nonce}}),!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,nonce:um_scripts.nonce}}),!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,nonce:um_scripts.nonce},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,nonce:um_scripts.nonce},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,nonce:um_scripts.nonce},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 s(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,nonce:um_scripts.nonce},success:function(e){"success"==e.status&&""!=t.val()&&s(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];s(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 s=r[1]+"/"+r[2]+"/"+r[0];u=new Date(Date.parse(s))}if(o&&"Invalid Date"==o.toString()&&3==n.length){var d=n[1]+"/"+n[2]+"/"+n[0];o=new Date(Date.parse(d))}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_apply_conditions(jQuery(this),!1)}}),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,nonce:um_scripts.nonce}}),!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,nonce:um_scripts.nonce}}),!1}),jQuery(".um-s1,.um-s2").css({display:"block"}),0<jQuery(".um-s1").length&&jQuery(".um-s1").each(function(){var e=jQuery(this);""===e.val()&&e.attr("data-default")&&e.val(e.attr("data-default"))}),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,nonce:um_scripts.nonce},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,nonce:um_scripts.nonce},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,nonce:um_scripts.nonce},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 s(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,nonce:um_scripts.nonce},success:function(e){"success"==e.status&&""!=t.val()&&s(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];s(r,i,a)}""==t.val()&&(r.find('option[value!=""]').remove(),r.val("").trigger("change"))}),jQuery('select[name="'+n+'"]').trigger("change")})});
includes/admin/class-admin-functions.php CHANGED
@@ -28,7 +28,7 @@ if ( ! class_exists( 'um\admin\Admin_Functions' ) ) {
28
* @param bool $action
29
*/
30
function check_ajax_nonce( $action = false ) {
31
- $nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
32
$action = empty( $action ) ? 'um-admin-nonce' : $action;
33
34
if ( ! wp_verify_nonce( $nonce, $action ) ) {
28
* @param bool $action
29
*/
30
function check_ajax_nonce( $action = false ) {
31
+ $nonce = isset( $_REQUEST['nonce'] ) ? $_REQUEST['nonce'] : '';
32
$action = empty( $action ) ? 'um-admin-nonce' : $action;
33
34
if ( ! wp_verify_nonce( $nonce, $action ) ) {
includes/admin/class-admin.php CHANGED
@@ -79,12 +79,24 @@ if ( ! class_exists( 'um\admin\Admin' ) ) {
79
80
if ( empty( $last_request ) || time() > $last_request + DAY_IN_SECONDS ) {
81
82
- delete_transient( 'update_plugins' );
83
- delete_site_transient( 'update_plugins' );
84
85
- UM()->plugin_updater()->um_checklicenses();
86
87
- update_option( 'um_last_manual_upgrades_request', time() );
88
89
$url = add_query_arg( array( 'page' => 'ultimatemember', 'update' => 'got_updates' ), admin_url( 'admin.php' ) );
90
} else {
79
80
if ( empty( $last_request ) || time() > $last_request + DAY_IN_SECONDS ) {
81
82
+ if ( is_multisite() ) {
83
+ $blogs_ids = get_sites();
84
+ foreach( $blogs_ids as $b ) {
85
+ switch_to_blog( $b->blog_id );
86
+ wp_clean_update_cache();
87
88
+ UM()->plugin_updater()->um_checklicenses();
89
90
+ update_option( 'um_last_manual_upgrades_request', time() );
91
+ restore_current_blog();
92
+ }
93
+ } else {
94
+ wp_clean_update_cache();
95
+
96
+ UM()->plugin_updater()->um_checklicenses();
97
+
98
+ update_option( 'um_last_manual_upgrades_request', time() );
99
+ }
100
101
$url = add_query_arg( array( 'page' => 'ultimatemember', 'update' => 'got_updates' ), admin_url( 'admin.php' ) );
102
} else {
includes/admin/core/class-admin-enqueue.php CHANGED
@@ -30,8 +30,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
30
* Admin_Enqueue constructor.
31
*/
32
function __construct() {
33
- $this->slug = 'ultimatemember';
34
-
35
$this->js_url = um_url . 'includes/admin/assets/js/';
36
$this->css_url = um_url . 'includes/admin/assets/css/';
37
@@ -375,6 +373,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
375
UM()->enqueue()->load_modal();
376
UM()->enqueue()->load_responsive();
377
378
wp_register_style( 'um_default_css', um_url . 'assets/css/um-old-default.css', '', ultimatemember_version, 'all' );
379
wp_enqueue_style( 'um_default_css' );
380
@@ -382,7 +383,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
382
wp_register_style( 'um_admin_rtl', $this->css_url . 'um-admin-rtl.css' );
383
wp_enqueue_style( 'um_admin_rtl' );
384
}
385
-
386
} else {
387
388
$this->load_global_scripts();
30
* Admin_Enqueue constructor.
31
*/
32
function __construct() {
33
$this->js_url = um_url . 'includes/admin/assets/js/';
34
$this->css_url = um_url . 'includes/admin/assets/css/';
35
373
UM()->enqueue()->load_modal();
374
UM()->enqueue()->load_responsive();
375
376
+ wp_register_script( 'um_raty', um_url . 'assets/js/um-raty' . UM()->enqueue()->suffix . '.js', array( 'jquery' ), ultimatemember_version, true );
377
+ wp_register_style( 'um_raty', um_url . 'assets/css/um-raty.css', array(), ultimatemember_version );
378
+
379
wp_register_style( 'um_default_css', um_url . 'assets/css/um-old-default.css', '', ultimatemember_version, 'all' );
380
wp_enqueue_style( 'um_default_css' );
381
383
wp_register_style( 'um_admin_rtl', $this->css_url . 'um-admin-rtl.css' );
384
wp_enqueue_style( 'um_admin_rtl' );
385
}
386
+
387
} else {
388
389
$this->load_global_scripts();
includes/admin/core/class-admin-forms.php CHANGED
@@ -31,6 +31,19 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
31
}
32
33
34
/**
35
* Render form
36
*
@@ -40,8 +53,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
40
*/
41
function render_form( $echo = true ) {
42
43
- if ( empty( $this->form_data['fields'] ) )
44
return '';
45
46
$class = 'form-table um-form-table ' . ( ! empty( $this->form_data['class'] ) ? $this->form_data['class'] : '' );
47
$class_attr = ' class="' . $class . '" ';
@@ -49,11 +63,11 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
49
ob_start();
50
51
foreach ( $this->form_data['fields'] as $field_data ) {
52
- if ( isset( $field_data['type'] ) && 'hidden' == $field_data['type'] )
53
echo $this->render_form_row( $field_data );
54
}
55
56
-
57
if ( empty( $this->form_data['without_wrapper'] ) ) { ?>
58
59
<table <?php echo $class_attr ?>>
@@ -177,7 +191,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
177
if ( strpos( $this->form_data['class'], 'um-top-label' ) !== false ) {
178
179
$html .= '<tr class="um-forms-line" ' . $conditional . $prefix_attr . $type_attr . '>
180
- <td>' . $this->render_field_label( $data );
181
182
if ( method_exists( $this, 'render_' . $data['type'] ) ) {
183
@@ -199,7 +213,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
199
if ( ! empty( $data['without_label'] ) ) {
200
201
$html .= '<tr class="um-forms-line" ' . $conditional . $prefix_attr . $type_attr . '>
202
- <td colspan="2">';
203
204
if ( method_exists( $this, 'render_' . $data['type'] ) ) {
205
@@ -219,8 +233,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
219
} else {
220
221
$html .= '<tr class="um-forms-line" ' . $conditional . $prefix_attr . $type_attr . '>
222
- <th>' . $this->render_field_label( $data ) . '</th>
223
- <td>';
224
225
if ( method_exists( $this, 'render_' . $data['type'] ) ) {
226
@@ -242,15 +256,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
242
}
243
244
} else {
245
- if ( method_exists( $this, 'render_' . $data['type'] ) ) {
246
-
247
- $html .= call_user_func( array( &$this, 'render_' . $data['type'] ), $data );
248
-
249
- } else {
250
-
251
- $html .= $this->render_field_by_hook( $data );
252
-
253
- }
254
}
255
256
return $html;
@@ -304,6 +310,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
304
$for_attr = ' for="' . $id . '" ';
305
306
$label = $data['label'];
307
$tooltip = ! empty( $data['tooltip'] ) ? UM()->tooltip( $data['tooltip'], false, false ) : '';
308
309
return "<label $for_attr>$label $tooltip</label>";
@@ -317,8 +326,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
317
*/
318
function render_hidden( $field_data ) {
319
320
- if ( empty( $field_data['id'] ) )
321
- return false;
322
323
$id = ( ! empty( $this->form_data['prefix_id'] ) ? $this->form_data['prefix_id'] : '' ) . '_' . $field_data['id'];
324
$id_attr = ' id="' . $id . '" ';
@@ -383,7 +393,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
383
$name_attr = ' name="' . $name . '" ';
384
385
$value = $this->get_field_value( $field_data );
386
- $value_attr = ' value="' . $value . '" ';
387
388
$html = "<input type=\"text\" $id_attr $class_attr $name_attr $data_attr $value_attr $placeholder_attr />";
389
@@ -454,7 +464,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
454
$value_attr = ' value="' . $value . '" ';
455
456
$html = '<a href="#" class="button" data-modal="UM_fonticons" data-modal-size="normal" data-dynamic-content="um_admin_fonticon_selector" data-arg1="" data-arg2="" data-back="">' . __( 'Choose Icon', 'ultimate-member' ) . '</a>
457
- <span class="um-admin-icon-value">';
458
459
if ( ! empty( $value ) ) {
460
$html .= '<i class="' . $value . '"></i>';
@@ -689,7 +699,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
689
$value = $this->get_field_value( $field_data );
690
691
$html = "<input type=\"hidden\" $id_attr_hidden $name_attr value=\"0\" />
692
- <input type=\"checkbox\" $id_attr $class_attr $name_attr $data_attr " . checked( $value, true, false ) . " value=\"1\" />";
693
694
695
return $html;
@@ -809,8 +819,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
809
}
810
811
$html .= "<li class=\"um-multi-selects-option-line\"><span class=\"um-field-wrapper\">
812
- <select $id_attr $name_attr $class_attr $data_attr>$options</select></span>
813
- <span class=\"um-field-control\"><a href=\"javascript:void(0);\" class=\"um-select-delete\">" . __( 'Remove', 'ultimate-member' ) . "</a></span></li>";
814
}
815
} elseif ( ! empty( $field_data['show_default_number'] ) && is_numeric( $field_data['show_default_number'] ) && $field_data['show_default_number'] > 0 ) {
816
$i = 0;
@@ -823,8 +833,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
823
}
824
825
$html .= "<li class=\"um-multi-selects-option-line\"><span class=\"um-field-wrapper\">
826
- <select $id_attr $name_attr $class_attr $data_attr>$options</select></span>
827
- <span class=\"um-field-control\"><a href=\"javascript:void(0);\" class=\"um-select-delete\">" . __( 'Remove', 'ultimate-member' ) . "</a></span></li>";
828
829
$i++;
830
}
@@ -872,11 +882,11 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
872
$name_attr = ' name="' . $name . '[' . $k . ']" ';
873
874
$html .= "<label $for_attr>
875
- <input type=\"checkbox\" " . checked( in_array( $k, $values ), true, false ) . "$id_attr $name_attr value=\"1\" $class_attr>
876
- <span>$title</span>
877
- </label>";
878
}
879
-
880
$html .= '</span>';
881
$i++;
882
}
@@ -928,8 +938,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
928
$id_attr = ' id="' . $id . '-' . $k . '" ';
929
930
$html .= "<li class=\"um-multi-text-option-line {$size}\"><span class=\"um-field-wrapper\">
931
- <input type=\"text\" $id_attr $name_attr $class_attr $data_attr value=\"$value\" /></span>
932
- <span class=\"um-field-control\"><a href=\"javascript:void(0);\" class=\"um-text-delete\">" . __( 'Remove', 'ultimate-member' ) . "</a></span></li>";
933
}
934
} elseif ( ! empty( $field_data['show_default_number'] ) && is_numeric( $field_data['show_default_number'] ) && $field_data['show_default_number'] > 0 ) {
935
$i = 0;
@@ -937,8 +947,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
937
$id_attr = ' id="' . $id . '-' . $i . '" ';
938
939
$html .= "<li class=\"um-multi-text-option-line {$size}\"><span class=\"um-field-wrapper\">
940
- <input type=\"text\" $id_attr $name_attr $class_attr $data_attr value=\"\" /></span>
941
- <span class=\"um-field-control\"><a href=\"javascript:void(0);\" class=\"um-text-delete\">" . __( 'Remove', 'ultimate-member' ) . "</a></span></li>";
942
943
$i++;
944
}
@@ -992,11 +1002,11 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
992
$image_url = ! empty( $value['url'] ) ? $value['url'] : '';
993
994
$html = "<div class=\"um-media-upload\">" .
995
- "<input type=\"hidden\" class=\"um-media-upload-data-id\" name=\"{$name}[id]\" id=\"{$id}_id\" value=\"$image_id\">" .
996
- "<input type=\"hidden\" class=\"um-media-upload-data-width\" name=\"{$name}[width]\" id=\"{$id}_width\" value=\"$image_width\">" .
997
- "<input type=\"hidden\" class=\"um-media-upload-data-height\" name=\"{$name}[height]\" id=\"{$id}_height\" value=\"$image_height\">" .
998
- "<input type=\"hidden\" class=\"um-media-upload-data-thumbnail\" name=\"{$name}[thumbnail]\" id=\"{$id}_thumbnail\" value=\"$image_thumbnail\">" .
999
- "<input type=\"hidden\" $class_attr name=\"{$name}[url]\" id=\"{$id}_url\" value=\"$image_url\" $data_attr>";
1000
1001
if ( ! isset( $field_data['preview'] ) || $field_data['preview'] !== false ) {
1002
$html .= '<img src="' . $image_url . '" alt="" class="icon_preview"><div style="clear:both;"></div>';
@@ -1007,7 +1017,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
1007
}
1008
1009
$html .= '<input type="button" class="um-set-image button button-primary" value="' . __( 'Select', 'ultimate-member' ) . '" data-upload_frame="' . $upload_frame_title . '" />
1010
- <input type="button" class="um-clear-image button" value="' . __( 'Clear', 'ultimate-member' ) . '" /></div>';
1011
1012
return $html;
1013
}
31
}
32
33
34
+ /**
35
+ * Set Form Data
36
+ *
37
+ * @param $data
38
+ *
39
+ * @return $this
40
+ */
41
+ function set_data( $data ) {
42
+ $this->form_data = $data;
43
+ return $this;
44
+ }
45
+
46
+
47
/**
48
* Render form
49
*
53
*/
54
function render_form( $echo = true ) {
55
56
+ if ( empty( $this->form_data['fields'] ) ) {
57
return '';
58
+ }
59
60
$class = 'form-table um-form-table ' . ( ! empty( $this->form_data['class'] ) ? $this->form_data['class'] : '' );
61
$class_attr = ' class="' . $class . '" ';
63
ob_start();
64
65
foreach ( $this->form_data['fields'] as $field_data ) {
66
+ if ( isset( $field_data['type'] ) && 'hidden' == $field_data['type'] ) {
67
echo $this->render_form_row( $field_data );
68
+ }
69
}
70
71
if ( empty( $this->form_data['without_wrapper'] ) ) { ?>
72
73
<table <?php echo $class_attr ?>>
191
if ( strpos( $this->form_data['class'], 'um-top-label' ) !== false ) {
192
193
$html .= '<tr class="um-forms-line" ' . $conditional . $prefix_attr . $type_attr . '>
194
+ <td>' . $this->render_field_label( $data );
195
196
if ( method_exists( $this, 'render_' . $data['type'] ) ) {
197
213
if ( ! empty( $data['without_label'] ) ) {
214
215
$html .= '<tr class="um-forms-line" ' . $conditional . $prefix_attr . $type_attr . '>
216
+ <td colspan="2">';
217
218
if ( method_exists( $this, 'render_' . $data['type'] ) ) {
219
233
} else {
234
235
$html .= '<tr class="um-forms-line" ' . $conditional . $prefix_attr . $type_attr . '>
236
+ <th>' . $this->render_field_label( $data ) . '</th>
237
+ <td>';
238
239
if ( method_exists( $this, 'render_' . $data['type'] ) ) {
240
256
}
257
258
} else {
259
+ $html .= $this->render_hidden( $data );
260
}
261
262
return $html;
310
$for_attr = ' for="' . $id . '" ';
311
312
$label = $data['label'];
313
+ if ( isset( $data['required'] ) && $data['required'] )
314
+ $label = $label . '<span class="um-req" title="'.__('Required','ultimate-member').'">*</span>';
315
+
316
$tooltip = ! empty( $data['tooltip'] ) ? UM()->tooltip( $data['tooltip'], false, false ) : '';
317
318
return "<label $for_attr>$label $tooltip</label>";
326
*/
327
function render_hidden( $field_data ) {
328
329
+ if ( empty( $field_data['id'] ) ) {
330
+ return '';
331
+ }
332
333
$id = ( ! empty( $this->form_data['prefix_id'] ) ? $this->form_data['prefix_id'] : '' ) . '_' . $field_data['id'];
334
$id_attr = ' id="' . $id . '" ';
393
$name_attr = ' name="' . $name . '" ';
394
395
$value = $this->get_field_value( $field_data );
396
+ $value_attr = ' value="' . esc_attr( $value ) . '" ';
397
398
$html = "<input type=\"text\" $id_attr $class_attr $name_attr $data_attr $value_attr $placeholder_attr />";
399
464
$value_attr = ' value="' . $value . '" ';
465
466
$html = '<a href="#" class="button" data-modal="UM_fonticons" data-modal-size="normal" data-dynamic-content="um_admin_fonticon_selector" data-arg1="" data-arg2="" data-back="">' . __( 'Choose Icon', 'ultimate-member' ) . '</a>
467
+ <span class="um-admin-icon-value">';
468
469
if ( ! empty( $value ) ) {
470
$html .= '<i class="' . $value . '"></i>';
699
$value = $this->get_field_value( $field_data );
700
701
$html = "<input type=\"hidden\" $id_attr_hidden $name_attr value=\"0\" />
702
+ <input type=\"checkbox\" $id_attr $class_attr $name_attr $data_attr " . checked( $value, true, false ) . " value=\"1\" />";
703
704
705
return $html;
819
}
820
821
$html .= "<li class=\"um-multi-selects-option-line\"><span class=\"um-field-wrapper\">
822
+ <select $id_attr $name_attr $class_attr $data_attr>$options</select></span>
823
+ <span class=\"um-field-control\"><a href=\"javascript:void(0);\" class=\"um-select-delete\">" . __( 'Remove', 'ultimate-member' ) . "</a></span></li>";
824
}
825
} elseif ( ! empty( $field_data['show_default_number'] ) && is_numeric( $field_data['show_default_number'] ) && $field_data['show_default_number'] > 0 ) {
826
$i = 0;
833
}
834
835
$html .= "<li class=\"um-multi-selects-option-line\"><span class=\"um-field-wrapper\">
836
+ <select $id_attr $name_attr $class_attr $data_attr>$options</select></span>
837
+ <span class=\"um-field-control\"><a href=\"javascript:void(0);\" class=\"um-select-delete\">" . __( 'Remove', 'ultimate-member' ) . "</a></span></li>";
838
839
$i++;
840
}
882
$name_attr = ' name="' . $name . '[' . $k . ']" ';
883
884
$html .= "<label $for_attr>
885
+ <input type=\"checkbox\" " . checked( in_array( $k, $values ), true, false ) . "$id_attr $name_attr value=\"1\" $class_attr>
886
+ <span>$title</span>
887
+ </label>";
888
}
889
+
890
$html .= '</span>';
891
$i++;
892
}
938
$id_attr = ' id="' . $id . '-' . $k . '" ';
939
940
$html .= "<li class=\"um-multi-text-option-line {$size}\"><span class=\"um-field-wrapper\">
941
+ <input type=\"text\" $id_attr $name_attr $class_attr $data_attr value=\"$value\" /></span>
942
+ <span class=\"um-field-control\"><a href=\"javascript:void(0);\" class=\"um-text-delete\">" . __( 'Remove', 'ultimate-member' ) . "</a></span></li>";
943
}
944
} elseif ( ! empty( $field_data['show_default_number'] ) && is_numeric( $field_data['show_default_number'] ) && $field_data['show_default_number'] > 0 ) {
945
$i = 0;
947
$id_attr = ' id="' . $id . '-' . $i . '" ';
948
949
$html .= "<li class=\"um-multi-text-option-line {$size}\"><span class=\"um-field-wrapper\">
950
+ <input type=\"text\" $id_attr $name_attr $class_attr $data_attr value=\"\" /></span>
951
+ <span class=\"um-field-control\"><a href=\"javascript:void(0);\" class=\"um-text-delete\">" . __( 'Remove', 'ultimate-member' ) . "</a></span></li>";
952
953
$i++;
954
}
1002
$image_url = ! empty( $value['url'] ) ? $value['url'] : '';
1003
1004
$html = "<div class=\"um-media-upload\">" .
1005
+ "<input type=\"hidden\" class=\"um-media-upload-data-id\" name=\"{$name}[id]\" id=\"{$id}_id\" value=\"$image_id\">" .
1006
+ "<input type=\"hidden\" class=\"um-media-upload-data-width\" name=\"{$name}[width]\" id=\"{$id}_width\" value=\"$image_width\">" .
1007
+ "<input type=\"hidden\" class=\"um-media-upload-data-height\" name=\"{$name}[height]\" id=\"{$id}_height\" value=\"$image_height\">" .
1008
+ "<input type=\"hidden\" class=\"um-media-upload-data-thumbnail\" name=\"{$name}[thumbnail]\" id=\"{$id}_thumbnail\" value=\"$image_thumbnail\">" .
1009
+ "<input type=\"hidden\" $class_attr name=\"{$name}[url]\" id=\"{$id}_url\" value=\"$image_url\" $data_attr>";
1010
1011
if ( ! isset( $field_data['preview'] ) || $field_data['preview'] !== false ) {
1012
$html .= '<img src="' . $image_url . '" alt="" class="icon_preview"><div style="clear:both;"></div>';
1017
}
1018
1019
$html .= '<input type="button" class="um-set-image button button-primary" value="' . __( 'Select', 'ultimate-member' ) . '" data-upload_frame="' . $upload_frame_title . '" />
1020
+ <input type="button" class="um-clear-image button" value="' . __( 'Clear', 'ultimate-member' ) . '" /></div>';
1021
1022
return $html;
1023
}
includes/admin/core/class-admin-menu.php CHANGED
@@ -20,14 +20,13 @@ if ( ! class_exists( 'um\admin\core\Admin_Menu' ) ) {
20
* @var string
21
*/
22
var $pagehook;
23
24
25
/**
26
* Admin_Menu constructor.
27
*/
28
function __construct() {
29
- $this->slug = 'ultimatemember';
30
-
31
add_action( 'admin_menu', array( &$this, 'primary_admin_menu' ), 0 );
32
add_action( 'admin_menu', array( &$this, 'secondary_menu_items' ), 1000 );
33
add_action( 'admin_menu', array( &$this, 'extension_menu' ), 9999 );
20
* @var string
21
*/
22
var $pagehook;
23
+ var $slug = 'ultimatemember';
24
25
26
/**
27
* Admin_Menu constructor.
28
*/
29
function __construct() {
30
add_action( 'admin_menu', array( &$this, 'primary_admin_menu' ), 0 );
31
add_action( 'admin_menu', array( &$this, 'secondary_menu_items' ), 1000 );
32
add_action( 'admin_menu', array( &$this, 'extension_menu' ), 9999 );
includes/admin/core/class-admin-metabox.php CHANGED
@@ -24,9 +24,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
24
* Admin_Metabox constructor.
25
*/
26
function __construct() {
27
-
28
- $this->slug = 'ultimatemember';
29
-
30
$this->in_edit = false;
31
$this->edit_mode_value = null;
32
@@ -85,6 +82,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
85
86
87
/**
88
* @param $hide
89
*
90
* @return bool
24
* Admin_Metabox constructor.
25
*/
26
function __construct() {
27
$this->in_edit = false;
28
$this->edit_mode_value = null;
29
82
83
84
/**
85
+ * Hide Woocommerce Shop page restrict content metabox
86
* @param $hide
87
*
88
* @return bool
includes/admin/core/class-admin-settings.php CHANGED
@@ -123,44 +123,43 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
123
}
124
125
126
-
127
$appearances_profile_menu_fields = array(
128
array(
129
- 'id' => 'profile_menu',
130
- 'type' => 'checkbox',
131
- 'label' => __('Enable profile menu','ultimate-member'),
132
)
133
);
134
135
$tabs = UM()->profile()->tabs_primary();
136
137
- foreach( $tabs as $id => $tab ) {
138
139
$appearances_profile_menu_fields = array_merge( $appearances_profile_menu_fields, array(
140
array(
141
- 'id' => 'profile_tab_' . $id,
142
- 'type' => 'checkbox',
143
- 'label' => sprintf(__('%s Tab','ultimate-member'), $tab ),
144
- 'conditional' => array( 'profile_menu', '=', 1 ),
145
),
146
array(
147
- 'id' => 'profile_tab_' . $id . '_privacy',
148
- 'type' => 'select',
149
- 'label' => sprintf( __( 'Who can see %s Tab?','ultimate-member' ), $tab ),
150
- 'tooltip' => __( 'Select which users can view this tab.','ultimate-member' ),
151
- 'options' => UM()->profile()->tabs_privacy(),
152
- 'conditional' => array( 'profile_tab_' . $id, '=', 1 ),
153
'size' => 'small'
154
),
155
array(
156
- 'id' => 'profile_tab_' . $id . '_roles',
157
- 'type' => 'select',
158
'multi' => true,
159
- 'label' => __( 'Allowed roles','ultimate-member' ),
160
- 'tooltip' => __( 'Select the the user roles allowed to view this tab.','ultimate-member' ),
161
- 'options' => UM()->roles()->get_roles(),
162
- 'placeholder' => __( 'Choose user roles...','ultimate-member' ),
163
- 'conditional' => array( 'profile_tab_' . $id . '_privacy', '=', 4 ),
164
'size' => 'small'
165
)
166
) );
@@ -168,19 +167,19 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
168
169
$appearances_profile_menu_fields = array_merge( $appearances_profile_menu_fields, array(
170
array(
171
- 'id' => 'profile_menu_default_tab',
172
- 'type' => 'select',
173
- 'label' => __( 'Profile menu default tab','ultimate-member' ),
174
- 'tooltip' => __( 'This will be the default tab on user profile page','ultimate-member' ),
175
- 'options' => UM()->profile()->tabs_enabled(),
176
- 'conditional' => array( 'profile_menu', '=', 1 ),
177
'size' => 'small'
178
),
179
array(
180
- 'id' => 'profile_menu_icons',
181
- 'type' => 'checkbox',
182
- 'label' => __('Enable menu icons in desktop view','ultimate-member'),
183
- 'conditional' => array( 'profile_menu', '=', 1 ),
184
)
185
) );
186
@@ -190,15 +189,17 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
190
$exclude_taxonomies = UM()->excluded_taxonomies();
191
192
foreach ( $all_taxonomies as $key => $taxonomy ) {
193
- if( in_array( $key , $exclude_taxonomies ) )
194
- unset( $all_taxonomies[$key] );
195
}
196
197
$restricted_access_post_metabox_value = array();
198
if ( $restricted_access_post_metabox = UM()->options()->get( 'restricted_access_post_metabox' ) ) {
199
foreach ( $restricted_access_post_metabox as $key => $value ) {
200
- if ( $value )
201
$restricted_access_post_metabox_value[] = $key;
202
}
203
}
204
@@ -206,8 +207,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
206
$restricted_access_taxonomy_metabox_value = array();
207
if ( $restricted_access_taxonomy_metabox = UM()->options()->get( 'restricted_access_taxonomy_metabox' ) ) {
208
foreach ( $restricted_access_taxonomy_metabox as $key => $value ) {
209
- if ( $value )
210
$restricted_access_taxonomy_metabox_value[] = $key;
211
}
212
}
213
123
}
124
125
126
$appearances_profile_menu_fields = array(
127
array(
128
+ 'id' => 'profile_menu',
129
+ 'type' => 'checkbox',
130
+ 'label' => __('Enable profile menu','ultimate-member'),
131
)
132
);
133
134
$tabs = UM()->profile()->tabs_primary();
135
136
+ foreach ( $tabs as $id => $tab ) {
137
138
$appearances_profile_menu_fields = array_merge( $appearances_profile_menu_fields, array(
139
array(
140
+ 'id' => 'profile_tab_' . $id,
141
+ 'type' => 'checkbox',
142
+ 'label' => sprintf( __( '%s Tab', 'ultimate-member' ), $tab ),
143
+ 'conditional' => array( 'profile_menu', '=', 1 ),
144
),
145
array(
146
+ 'id' => 'profile_tab_' . $id . '_privacy',
147
+ 'type' => 'select',
148
+ 'label' => sprintf( __( 'Who can see %s Tab?', 'ultimate-member' ), $tab ),
149
+ 'tooltip' => __( 'Select which users can view this tab.', 'ultimate-member' ),
150
+ 'options' => UM()->profile()->tabs_privacy(),
151
+ 'conditional' => array( 'profile_tab_' . $id, '=', 1 ),
152
'size' => 'small'
153
),
154
array(
155
+ 'id' => 'profile_tab_' . $id . '_roles',
156
+ 'type' => 'select',
157
'multi' => true,
158
+ 'label' => __( 'Allowed roles','ultimate-member' ),
159
+ 'tooltip' => __( 'Select the the user roles allowed to view this tab.','ultimate-member' ),
160
+ 'options' => UM()->roles()->get_roles(),
161
+ 'placeholder' => __( 'Choose user roles...','ultimate-member' ),
162
+ 'conditional' => array( 'profile_tab_' . $id . '_privacy', '=', 4 ),
163
'size' => 'small'
164
)
165
) );
167
168
$appearances_profile_menu_fields = array_merge( $appearances_profile_menu_fields, array(
169
array(
170
+ 'id' => 'profile_menu_default_tab',
171
+ 'type' => 'select',
172
+ 'label' => __( 'Profile menu default tab', 'ultimate-member' ),
173
+ 'tooltip' => __( 'This will be the default tab on user profile page', 'ultimate-member' ),
174
+ 'options' => UM()->profile()->tabs_enabled(),
175
+ 'conditional' => array( 'profile_menu', '=', 1 ),
176
'size' => 'small'
177
),
178
array(
179
+ 'id' => 'profile_menu_icons',
180
+ 'type' => 'checkbox',
181
+ 'label' => __( 'Enable menu icons in desktop view', 'ultimate-member' ),
182
+ 'conditional' => array( 'profile_menu', '=', 1 ),
183
)
184
) );
185
189
$exclude_taxonomies = UM()->excluded_taxonomies();
190
191
foreach ( $all_taxonomies as $key => $taxonomy ) {
192
+ if( in_array( $key , $exclude_taxonomies ) ) {
193
+ unset( $all_taxonomies[ $key ] );
194
+ }
195
}
196
197
$restricted_access_post_metabox_value = array();
198
if ( $restricted_access_post_metabox = UM()->options()->get( 'restricted_access_post_metabox' ) ) {
199
foreach ( $restricted_access_post_metabox as $key => $value ) {
200
+ if ( $value ) {
201
$restricted_access_post_metabox_value[] = $key;
202
+ }
203
}
204
}
205
207
$restricted_access_taxonomy_metabox_value = array();
208
if ( $restricted_access_taxonomy_metabox = UM()->options()->get( 'restricted_access_taxonomy_metabox' ) ) {
209
foreach ( $restricted_access_taxonomy_metabox as $key => $value ) {
210
+ if ( $value ) {
211
$restricted_access_taxonomy_metabox_value[] = $key;
212
+ }
213
}
214
}
215
includes/admin/core/class-admin-upgrade.php CHANGED
@@ -77,6 +77,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Upgrade' ) ) {
77
add_action( 'in_plugin_update_message-' . um_plugin, array( $this, 'in_plugin_update_message' ) );
78
}
79
80
/**
81
* Function for major updates
82
*
@@ -134,17 +135,31 @@ if ( ! class_exists( 'um\admin\core\Admin_Upgrade' ) ) {
134
}
135
136
137
/**
138
* Get array of necessary upgrade packages
139
*
140
* @return array
141
*/
142
function need_run_upgrades() {
143
- $um_last_version_upgrade = get_option( 'um_last_version_upgrade' );
144
- //first install
145
- if ( ! $um_last_version_upgrade ) {
146
- $um_last_version_upgrade = '1.3.88';
147
- }
148
149
$diff_packages = array();
150
77
add_action( 'in_plugin_update_message-' . um_plugin, array( $this, 'in_plugin_update_message' ) );
78
}
79
80
+
81
/**
82
* Function for major updates
83
*
135
}
136
137
138
+ /**
139
+ * @return array
140
+ */
141
+ function get_extension_upgrades() {
142
+ $extensions = UM()->extensions()->get_list();
143
+ if ( empty( $extensions ) ) {
144
+ return array();
145
+ }
146
+
147
+ $upgrades = array();
148
+ foreach ( $extensions as $extension ) {
149
+ $upgrades[ $extension ] = UM()->extensions()->get_packages( $extension );
150
+ }
151
+
152
+ return $upgrades;
153
+ }
154
+
155
+
156
/**
157
* Get array of necessary upgrade packages
158
*
159
* @return array
160
*/
161
function need_run_upgrades() {
162
+ $um_last_version_upgrade = get_option( 'um_last_version_upgrade', '1.3.88' );
163
164
$diff_packages = array();
165
includes/class-dependencies.php CHANGED
@@ -38,6 +38,7 @@ if ( ! class_exists( 'um\Dependencies' ) ) {
38
'groups' => '2.0',
39
'instagram' => '2.0',
40
'invitations' => '2.0',
41
'mailchimp' => '2.0.1',
42
'messaging' => '2.0.5',
43
'mycred' => '2.0',
38
'groups' => '2.0',
39
'instagram' => '2.0',
40
'invitations' => '2.0',
41
+ 'frontend-posting' => '1.0',
42
'mailchimp' => '2.0.1',
43
'messaging' => '2.0.5',
44
'mycred' => '2.0',
includes/class-extensions.php ADDED
@@ -0,0 +1,230 @@
1
+ <?php
2
+ namespace um;
3
+
4
+ // Exit if executed directly
5
+ if ( ! defined( 'ABSPATH' ) ) exit;
6
+
7
+
8
+ if ( ! class_exists( 'um\Extensions' ) ) {
9
+
10
+
11
+ /**
12
+ * Class Extensions
13
+ *
14
+ * @package um
15
+ *
16
+ * @method void bbpress_activation()
17
+ */
18
+ class Extensions {
19
+
20
+
21
+ /**
22
+ * Extensions list
23
+ *
24
+ * @var array
25
+ */
26
+ var $list = array();
27
+
28
+
29
+ /**
30
+ * Extensions data
31
+ *
32
+ * @var array
33
+ */
34
+ var $plugin_data = array();
35
+
36
+
37
+ /**
38
+ * Extensions constructor.
39
+ */
40
+ function __construct() {
41
+
42
+ }
43
+
44
+
45
+ /**
46
+ *
47
+ */
48
+ function check_dependencies() {
49
+ $extensions = $this->get_list();
50
+
51
+ foreach ( $extensions as $slug ) {
52
+ $extension = $this->get_info( $slug );
53
+
54
+ list( $run, $slug, $message ) = apply_filters_ref_array( 'um_extension_custom_dependencies', array( true, $slug, '' ) );
55
+
56
+ if ( $run ) {
57
+ $compare_version_result = UM()->dependencies()->compare_versions( $extension['min_core_version'], $extension['version'], $slug, $extension['title'] );
58
+
59
+ if ( true !== $compare_version_result ) {
60
+ UM()->notices()->add_notice( "{$slug}_dependencies", array(
61
+ 'class' => 'error',
62
+ 'message' => '<p>' . $compare_version_result . '</p>',
63
+ ), 1 );
64
+ }
65
+ } elseif ( ! $run && ! empty( $message ) ) {
66
+ UM()->notices()->add_notice( "{$slug}_dependencies", array(
67
+ 'class' => 'error',
68
+ 'message' => $message,
69
+ ), 1 );
70
+ }
71
+
72
+ if ( $run ) {
73
+ UM()->call_class( "um_ext\um_{$slug}\Init" );
74
+ }
75
+ }
76
+ }
77
+
78
+
79
+ /**
80
+ * @param $settings
81
+ *
82
+ * @return mixed
83
+ */
84
+ function license_options( $settings ) {
85
+
86
+ $extensions = $this->get_list();
87
+
88
+ if ( empty( $extensions ) ) {
89
+ return $settings;
90
+ }
91
+
92
+ foreach ( $extensions as $slug ) {
93
+ $extension = $this->get_info( $slug );
94
+
95
+ if ( isset( $extension['plan'] ) && $extension['plan'] == 'free' ) {
96
+ continue;
97
+ }
98
+
99
+ $settings['licenses']['fields'][] = array(
100
+ 'id' => "um_{$slug}_license_key",
101
+ 'label' => sprintf( __( '%s License Key', 'ultimate-member' ), $extension['title'] ),
102
+ 'item_name' => $extension['item_name'],
103
+ 'author' => 'Ultimate Member',
104
+ 'version' => $extension['version'],
105
+ );
106
+ }
107
+
108
+ return $settings;
109
+ }
110
+
111
+
112
+ /**
113
+ * Loading Extensions localizations
114
+ */
115
+ function localization() {
116
+ $extensions = $this->get_list();
117
+
118
+ foreach ( $extensions as $slug ) {
119
+ $extension = $this->get_info( $slug );
120
+
121
+ $locale = ( get_locale() != '' ) ? get_locale() : 'en_US';
122
+ load_textdomain( $extension['textdomain'], WP_LANG_DIR . '/plugins/' . $extension['textdomain'] . '-' . $locale . '.mo');
123
+ load_plugin_textdomain( $extension['textdomain'], false, dirname( $extension['plugin'] ) . '/languages/' );
124
+ }
125
+ }
126
+
127
+
128
+ /**
129
+ * @param $slug
130
+ *
131
+ * @return string
132
+ */
133
+ function get_version( $slug ) {
134
+
135
+ $version = '';
136
+
137
+ return $version;
138
+ }
139
+
140
+
141
+ /**
142
+ * @param $slug
143
+ * @param bool $field
144
+ *
145
+ * @return array|bool
146
+ */
147
+ function get_info( $slug, $field = false ) {
148
+ if ( ! $field ) {
149
+ return ! empty( $this->plugin_data[ $slug ] ) ? $this->plugin_data[ $slug ] : array();
150
+ } else {
151
+ return ! empty( $this->plugin_data[ $slug ][ $field ] ) ? $this->plugin_data[ $slug ][ $field ] : false;
152
+ }
153
+ }
154
+
155
+
156
+ /**
157
+ * @param string $slug
158
+ * @param array $plugin_data
159
+ */
160
+ function add( $slug, $plugin_data ) {
161
+ $this->list[] = $slug;
162
+ $this->plugin_data[ $slug ] = $plugin_data;
163
+ }
164
+
165
+
166
+ /**
167
+ * Activate Extension Process
168
+ * Common functions in activation
169
+ *
170
+ * @param $slug
171
+ */
172
+ function activate( $slug ) {
173
+ $plugin_data = $this->get_info( $slug );
174
+
175
+ //if extension wasn't inited, init it firstly via "um_{$slug}_add" function
176
+ //"um_{$slug}_add" must be in the preset structure of UM extension
177
+ if ( empty( $plugin_data ) && function_exists( "um_{$slug}_add" ) ) {
178
+ call_user_func( "um_{$slug}_add" );
179
+ $plugin_data = $this->get_info( $slug );
180
+ }
181
+
182
+ //first install
183
+ $version = get_option( "um_{$slug}_version" );
184
+ if ( ! $version ) {
185
+ update_option( "um_{$slug}_last_version_upgrade", $plugin_data['version'] );
186
+ }
187
+
188
+ if ( $version != $plugin_data['version'] ) {
189
+ update_option( "um_{$slug}_version", $plugin_data['version'] );
190
+ }
191
+
192
+
193
+ //start setup
194
+ UM()->extension( $slug )->setup()->start();
195
+ }
196
+
197
+
198
+ /**
199
+ * @return array
200
+ */
201
+ function get_list() {
202
+ return $this->list;
203
+ }
204
+
205
+
206
+ function get_packages( $slug ) {
207
+ $plugin_info = $this->get_info( $slug );
208
+ $packages_dir = $plugin_info['path'] . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'packages';
209
+
210
+ $update_versions = array();
211
+ $handle = opendir( $packages_dir );
212
+ if ( $handle ) {
213
+ while ( false !== ( $filename = readdir( $handle ) ) ) {
214
+ if ( $filename != '.' && $filename != '..' ) {
215
+ if ( is_dir( $packages_dir . DIRECTORY_SEPARATOR . $filename ) ) {
216
+ $update_versions[] = $filename;
217
+ }
218
+ }
219
+ }
220
+ closedir( $handle );
221
+
222
+ usort( $update_versions, array( UM()->admin_upgrade(), 'version_compare_sort' ) );
223
+ }
224
+
225
+ return $update_versions;
226
+ }
227
+
228
+
229
+ }
230
+ }
includes/class-functions.php CHANGED
@@ -1,5 +1,6 @@
1
<?php if ( ! defined( 'ABSPATH' ) ) exit;
2
3
if ( ! class_exists( 'UM_Functions' ) ) {
4
5
@@ -22,7 +23,7 @@ if ( ! class_exists( 'UM_Functions' ) ) {
22
* @param bool $action
23
*/
24
function check_ajax_nonce( $action = false ) {
25
- $nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
26
$action = empty( $action ) ? 'um-frontend-nonce' : $action;
27
28
if ( ! wp_verify_nonce( $nonce, $action ) ) {
@@ -54,43 +55,6 @@ if ( ! class_exists( 'UM_Functions' ) ) {
54
}
55
56
57
- /**
58
- * Get ajax routed URL
59
- *
60
- * @param string $route
61
- * @param string $method
62
- *
63
- * @return string
64
- */
65
- public function get_ajax_route( $route, $method ) {
66
-
67
- $route = str_replace( array( '\\', '/' ), '!', $route );
68
- $ip = isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : '';
69
- $nonce = wp_create_nonce( $ip . get_current_user_id() . $route . $method );
70
-
71
- if ( is_admin() ) {
72
- $url = add_query_arg( array(
73
- 'action' => 'um_router',
74
- 'um_action' => 'route',
75
- 'um_resource' => $route,
76
- 'um_method' => $method,
77
- 'um_verify' => $nonce
78
- ), get_admin_url( null, 'admin-ajax.php' ) );
79
- } else if ( get_option( 'permalink_structure' ) ) {
80
- $url = get_home_url( null, 'um-api/route/' . $route . '/' . $method . '/' . $nonce );
81
- } else {
82
- $url = add_query_arg( array(
83
- 'um_page' => 'api',
84
- 'um_action' => 'route',
85
- 'um_resource' => $route,
86
- 'um_method' => $method,
87
- 'um_verify' => $nonce
88
- ), get_home_url() );
89
- }
90
- return $url;
91
- }
92
-
93
-
94
/**
95
* Help Tip displaying
96
*
@@ -364,6 +328,5 @@ if ( ! class_exists( 'UM_Functions' ) ) {
364
$cpt = apply_filters( 'um_cpt_list', array( 'um_form', 'um_directory' ) );
365
return $cpt;
366
}
367
-
368
}
369
}
1
<?php if ( ! defined( 'ABSPATH' ) ) exit;
2
3
+
4
if ( ! class_exists( 'UM_Functions' ) ) {
5
6
23
* @param bool $action
24
*/
25
function check_ajax_nonce( $action = false ) {
26
+ $nonce = isset( $_REQUEST['nonce'] ) ? $_REQUEST['nonce'] : '';
27
$action = empty( $action ) ? 'um-frontend-nonce' : $action;
28
29
if ( ! wp_verify_nonce( $nonce, $action ) ) {
55
}
56
57
58
/**
59
* Help Tip displaying
60
*
328
$cpt = apply_filters( 'um_cpt_list', array( 'um_form', 'um_directory' ) );
329
return $cpt;
330
}
331
}
332
}
includes/class-init.php CHANGED
@@ -198,6 +198,8 @@ if ( ! class_exists( 'UM' ) ) {
198
199
// include hook files
200
add_action( 'plugins_loaded', array( &$this, 'init' ), 0 );
201
202
add_action( 'init', array( &$this, 'old_update_patch' ), 0 );
203
@@ -406,7 +408,7 @@ if ( ! class_exists( 'UM' ) ) {
406
$array = explode( '\\', strtolower( $class ) );
407
$array[ count( $array ) - 1 ] = 'class-'. end( $array );
408
if ( strpos( $class, 'um_ext' ) === 0 ) {
409
- $full_path = str_replace( 'ultimate-member', '', rtrim( um_path, '/' ) ) . str_replace( '_', '-', $array[1] ) . '/includes/';
410
unset( $array[0], $array[1] );
411
$path = implode( DIRECTORY_SEPARATOR, $array );
412
$path = str_replace( '_', '-', $path );
@@ -478,6 +480,14 @@ if ( ! class_exists( 'UM' ) ) {
478
}
479
480
481
/**
482
* Include required core files used in admin and on the frontend.
483
*
@@ -541,8 +551,45 @@ if ( ! class_exists( 'UM' ) ) {
541
$this->mobile();
542
$this->external_integrations();
543
$this->gdpr();
544
- //$this->uploader();
545
-
546
}
547
548
@@ -822,7 +869,7 @@ if ( ! class_exists( 'UM' ) ) {
822
* @param $data array
823
* @return um\admin\core\Admin_Forms()
824
*/
825
- function admin_forms( $data ) {
826
if ( empty( $this->classes['admin_forms_' . $data['class']] ) ) {
827
$this->classes['admin_forms_' . $data['class']] = new um\admin\core\Admin_Forms( $data );
828
}
@@ -836,7 +883,7 @@ if ( ! class_exists( 'UM' ) ) {
836
* @param $data array
837
* @return um\admin\core\Admin_Forms_Settings()
838
*/
839
- function admin_forms_settings( $data ) {
840
if ( empty( $this->classes['admin_forms_settings_' . $data['class']] ) ) {
841
$this->classes['admin_forms_settings_' . $data['class']] = new um\admin\core\Admin_Forms_Settings( $data );
842
}
@@ -844,6 +891,19 @@ if ( ! class_exists( 'UM' ) ) {
844
}
845
846
847
848
/**
849
* @since 2.0
198
199
// include hook files
200
add_action( 'plugins_loaded', array( &$this, 'init' ), 0 );
201
+ //run hook for extensions init
202
+ add_action( 'plugins_loaded', array( &$this, 'extensions_init' ), -19 );
203
204
add_action( 'init', array( &$this, 'old_update_patch' ), 0 );
205
408
$array = explode( '\\', strtolower( $class ) );
409
$array[ count( $array ) - 1 ] = 'class-'. end( $array );
410
if ( strpos( $class, 'um_ext' ) === 0 ) {
411
+ $full_path = str_replace( 'ultimate-member', '', untrailingslashit( um_path ) ) . str_replace( '_', '-', $array[1] ) . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR;
412
unset( $array[0], $array[1] );
413
$path = implode( DIRECTORY_SEPARATOR, $array );
414
$path = str_replace( '_', '-', $path );
480
}
481
482
483
+ /**
484
+ *
485
+ */
486
+ function extensions_init() {
487
+ do_action( 'um_core_loaded' );
488
+ }
489
+
490
+
491
/**
492
* Include required core files used in admin and on the frontend.
493
*
551
$this->mobile();
552
$this->external_integrations();
553
$this->gdpr();
554
+ }
555
+
556
+
557
+ /**
558
+ * Get extension API
559
+ *
560
+ * @since 2.0.34
561
+ *
562
+ * @param $slug
563
+ *
564
+ * @return um_ext\um_bbpress\Init
565
+ */
566
+ function extension( $slug ) {
567
+ if ( empty( $this->classes[ $slug ] ) ) {
568
+ $class = "um_ext\um_{$slug}\Init";
569
+
570
+ /**
571
+ * @var $class um_ext\um_bbpress\Init
572
+ */
573
+ $this->classes[ $slug ] = $class::instance();
574
+ }
575
+
576
+ return $this->classes[ $slug ];
577
+ }
578
+
579
+
580
+ /**
581
+ * @param $class
582
+ *
583
+ * @return mixed
584
+ */
585
+ function call_class( $class ) {
586
+ $key = strtolower( $class );
587
+
588
+ if ( empty( $this->classes[ $key ] ) ) {
589
+ $this->classes[ $key ] = new $class;
590
+ }
591
+
592
+ return $this->classes[ $key ];
593
}
594
595
869
* @param $data array
870
* @return um\admin\core\Admin_Forms()
871
*/
872
+ function admin_forms( $data = false ) {
873
if ( empty( $this->classes['admin_forms_' . $data['class']] ) ) {
874
$this->classes['admin_forms_' . $data['class']] = new um\admin\core\Admin_Forms( $data );
875
}
883
* @param $data array
884
* @return um\admin\core\Admin_Forms_Settings()
885
*/
886
+ function admin_forms_settings( $data = false ) {
887
if ( empty( $this->classes['admin_forms_settings_' . $data['class']] ) ) {
888
$this->classes['admin_forms_settings_' . $data['class']] = new um\admin\core\Admin_Forms_Settings( $data );
889
}
891
}
892
893
894
+ /**
895
+ * @since 2.0.34
896
+ *
897
+ * @return um\Extensions
898
+ */
899
+ function extensions() {
900
+ if ( empty( $this->classes['extensions'] ) ) {
901
+ $this->classes['extensions'] = new um\Extensions();
902
+ }
903
+
904
+ return $this->classes['extensions'];
905
+ }
906
+
907
908
/**
909
* @since 2.0
includes/core/class-ajax-common.php CHANGED
@@ -20,7 +20,6 @@ if ( ! class_exists( 'um\core\AJAX_Common' ) ) {
20
function __construct() {
21
// UM_EVENT => nopriv
22
$ajax_actions = array(
23
- 'router' => false
24
);
25
26
foreach ( $ajax_actions as $action => $nopriv ) {
@@ -54,24 +53,6 @@ if ( ! class_exists( 'um\core\AJAX_Common' ) ) {
54
55
add_action( 'wp_ajax_nopriv_um_resize_image', array( UM()->files(), 'ajax_resize_image' ) );
56
add_action( 'wp_ajax_um_resize_image', array( UM()->files(), 'ajax_resize_image' ) );
57
-
58
-
59
- /**
60
- * Fallback for ajax urls
61
- * @uses action hooks: wp_head, admin_head
62
- */
63
- //add_action( 'wp_head', array( $this, 'ultimatemember_ajax_urls' ) );
64
- //add_action( 'admin_head', array( $this, 'ultimatemember_ajax_urls' ) );
65
-
66
- }
67
-
68
-
69
- /**
70
- * Router method
71
- */
72
- function router() {
73
- $router = new Router();
74
- $router->backend_requests();
75
}
76
}
77
}
20
function __construct() {
21
// UM_EVENT => nopriv
22
$ajax_actions = array(
23
);
24
25
foreach ( $ajax_actions as $action => $nopriv ) {
53
54
add_action( 'wp_ajax_nopriv_um_resize_image', array( UM()->files(), 'ajax_resize_image' ) );
55
add_action( 'wp_ajax_um_resize_image', array( UM()->files(), 'ajax_resize_image' ) );
56
}
57
}
58
}
includes/core/class-builtin.php CHANGED
@@ -1292,8 +1292,6 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
1292
1293
$all = UM()->fields()->array_sort_by_column( $all, 'title');
1294
1295
- $all = array( 0 => '') + $all;
1296
-
1297
return $all;
1298
}
1299
1292
1293
$all = UM()->fields()->array_sort_by_column( $all, 'title');
1294
1295
return $all;
1296
}
1297
includes/core/class-common.php CHANGED
@@ -18,8 +18,6 @@ if ( ! class_exists( 'um\core\Common' ) ) {
18
function __construct() {
19
add_action( 'init', array( &$this, 'create_post_types' ), 1 );
20
21
- add_filter( 'posts_request', array( &$this, 'um_query_pages' ) );
22
-
23
add_filter( 'body_class', array( &$this, 'remove_admin_bar' ), 1000, 1 );
24
}
25
@@ -110,33 +108,6 @@ if ( ! class_exists( 'um\core\Common' ) ) {
110
}
111
112
}
113
-
114
-
115
- /**
116
- * Check query string on 'posts_request' for our pages
117
- *
118
- * @param string $q
119
- *
120
- * @return string
121
- */
122
- public function um_query_pages( $q ) {
123
- global $wp_query;
124
-
125
- //We need main query
126
- if ( isset( $wp_query->request ) && $q == $wp_query->request ) {
127
-
128
- if ( ! empty( $wp_query->query_vars['um_page'] ) ) {
129
-
130
- if ( 'api' == $wp_query->query_vars['um_page'] ) {
131
- $router = new Router();
132
- $router->frontend_requests();
133
- }
134
- }
135
-
136
- }
137
-
138
- return $q;
139
- }
140
}
141
142
}
18
function __construct() {
19
add_action( 'init', array( &$this, 'create_post_types' ), 1 );
20
21
add_filter( 'body_class', array( &$this, 'remove_admin_bar' ), 1000, 1 );
22
}
23
108
}
109
110
}
111
}
112
113
}
includes/core/class-external-integrations.php CHANGED
@@ -32,10 +32,46 @@ if ( ! class_exists( 'um\core\External_Integrations' ) ) {
32
add_filter( 'um_localize_permalink_filter', array( &$this, 'um_localize_permalink_filter' ), 10, 2 );
33
add_filter( 'icl_ls_languages', array( &$this, 'um_core_page_wpml_permalink' ), 10, 1 );
34
35
$this->plugins_loaded();
36
}
37
38
39
/**
40
* Gravity forms role capabilities compatibility
41
*/
32
add_filter( 'um_localize_permalink_filter', array( &$this, 'um_localize_permalink_filter' ), 10, 2 );
33
add_filter( 'icl_ls_languages', array( &$this, 'um_core_page_wpml_permalink' ), 10, 1 );
34
35
+ /**
36
+ * @todo Customize this form metadata
37
+ */
38
+ //add_filter( 'um_pre_args_setup', array( &$this, 'shortcode_pre_args_setup' ), 20, 1 );
39
+
40
$this->plugins_loaded();
41
}
42
43
44
+ /**
45
+ * UM filter - Restore original arguments on translated page
46
+ *
47
+ * @description Restore original arguments on load shortcode if they are missed in the WPML translation
48
+ * @hook um_pre_args_setup
49
+ *
50
+ * @global \SitePress $sitepress
51
+ * @param array $args
52
+ * @return array
53
+ */
54
+ function shortcode_pre_args_setup( $args ) {
55
+ if ( UM()->external_integrations()->is_wpml_active() ) {
56
+ global $sitepress;
57
+
58
+ $original_form_id = $sitepress->get_object_id( $args['form_id'], 'post', true, $sitepress->get_default_language() );
59
+
60
+ if ( $original_form_id != $args['form_id'] ) {
61
+ $original_post_data = UM()->query()->post_data( $original_form_id );
62
+
63
+ foreach ( $original_post_data as $key => $value ) {
64
+ if ( ! isset( $args[ $key ] ) ) {
65
+ $args[ $key ] = $value;
66
+ }
67
+ }
68
+ }
69
+ }
70
+
71
+ return $args;
72
+ }
73
+
74
+
75
/**
76
* Gravity forms role capabilities compatibility
77
*/
includes/core/class-fields.php CHANGED
@@ -36,15 +36,16 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
36
*
37
* @param integer $id
38
* @param string $title
39
*/
40
- function checkbox( $id, $title ) {
41
- ?>
42
43
<div class="um-field um-field-c">
44
<div class="um-field-area">
45
- <label class="um-field-checkbox active">
46
- <input type="checkbox" name="<?php echo $id; ?>" value="1" checked/>
47
- <span class="um-field-checkbox-state"><i class="um-icon-android-checkbox-outline"></i></span>
48
<span class="um-field-checkbox-option"> <?php echo $title; ?></span>
49
</label>
50
</div>
@@ -2533,7 +2534,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
2533
$placeholder = strip_tags( $placeholder );
2534
}
2535
2536
- $output .= '<select ' . $disabled . ' ' . $select_original_option_value . ' ' . $disabled_by_parent_option . ' name="' . $form_key . '" id="' . $field_id . '" data-validate="' . $validate . '" data-key="' . $key . '" class="' . $this->get_class( $key, $data, $class ) . '" style="width: 100%" data-placeholder="' . $placeholder . '" ' . $atts_ajax . '>';
2537
2538
/**
2539
* UM hook
36
*
37
* @param integer $id
38
* @param string $title
39
+ * @param bool $checked
40
*/
41
+ function checkbox( $id, $title, $checked = true ) {
42
+ $class = $checked ? 'um-icon-android-checkbox-outline' : 'um-icon-android-checkbox-outline-blank'; ?>
43
44
<div class="um-field um-field-c">
45
<div class="um-field-area">
46
+ <label class="um-field-checkbox <?php echo ( $checked ) ? 'active' : '' ?>">
47
+ <input type="checkbox" name="<?php echo $id; ?>" value="1" <?php checked( $checked ) ?> />
48
+ <span class="um-field-checkbox-state"><i class="<?php echo $class ?>"></i></span>
49
<span class="um-field-checkbox-option"> <?php echo $title; ?></span>
50
</label>
51
</div>
2534
$placeholder = strip_tags( $placeholder );
2535
}
2536
2537
+ $output .= '<select data-default="' . $data['default'] . '" ' . $disabled . ' ' . $select_original_option_value . ' ' . $disabled_by_parent_option . ' name="' . $form_key . '" id="' . $field_id . '" data-validate="' . $validate . '" data-key="' . $key . '" class="' . $this->get_class( $key, $data, $class ) . '" style="width: 100%" data-placeholder="' . $placeholder . '" ' . $atts_ajax . '>';
2538
2539
/**
2540
* UM hook
includes/core/class-form.php CHANGED
@@ -481,8 +481,11 @@ if ( ! class_exists( 'um\core\Form' ) ) {
481
$global_role = $um_global_role; // Form Global settings
482
}
483
484
-
485
$mode = $this->form_type( $post_id );
486
$use_custom = get_post_meta( $post_id, "_um_{$mode}_use_custom_settings", true );
487
if ( $use_custom ) { // Custom Form settings
488
$role = get_post_meta( $post_id, "_um_{$mode}_role", true );
481
$global_role = $um_global_role; // Form Global settings
482
}
483
484
$mode = $this->form_type( $post_id );
485
+
486
+ /**
487
+ * @todo WPML integration to get role from original if it's empty
488
+ */
489
$use_custom = get_post_meta( $post_id, "_um_{$mode}_use_custom_settings", true );
490
if ( $use_custom ) { // Custom Form settings
491
$role = get_post_meta( $post_id, "_um_{$mode}_role", true );
includes/core/class-logout.php CHANGED
@@ -1,9 +1,11 @@
1
<?php
2
namespace um\core;
3
4
// Exit if accessed directly
5
if ( ! defined( 'ABSPATH' ) ) exit;
6
7
if ( ! class_exists( 'um\core\Logout' ) ) {
8
9
@@ -18,9 +20,19 @@ if ( ! class_exists( 'um\core\Logout' ) ) {
18
* Logout constructor.
19
*/
20
function __construct() {
21
22
- add_action('template_redirect', array(&$this, 'logout_page'), 10000 );
23
24
}
25
26
@@ -28,44 +40,44 @@ if ( ! class_exists( 'um\core\Logout' ) ) {
28
* Logout via logout page
29
*/
30
function logout_page() {
31
-
32
- $language_code = '';
33
- $current_page_ID = get_the_ID();
34
- $logout_page_id = UM()->config()->permalinks['logout'];
35
- $trid = 0;
36
-
37
- if ( is_home() /*|| is_front_page()*/ ) {
38
return;
39
}
40
41
if ( UM()->external_integrations()->is_wpml_active() ) {
42
global $sitepress;
43
$default_lang = $sitepress->get_default_language();
44
$language_code = $sitepress->get_current_language();
45
46
if ( function_exists( 'icl_object_id' ) ) {
47
$trid = icl_object_id( $current_page_ID, 'page', true, $default_lang );
48
} else {
49
$trid = wpml_object_id_filter( $current_page_ID, 'page', true, $default_lang );
50
}
51
-
52
- if ( $language_code == $default_lang ) {
53
- $language_code = '';
54
- }
55
}
56
57
if ( um_is_core_page( 'logout' ) || ( $trid > 0 && $trid == $logout_page_id ) ) {
58
59
if ( is_user_logged_in() ) {
60
61
if ( isset( $_REQUEST['redirect_to'] ) && $_REQUEST['redirect_to'] !== '' ) {
62
wp_logout();
63
session_unset();
64
- exit( wp_redirect( $_REQUEST['redirect_to'] ) );
65
} else if ( um_user('after_logout') == 'redirect_home' ) {
66
wp_logout();
67
session_unset();
68
- exit( wp_redirect( home_url( $language_code ) ) );
69
} else {
70
/**
71
* UM hook
@@ -92,12 +104,12 @@ if ( ! class_exists( 'um\core\Logout' ) ) {
92
$redirect_url = apply_filters( 'um_logout_redirect_url', um_user( 'logout_redirect_url' ), um_user( 'ID' ) );
93
wp_logout();
94
session_unset();
95
- exit( wp_redirect( $redirect_url ) );
96
-
97
}
98
99
} else {
100
- exit( wp_redirect( home_url( $language_code ) ) );
101
}
102
103
}
1
<?php
2
namespace um\core;
3
4
+
5
// Exit if accessed directly
6
if ( ! defined( 'ABSPATH' ) ) exit;
7
8
+
9
if ( ! class_exists( 'um\core\Logout' ) ) {
10
11
20
* Logout constructor.
21
*/
22
function __construct() {
23
+ add_action( 'template_redirect', array( &$this, 'logout_page' ), 10000 );
24
+ }
25
26
27
+ /**
28
+ * @param $redirect_url
29
+ * @param $status
30
+ *
31
+ * @return false|string
32
+ */
33
+ function safe_redirect_default( $redirect_url, $status ) {
34
+ $login_page_id = UM()->config()->permalinks['login'];
35
+ return get_permalink( $login_page_id );
36
}
37
38
40
* Logout via logout page
41
*/
42
function logout_page() {
43
+ if ( is_home() ) {
44
return;
45
}
46
47
+ $trid = 0;
48
+ $language_code = '';
49
if ( UM()->external_integrations()->is_wpml_active() ) {
50
global $sitepress;
51
$default_lang = $sitepress->get_default_language();
52
+
53
$language_code = $sitepress->get_current_language();
54
+ if ( $language_code == $default_lang ) {
55
+ $language_code = '';
56
+ }
57
58
+ $current_page_ID = get_the_ID();
59
if ( function_exists( 'icl_object_id' ) ) {
60
$trid = icl_object_id( $current_page_ID, 'page', true, $default_lang );
61
} else {
62
$trid = wpml_object_id_filter( $current_page_ID, 'page', true, $default_lang );
63
}
64
}
65
66
+ $logout_page_id = UM()->config()->permalinks['logout'];
67
if ( um_is_core_page( 'logout' ) || ( $trid > 0 && $trid == $logout_page_id ) ) {
68
69
if ( is_user_logged_in() ) {
70
71
+ add_filter( 'wp_safe_redirect_fallback', array( &$this, 'safe_redirect_default' ), 10, 2 );
72
+
73
if ( isset( $_REQUEST['redirect_to'] ) && $_REQUEST['redirect_to'] !== '' ) {
74
wp_logout();
75
session_unset();
76
+ exit( wp_safe_redirect( $_REQUEST['redirect_to'] ) );
77
} else if ( um_user('after_logout') == 'redirect_home' ) {
78
wp_logout();
79
session_unset();
80
+ exit( wp_safe_redirect( home_url( $language_code ) ) );
81
} else {
82
/**
83
* UM hook
104
$redirect_url = apply_filters( 'um_logout_redirect_url', um_user( 'logout_redirect_url' ), um_user( 'ID' ) );
105
wp_logout();
106
session_unset();
107
+ exit( wp_safe_redirect( $redirect_url ) );
108
}
109
110
} else {
111
+ add_filter( 'wp_safe_redirect_fallback', array( &$this, 'safe_redirect_default' ), 10, 2 );
112
+ exit( wp_safe_redirect( home_url( $language_code ) ) );
113
}
114
115
}
includes/core/class-plugin-updater.php CHANGED
@@ -63,10 +63,6 @@ if ( ! class_exists( 'um\core\Plugin_Updater' ) ) {
63
'key' => 'instagram',
64
'title' => 'Instagram',
65
),
66
- 'um-invitations/um-invitations.php' => array(
67
- 'key' => 'invitations',
68
- 'title' => 'Invitations',
69
- ),
70
'um-mailchimp/um-mailchimp.php' => array(
71
'key' => 'mailchimp',
72
'title' => 'MailChimp',
@@ -125,18 +121,50 @@ if ( ! class_exists( 'um\core\Plugin_Updater' ) ) {
125
),
126
);
127
128
- $the_plugs = get_option( 'active_plugins' );
129
$active_um_plugins = array();
130
- foreach ( $the_plugs as $key => $value ) {
131
132
- if ( in_array( $value, array_keys( $paid_extensions ) ) ) {
133
- $license = UM()->options()->get( "um_{$paid_extensions[ $value ]['key']}_license_key" );
134
135
- if ( empty( $license ) )
136
- continue;
137
138
- $active_um_plugins[ $value ] = $paid_extensions[ $value ];
139
- $active_um_plugins[ $value ]['license'] = $license;
140
}
141
}
142
63
'key' => 'instagram',
64
'title' => 'Instagram',
65
),
66
'um-mailchimp/um-mailchimp.php' => array(
67
'key' => 'mailchimp',
68
'title' => 'MailChimp',
121
),
122
);
123
124
$active_um_plugins = array();
125
+ if ( is_multisite() ) {
126
+ // Per site activated
127
+ $sites = get_sites();
128
+
129
+ $sitewide_plugins = get_site_option( 'active_sitewide_plugins' );
130
+ $sitewide_plugins = array_keys( $sitewide_plugins );
131
+
132
+ foreach ( $sites as $site ) {
133
+ switch_to_blog( $site->blog_id );
134
+
135
+ $the_plugs = get_option( 'active_plugins' );
136
+ $the_plugs = array_merge( $the_plugs, $sitewide_plugins );
137
+
138
+ foreach ( $the_plugs as $key => $value ) {
139
+
140
+ if ( in_array( $value, array_keys( $paid_extensions ) ) ) {
141
+ $license = UM()->options()->get( "um_{$paid_extensions[ $value ]['key']}_license_key" );
142
+
143
+ if ( empty( $license ) ) {
144
+ continue;
145
+ }
146
147
+ $active_um_plugins[ $value ] = $paid_extensions[ $value ];
148
+ $active_um_plugins[ $value ]['license'] = $license;
149
+ }
150
+ }
151
+
152
+ restore_current_blog();
153
+ }
154
155
+ } else {
156
+ $the_plugs = get_option( 'active_plugins' );
157
+ foreach ( $the_plugs as $key => $value ) {
158
159
+ if ( in_array( $value, array_keys( $paid_extensions ) ) ) {
160
+ $license = UM()->options()->get( "um_{$paid_extensions[ $value ]['key']}_license_key" );
161
+
162
+ if ( empty( $license ) )
163
+ continue;
164
+
165
+ $active_um_plugins[ $value ] = $paid_extensions[ $value ];
166
+ $active_um_plugins[ $value ]['license'] = $license;
167
+ }
168
}
169
}
170
includes/core/class-profile.php CHANGED
@@ -184,14 +184,14 @@ if ( ! class_exists( 'um\core\Profile' ) ) {
184
*/
185
function tabs_enabled() {
186
$tabs = $this->tabs();
187
- foreach( $tabs as $id => $info ){
188
if ( isset( $info['name'] ) ) {
189
- if ( UM()->options()->get('profile_tab_'.$id) || isset( $info['_builtin'] ) ) {
190
- $primary[$id] = $info['name'];
191
}
192
}
193
}
194
- return ( isset( $primary ) ) ? $primary : '';
195
}
196
197
184
*/
185
function tabs_enabled() {
186
$tabs = $this->tabs();
187
+ foreach ( $tabs as $id => $info ) {
188
if ( isset( $info['name'] ) ) {
189
+ if ( UM()->options()->get( 'profile_tab_' . $id ) || isset( $info['_builtin'] ) ) {
190
+ $primary[ $id ] = $info['name'];
191
}
192
}
193
}
194
+ return isset( $primary ) ? $primary : '';
195
}
196
197
includes/core/class-rewrite.php CHANGED
@@ -46,8 +46,6 @@ if ( ! class_exists( 'um\core\Rewrite' ) ) {
46
$public_query_vars[] = 'um_action';
47
$public_query_vars[] = 'um_field';
48
$public_query_vars[] = 'um_form';
49
- $public_query_vars[] = 'um_resource';
50
- $public_query_vars[] = 'um_method';
51
$public_query_vars[] = 'um_verify';
52
53
return $public_query_vars;
@@ -64,7 +62,6 @@ if ( ! class_exists( 'um\core\Rewrite' ) ) {
64
function _add_rewrite_rules( $rules ) {
65
$newrules = array();
66
67
- $newrules['um-api/([^/]+)/([^/]+)/([^/]+)/([^/]+)/?#x27;] = 'index.php?um_page=api&um_action=$matches[1]&um_resource=$matches[2]&um_method=$matches[3]&um_verify=$matches[4]';
68
$newrules['um-download/([^/]+)/([^/]+)/([^/]+)/([^/]+)/?#x27;] = 'index.php?um_action=download&um_form=$matches[1]&um_field=$matches[2]&um_user=$matches[3]&um_verify=$matches[4]';
69
70
if ( isset( UM()->config()->permalinks['user'] ) ) {
46
$public_query_vars[] = 'um_action';
47
$public_query_vars[] = 'um_field';
48
$public_query_vars[] = 'um_form';
49
$public_query_vars[] = 'um_verify';
50
51
return $public_query_vars;
62
function _add_rewrite_rules( $rules ) {
63
$newrules = array();
64
65
$newrules['um-download/([^/]+)/([^/]+)/([^/]+)/([^/]+)/?#x27;] = 'index.php?um_action=download&um_form=$matches[1]&um_field=$matches[2]&um_user=$matches[3]&um_verify=$matches[4]';
66
67
if ( isset( UM()->config()->permalinks['user'] ) ) {
includes/core/class-router.php DELETED
@@ -1,115 +0,0 @@
1
- <?php
2
- namespace um\core;
3
-
4
- if ( ! defined( 'ABSPATH' ) ) exit;
5
-
6
- if ( ! class_exists( 'um\core\Router' ) ) {
7
-
8
-
9
- /**
10
- * Class Router
11
- * @package um\core
12
- */
13
- class Router {
14
-
15
-
16
- /**
17
- * Run backend process
18
- */
19
- function backend_requests() {
20
- $ip = isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : '';
21
- $user_id = get_current_user_id();
22
-
23
- if ( empty( $_REQUEST['um_action'] ) )
24
- exit( __( 'Wrong action', 'ultimate-member' ) );
25
-
26
- if ( empty( $_REQUEST['um_resource'] ) )
27
- exit( __( 'Wrong resource', 'ultimate-member' ) );
28
-
29
- if ( $_REQUEST['um_action'] == 'route' )
30
- $verify = wp_verify_nonce( $_REQUEST['um_verify'], $ip . $user_id . $_REQUEST['um_resource'] . $_REQUEST['um_method'] );
31
- else
32
- $verify = wp_verify_nonce( $_REQUEST['um_verify'], $ip . $user_id . $_REQUEST['um_action'] . $_REQUEST['um_resource'] );
33
-
34
- if ( empty( $verify ) )
35
- exit( __( 'Wrong nonce', 'ultimate-member' ) );
36
-
37
- $this->request_process( array(
38
- 'route' => $_REQUEST['um_resource'],
39
- 'method' => $_REQUEST['um_method']
40
- ) );
41
-
42
- /*if ($_REQUEST['um_action'] == 'download' || $_REQUEST['um_action'] == 'view') {
43
- WO()->downloader()->set_type( $_REQUEST['um_action'] )->process( array(
44
- 'id' => $_REQUEST['um_id'],
45
- 'resource' => $_REQUEST['um_resource'],
46
- 'action' => $_REQUEST['um_action']
47
- ) );
48
- } else if ($_REQUEST['um_action'] == 'route') {
49
- $this->request_process( array(
50
- 'route' => $_REQUEST['um_resource'],
51
- 'method' => $_REQUEST['um_method']
52
- ) );
53
- }*/
54
- }
55
-
56
-
57
- /**
58
- * Request process
59
- *
60
- * @param $params array
61
- * @return bool
62
- */
63
- function request_process( $params ) {
64
- if ( empty( $params['route'] ) || empty( $params['method'] ) )
65
- return false;
66
-
67
- $route = str_replace( array( '!', '/' ), '\\', $params['route'] );
68
-
69
- if ( ! class_exists( $route ) )
70
- return false;
71
-
72
- if ( method_exists( $route, 'instance' ) )
73
- $object = $route::instance();
74
- else
75
- $object = new $route();
76
-
77
- if ( ! method_exists( $object, $params['method'] ) )
78
- return false;
79
-
80
-
81
- call_user_func( array( &$object, $params['method'] ) );
82
- return true;
83
- }
84
-
85
-
86
- /**
87
- * Run frontend process
88
- */
89
- function frontend_requests() {
90
- $ip = isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : '';
91
- $user_id = get_current_user_id();
92
- if ( ! get_query_var( 'um_action' ) )
93
- exit( __( 'Wrong action', 'ultimate-member' ) );
94
-
95
- if ( ! get_query_var( 'um_resource' ) )
96
- exit( __( 'Wrong resource', 'ultimate-member' ) );
97
-
98
- $verify = false;
99
- if ( get_query_var( 'um_action' ) == 'route' )
100
- $verify = wp_verify_nonce( get_query_var( 'um_verify' ), $ip . $user_id . get_query_var( 'um_resource' ) . get_query_var( 'um_method' ) );
101
-
102
- if ( $verify ) {
103
- if ( get_query_var( 'um_action' ) == 'route' ) {
104
- $this->request_process( array(
105
- 'route' => get_query_var( 'um_resource' ),
106
- 'method' => get_query_var( 'um_method' )
107
- ) );
108
- }
109
- } else {
110
- exit( __( 'Wrong nonce', 'ultimate-member' ) );
111
- }
112
- }
113
-
114
- }
115
- }
includes/core/class-shortcodes.php CHANGED
@@ -558,7 +558,7 @@ if ( ! class_exists( 'um\core\Shortcodes' ) ) {
558
}
559
560
// get data into one global array
561
- $post_data = UM()->query()->post_data($this->form_id);
562
563
ob_start();
564
@@ -589,23 +589,22 @@ if ( ! class_exists( 'um\core\Shortcodes' ) ) {
589
$args['template'] = '';
590
}
591
592
- if (isset($post_data['template']) && $post_data['template'] != $args['template']) {
593
$args['template'] = $post_data['template'];
594
}
595
596
- if (!$this->template_exists($args['template'])) {
597
$args['template'] = $post_data['mode'];
598
}
599
600
- if (!isset($post_data['template'])) {
601
$post_data['template'] = $post_data['mode'];
602
}
603
604
- if( 'directory' != $args['mode'] ) {
605
-
606
$args = array_merge( $post_data, $args );
607
608
- if (empty( $args['use_custom_settings'] )) {
609
$args = array_merge( $args, $this->get_css_args( $args ) );
610
} else {
611
$args = array_merge( $this->get_css_args( $args ), $args );
@@ -648,8 +647,7 @@ if ( ! class_exists( 'um\core\Shortcodes' ) ) {
648
649
// for profiles only
650
if ( $mode == 'profile' && um_profile_id() ) {
651
- $use_custom = get_post_meta( $this->form_id, "_um_{$mode}_use_custom_settings", true );
652
- if ( $use_custom ) { // Custom Form settings
653
$current_user_roles = UM()->roles()->get_all_user_roles( um_profile_id() );
654
655
//backward compatibility between single/multi role form's setting
558
}
559
560
// get data into one global array
561
+ $post_data = UM()->query()->post_data( $this->form_id );
562
563
ob_start();
564
589
$args['template'] = '';
590
}
591
592
+ if ( isset( $post_data['template'] ) && $post_data['template'] != $args['template'] ) {
593
$args['template'] = $post_data['template'];
594
}
595
596
+ if ( ! $this->template_exists( $args['template'] ) ) {
597
$args['template'] = $post_data['mode'];
598
}
599
600
+ if ( ! isset( $post_data['template'] ) ) {
601
$post_data['template'] = $post_data['mode'];
602
}
603
604
+ if ( 'directory' != $args['mode'] ) {
605
$args = array_merge( $post_data, $args );
606
607
+ if ( empty( $args['use_custom_settings'] ) ) {
608
$args = array_merge( $args, $this->get_css_args( $args ) );
609
} else {
610
$args = array_merge( $this->get_css_args( $args ), $args );
647
648
// for profiles only
649
if ( $mode == 'profile' && um_profile_id() ) {
650
+ if ( ! empty( $args['use_custom_settings'] ) ) { // Custom Form settings
651
$current_user_roles = UM()->roles()->get_all_user_roles( um_profile_id() );
652
653
//backward compatibility between single/multi role form's setting
includes/core/class-user.php CHANGED
@@ -318,7 +318,7 @@ if ( ! class_exists( 'um\core\User' ) ) {
318
319
320
/**
321
- * Generate User Profile Slug and seve to meta
322
*
323
* @param int $user_id
324
* @param bool $force
@@ -360,7 +360,7 @@ if ( ! class_exists( 'um\core\User' ) ) {
360
361
} else {
362
363
- $user_in_url = sanitize_title( $user_in_url );
364
365
}
366
}
@@ -1540,7 +1540,7 @@ if ( ! class_exists( 'um\core\User' ) ) {
1540
*/
1541
function is_private_profile( $user_id ) {
1542
$privacy = get_user_meta( $user_id, 'profile_privacy', true );
1543
- if ( $privacy == __('Only me','ultimate-member') ) {
1544
return true;
1545
}
1546
return false;
318
319
320
/**
321
+ * Generate User Profile Slug and save to meta
322
*
323
* @param int $user_id
324
* @param bool $force
360
361
} else {
362
363
+ $user_in_url = urlencode( $user_in_url );
364
365
}
366
}
1540
*/
1541
function is_private_profile( $user_id ) {
1542
$privacy = get_user_meta( $user_id, 'profile_privacy', true );
1543
+ if ( $privacy == __('Only me','ultimate-member') || $privacy == 'Only me' ) {
1544
return true;
1545
}
1546
return false;
includes/core/um-actions-form.php CHANGED
@@ -327,63 +327,63 @@ function um_submit_form_errors_hook_( $args ) {
327
}
328
} elseif ( $op == 'not empty' ) {
329
if ( ! empty( $cond_value ) ) {
330
- continue 2;
331
}
332
} elseif ( $op == 'equals to' ) {
333
if ( $cond_value == $parent_value ) {
334
- continue 2;
335
}
336
} elseif ( $op == 'not equals' ) {
337
if ( $cond_value != $parent_value ) {
338
- continue 2;
339
}
340
} elseif ( $op == 'greater than' ) {
341
if ( $cond_value > $parent_value ) {
342
- continue 2;
343
}
344
} elseif ( $op == 'less than' ) {
345
if ( $cond_value < $parent_value ) {
346
- continue 2;
347
}
348
} elseif ( $op == 'contains' ) {
349
if ( is_string( $cond_value ) && strstr( $cond_value, $parent_value ) ) {
350
- continue 2;
351
}
352
if( is_array( $cond_value ) && in_array( $parent_value, $cond_value ) ) {
353
- continue 2;
354
}
355
}
356
} elseif ( $visibility == 'show' ) {
357
if ( $op == 'empty' ) {
358
if ( ! empty( $cond_value ) ) {
359
- continue 2;
360
}
361
} elseif ( $op == 'not empty' ) {
362
if ( empty( $cond_value ) ) {
363
- continue 2;
364
}
365
} elseif ( $op == 'equals to' ) {
366
if ( $cond_value != $parent_value ) {
367
- continue 2;
368
}
369
} elseif ( $op == 'not equals' ) {
370
if ( $cond_value == $parent_value ) {
371
- continue 2;
372
}
373
} elseif ( $op == 'greater than' ) {
374
if ( $cond_value <= $parent_value ) {
375
- continue 2;
376
}
377
} elseif ( $op == 'less than' ) {
378
if ( $cond_value >= $parent_value ) {
379
- continue 2;
380
}
381
} elseif ( $op == 'contains' ) {
382
if ( is_string( $cond_value ) && ! strstr( $cond_value, $parent_value ) ) {
383
- continue 2;
384
}
385
if( is_array( $cond_value ) && !in_array( $parent_value, $cond_value ) ) {
386
- continue 2;
387
}
388
}
389
}
327
}
328
} elseif ( $op == 'not empty' ) {
329
if ( ! empty( $cond_value ) ) {
330
+ continue;
331
}
332
} elseif ( $op == 'equals to' ) {
333
if ( $cond_value == $parent_value ) {
334
+ continue;
335
}
336
} elseif ( $op == 'not equals' ) {
337
if ( $cond_value != $parent_value ) {
338
+ continue;
339
}
340
} elseif ( $op == 'greater than' ) {
341
if ( $cond_value > $parent_value ) {
342
+ continue;
343
}
344
} elseif ( $op == 'less than' ) {
345
if ( $cond_value < $parent_value ) {
346