White Label CMS - Version 2.2

Version Description

  • Custom Welcome Dashboard fixes

=

Download this release

Release Info

Developer VideoUserManuals
Plugin Icon 128x128 White Label CMS
Version 2.2
Comparing to
See all releases

Code changes from version 2.1.3 to 2.2

assets/css/admin.css CHANGED
@@ -1 +1 @@
1
- .warning-text{color:rgba(240,116,95,.808);display:block}.not-wlcms-admin .update-plugins,.not-wlcms-admin tr[data-slug*=white-label-cms]{display:none!important}
1
+ .warning-text{color:rgba(240,116,95,.808);display:block}.not-wlcms-admin .update-plugins,.not-wlcms-admin tr[data-slug*=white-label-cms]{display:none!important}.wlcms-welcome-panel{display:none}.wlcms-welcome-panel .welcome-panel-content>h2{width:95%;padding-bottom:21px}#wpfooter img{max-height:60px}
assets/js/admin-settings.js CHANGED
@@ -1 +1 @@
1
- !function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=0)}([function(e,t,r){r(1),r(6),e.exports=r(11)},function(e,t){jQuery(document).ready((function(){jQuery(".wlcms-next-step").on("click",(function(){jQuery("#wlcms_tab_step-1").hide(),jQuery("#tab-step-1").hide(),jQuery("#wlcms_tab_step-2").show(),jQuery("#tab-step-2").show()})),jQuery(".wlcms-prev-step").on("click",(function(){jQuery("#wlcms_tab_step-2").hide(),jQuery("#tab-step-2").hide(),jQuery("#wlcms_tab_step-1").show(),jQuery("#tab-step-1").show()})),jQuery("form.wlcms-form").areYouSure({message:"Changes that you made may not be saved"}),jQuery(".reset-confirm").click((function(){if(0==confirm("Are you sure you want to reset!"))return!1}));var e=jQuery(".wlcms_wrapper .navigation"),t=e.offset();function r(e){var t=jQuery(".wlcms-form"),r=t.attr("action");-1!==r.indexOf("#")&&(hash=r.replace(/.*#/,"#"),r=r.replace(/#.*/,"")),t.attr({action:r+"#"+e})}jQuery(window).scroll((function(){var r=jQuery("#wpadminbar").height(),n=t.top-(e.height()+r);jQuery(this).scrollTop()>n?(e.addClass("fixed"),e.css({top:r}).width(jQuery(".wlcms_wrapper").width())):jQuery(this).scrollTop()<=t.top&&e.hasClass("fixed")&&e.removeClass("fixed")})),jQuery(".wlcms-navigation ul li a:not(.wlcms-ignore)").click((function(){var e=jQuery(this).attr("data-tab");jQuery(".wlcms-navigation ul li a").removeClass("current"),jQuery(".tab-content").removeClass("current"),jQuery(this).addClass("current"),jQuery(".wlcms_content section").removeClass("current"),jQuery(".wlcms_content section."+e).addClass("current"),r(e),jQuery("html, body").animate({scrollTop:0},400)}));var n=window.location.hash;function i(){jQuery(".wlcms-remove-img").on("click",(function(){var e=jQuery(this).parents(".wlcms-input-group");e.find(".wlcms-upload-thumbnail").html(""),e.find(".wlcms-upload-input").val("")}))}""!=(n=n.replace("#",""))?(jQuery(".wlcms-navigation ul li a#wlcms_"+n).addClass("current"),jQuery(".wlcms_content section."+n).addClass("current"),r(n)):0==jQuery(".wlcms_content section.current").length&&(jQuery(".wlcms_content section").eq(0).addClass("current"),jQuery(".wlcms-navigation ul li").eq(0).find("a").addClass("current")),jQuery(".wlcms_upload").click((function(){var e=wp.media.editor.send.attachment,t=jQuery(this);return wp.media.editor.send.attachment=function(r,n){var a='<img id="'+n.id+'" src="'+n.url+'" />';a+='<span class="dashicons dashicons-dismiss wlcms-remove-img"></span>',t.parents(".wlcms-input-group").find(".wlcms-upload-thumbnail").html(a),t.parents(".wlcms-input-group").find(".wlcms-upload-input").val(n.url),i(),wp.media.editor.send.attachment=e},wp.media.editor.open(),!1})),i(),jQuery(".wlcms-color-field").wpColorPicker(),jQuery(".wlcms-preview-link").on("click",(function(){jQuery("#wlcms-preview-content").html("...");var e=jQuery(".wlcms-form").serialize()+"&action=wlcms_save_login_preview_settings&_ajax_nonce="+wlcms_settings.wlcms_ajax_nonce;jQuery.ajax({type:"post",url:ajaxurl,data:e,success:function(e){jQuery("#wlcms-preview-content").html('<iframe allowtransparency="true" class="long-animate wlcms-preview-iframe" title="Login Preview" onmousewheel="" src="'+wlcms_settings.loginurl+'?wlcms-action=preview&preview_section=login&reauth=1"></iframe>'),jQuery("iframe.wlcms-preview-iframe").load((function(){var e=jQuery(this),t=e.contents();e.slideDown("slow"),t.find("body").prepend('<div style="text-align: center;position: absolute;top: 40px;margin: 0 30%;left: 0;font-weight: 300;font-size: 24px;background: #dad9d9cf;line-height: 35px;padding: 0;color: #790404;width: 40%;">Preview mode</div>'),t.find("form").attr("action","#"),t.find("#wp-submit").attr("type","button"),t.find("a").attr("href","#")}))}})})),jQuery(".wlcms-dashboard-preview-link").on("click",(function(){jQuery("#wlcms-dashboard-content").html("...");var e=jQuery(".wlcms-form").serialize()+"&action=wlcms_save_dashboard_preview_settings";jQuery.ajax({type:"post",url:ajaxurl,data:e,success:function(e){jQuery("#wlcms-preview-content").html('<iframe allowtransparency="true" class="long-animate wlcms-preview-iframe" title="Preview" onmousewheel="" src="'+wlcms_settings.adminurl+'?wlcms-action=preview&preview_section=dashboard"></iframe>'),jQuery("iframe.wlcms-preview-iframe").load((function(){var e=jQuery(this),t=e.contents();e.slideDown("slow"),t.find("body").prepend('<div style="text-align: center;position: absolute;top: 40px;margin: 0 30%;font-weight: 300;font-size: 24px;background: #dad9d9cf;line-height: 35px;padding: 0 20px;color: #790404;width: 40%;z-index:999999">Preview mode</div>'),t.find("a").each((function(){jQuery(this).attr("href","#")}))}))}})})),jQuery(".wlcms-select2").select2({width:"100%",placeholder:"Select"})})),jQuery.validator.addMethod("feedurl",(function(e,t){return this.optional(t)||/^(?:(?:(?:https?|ftp|feed):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(e)}),"Please use a valid URL"),jQuery.validator.messages.url="Please use a valid URL",jQuery(document).ready((function(){jQuery('.main-toggle[type="checkbox"]').change((function(e){var t=jQuery(this).prop("checked"),r=jQuery(this).attr("data-revised"),n=jQuery(this).parents(".toggle-group").find(".sub-fields");n.length&&(t&&"1"!=r&&n.find('input[type="checkbox"]:checked').length==n.find('input[type="checkbox"]').length||!t&&"1"==r?n.hide():n.show())})).trigger("change"),jQuery(".wlcms-toggle-arrow").on("click",(function(){jQuery(this).toggleClass("active"),jQuery(this).next("ul").slideToggle()})),jQuery("#enable_wlcms_admin").on("change",(function(){jQuery(this).is(":checked")?jQuery(".menu-admin-wrapper").show():jQuery(".menu-admin-wrapper").hide()})).trigger("change"),jQuery(".enable_welcome_for_all_roles").on("change",(function(){var e=jQuery("#select_user_roles"+jQuery(this).data("section"));jQuery(this).is(":checked")?e.hide():e.show()})).trigger("change"),jQuery('.wlcms-toggle[type="checkbox"]').change((function(e){var t=jQuery(this).prop("checked"),r=jQuery(this).parent();r.siblings();r.find('input[type="checkbox"]').prop({checked:t}),function e(r){var n=r.parent().parent(),i=!0;if(r.siblings().each((function(){return i=jQuery(this).children('input[type="checkbox"]').prop("checked")===t})),i&&t)n.children('input[type="checkbox"]').prop({checked:t}),e(n);else if(i&&!t)n.children('input[type="checkbox"]').prop("checked",t),n.children('input[type="checkbox"]').prop("indeterminate",n.find('input[type="checkbox"]:checked').length>0),e(n);else{var a=!0;r.parents("li").children('input[type="checkbox"]').hasClass("main-toggle-reverse")&&(a=!1),r.parents("li").children('input[type="checkbox"]').prop({checked:a})}}(r)})),jQuery(".wlcms-menus-settings > ul > li").each((function(){jQuery(this).find('input[type="checkbox"]:checked').length==jQuery(this).find('input[type="checkbox"]').length?jQuery(this).find("ul.sub_menu_wrapper").hide():jQuery(this).find("ul.sub_menu_wrapper").show()}));jQuery(".wlcms-form").validate({ignore:".ignore",rules:{rss_feed_address:{required:!1,feedurl:!0}},invalidHandler:function(e,t){var r=t.errorList;jQuery(".wlcms-navigation ul li span").remove();var n=[];for(i=0;i<r.length;i++){var a=r[i].element,s=jQuery(a).closest("section").attr("id");-1===n.indexOf(s)&&n.push(s),console.log(s)}for(i=0;i<n.length;i++)jQuery(".wlcms-navigation ul li a#wlcms_tab-"+n[i]).append('<span class="dashicons dashicons-no-alt"></span>');var c=t.numberOfInvalids();if(c){var o=1==c?"You missed 1 field. It has been highlighted":"You missed "+c+" fields. They have been highlighted";jQuery("div.wlcms_messages span").html(o),jQuery("div.wlcms_messages").show()}else jQuery("div.wlcms_messages").hide()}});jQuery(".template_type").on("change",(function(){var e=jQuery(this).data("template_type"),t=jQuery(".template_type"+e).filter(":checked"),r=t.data("page_type");"html"==t.val()?(jQuery(".welcome-basicHtml"+e).show(),jQuery(".welcome-page"+e).hide()):(jQuery(".welcome-basicHtml"+e).hide(),jQuery(".welcome-page"+e).show(),"beaver"==r?(jQuery(".beaver_page"+e).next().show(),jQuery(".elementor_page"+e).next().hide()):(jQuery(".beaver_page"+e).next().hide(),jQuery(".elementor_page"+e).next().show()))})),jQuery(".template_type").trigger("change"),jQuery("form.wlcms-advert").on("submit",(function(){var e=jQuery("#ad-authorize").is(":checked"),t=jQuery("#inf_custom_GDPR");t.val(e+" "+t.data("date"))}))}))},,,,,function(e,t){},,,,,function(e,t){}]);
1
+ !function(e){var t={};function i(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=e,i.c=t,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/",i(i.s=0)}([function(e,t,i){i(1),i(6),e.exports=i(11)},function(e,t){jQuery(document).ready((function(){jQuery(".wlcms-next-step").on("click",(function(){jQuery("#wlcms_tab_step-1").hide(),jQuery("#tab-step-1").hide(),jQuery("#wlcms_tab_step-2").show(),jQuery("#tab-step-2").show()})),jQuery(".wlcms-prev-step").on("click",(function(){jQuery("#wlcms_tab_step-2").hide(),jQuery("#tab-step-2").hide(),jQuery("#wlcms_tab_step-1").show(),jQuery("#tab-step-1").show()})),jQuery("form.wlcms-form").areYouSure({message:"Changes that you made may not be saved"}),jQuery('.template_type[data-page_type="html"]').each((function(){if(jQuery(this).is(":checked")){var e=jQuery(this).data("template_type");jQuery(this).closest(".sub-fields").find(".welcome_panel_fullwidth").is(":checked")?jQuery(".wlcms_welcome_panel_dismissible"+e).show():(jQuery(".wlcms_welcome_panel_dismissible"+e).hide(),jQuery(".wlcms_welcome_panel_dismissible"+e).find('input[type="checkbox"]').prop("checked",!1).trigger("change"))}})),jQuery(".welcome_panel_fullwidth").change((function(){var e=jQuery(this).closest(".wlcms-dashboard").data("wlcms_dashboard");jQuery(this).is(":checked")?jQuery(".wlcms_welcome_panel_dismissible"+e).show():(jQuery(".wlcms_welcome_panel_dismissible"+e).hide(),jQuery(".wlcms_welcome_panel_dismissible"+e).find('input[type="checkbox"]').prop("checked",!1).trigger("change"))})),jQuery(".wlcms_welcome_dismissible .wlcms-toggle-light").change((function(){var e=jQuery(this).closest(".wlcms_welcome_dismissible").find(".wlcms_welcome_dismissible_reset");jQuery(this).is(":checked")?e.show():e.hide()})).trigger("change"),jQuery(".reset-confirm").click((function(){if(0==confirm("Are you sure you want to reset!"))return!1}));var e=jQuery(".wlcms_wrapper .navigation"),t=e.offset();function i(e){var t=jQuery(".wlcms-form"),i=t.attr("action");-1!==i.indexOf("#")&&(hash=i.replace(/.*#/,"#"),i=i.replace(/#.*/,"")),t.attr({action:i+"#"+e})}jQuery(window).scroll((function(){var i=jQuery("#wpadminbar").height(),r=t.top-(e.height()+i);jQuery(this).scrollTop()>r?(e.addClass("fixed"),e.css({top:i}).width(jQuery(".wlcms_wrapper").width())):jQuery(this).scrollTop()<=t.top&&e.hasClass("fixed")&&e.removeClass("fixed")})),jQuery(".wlcms-navigation ul li a:not(.wlcms-ignore)").click((function(){var e=jQuery(this).attr("data-tab");jQuery(".wlcms-navigation ul li a").removeClass("current"),jQuery(".tab-content").removeClass("current"),jQuery(this).addClass("current"),jQuery(".wlcms_content section").removeClass("current"),jQuery(".wlcms_content section."+e).addClass("current"),i(e),jQuery("html, body").animate({scrollTop:0},400)}));var r=window.location.hash;function n(){jQuery(".wlcms-remove-img").on("click",(function(){var e=jQuery(this).parents(".wlcms-input-group");e.find(".wlcms-upload-thumbnail").html(""),e.find(".wlcms-upload-input").val("")}))}""!=(r=r.replace("#",""))?(jQuery(".wlcms-navigation ul li a#wlcms_"+r).addClass("current"),jQuery(".wlcms_content section."+r).addClass("current"),i(r)):0==jQuery(".wlcms_content section.current").length&&(jQuery(".wlcms_content section").eq(0).addClass("current"),jQuery(".wlcms-navigation ul li").eq(0).find("a").addClass("current")),jQuery(".wlcms_upload").click((function(){var e=wp.media.editor.send.attachment,t=jQuery(this);return wp.media.editor.send.attachment=function(i,r){var s='<img id="'+r.id+'" src="'+r.url+'" />';s+='<span class="dashicons dashicons-dismiss wlcms-remove-img"></span>',t.parents(".wlcms-input-group").find(".wlcms-upload-thumbnail").html(s),t.parents(".wlcms-input-group").find(".wlcms-upload-input").val(r.url),n(),wp.media.editor.send.attachment=e},wp.media.editor.open(),!1})),n(),jQuery(".wlcms-color-field").wpColorPicker(),jQuery(".wlcms-preview-link").on("click",(function(){jQuery("#wlcms-preview-content").html("...");var e=jQuery(".wlcms-form").serialize()+"&action=wlcms_save_login_preview_settings&_ajax_nonce="+wlcms_settings.wlcms_ajax_nonce;jQuery.ajax({type:"post",url:ajaxurl,data:e,success:function(e){jQuery("#wlcms-preview-content").html('<iframe allowtransparency="true" class="long-animate wlcms-preview-iframe" title="Login Preview" onmousewheel="" src="'+wlcms_settings.loginurl+'?wlcms-action=preview&preview_section=login&reauth=1"></iframe>'),jQuery("iframe.wlcms-preview-iframe").load((function(){var e=jQuery(this),t=e.contents();e.slideDown("slow"),t.find("body").prepend('<div style="text-align: center;position: absolute;top: 40px;margin: 0 30%;left: 0;font-weight: 300;font-size: 24px;background: #dad9d9cf;line-height: 35px;padding: 0;color: #790404;width: 40%;">Preview mode</div>'),t.find("form").attr("action","#"),t.find("#wp-submit").attr("type","button"),t.find("a").attr("href","#")}))}})})),jQuery(".wlcms-dashboard-preview-link").on("click",(function(){jQuery("#wlcms-dashboard-content").html("...");var e=jQuery(".wlcms-form").serialize()+"&action=wlcms_save_dashboard_preview_settings";jQuery.ajax({type:"post",url:ajaxurl,data:e,success:function(e){jQuery("#wlcms-preview-content").html('<iframe allowtransparency="true" class="long-animate wlcms-preview-iframe" title="Preview" onmousewheel="" src="'+wlcms_settings.adminurl+'?wlcms-action=preview&preview_section=dashboard"></iframe>'),jQuery("iframe.wlcms-preview-iframe").load((function(){var e=jQuery(this),t=e.contents();e.slideDown("slow"),t.find("body").prepend('<div style="text-align: center;position: absolute;top: 40px;margin: 0 30%;font-weight: 300;font-size: 24px;background: #dad9d9cf;line-height: 35px;padding: 0 20px;color: #790404;width: 40%;z-index:999999">Preview mode</div>'),t.find("a").each((function(){jQuery(this).attr("href","#")}))}))}})})),jQuery(".wlcms-select2").select2({width:"100%",placeholder:"Select"})})),jQuery.validator.addMethod("feedurl",(function(e,t){return this.optional(t)||/^(?:(?:(?:https?|ftp|feed):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(e)}),"Please use a valid URL"),jQuery.validator.messages.url="Please use a valid URL",jQuery(document).ready((function(){jQuery('.main-toggle[type="checkbox"]').change((function(e){var t=jQuery(this).prop("checked"),i=jQuery(this).attr("data-revised"),r=jQuery(this).parents(".toggle-group").find(".sub-fields");r.length&&(t&&"1"!=i&&r.find('input[type="checkbox"]:checked').length==r.find('input[type="checkbox"]').length||!t&&"1"==i?r.hide():r.show())})).trigger("change"),jQuery(".wlcms-toggle-arrow").on("click",(function(){jQuery(this).toggleClass("active"),jQuery(this).next("ul").slideToggle()})),jQuery("#enable_wlcms_admin").on("change",(function(){jQuery(this).is(":checked")?jQuery(".menu-admin-wrapper").show():jQuery(".menu-admin-wrapper").hide()})).trigger("change"),jQuery(".enable_welcome_for_all_roles").on("change",(function(){var e=jQuery("#select_user_roles"+jQuery(this).data("section"));jQuery(this).is(":checked")?e.hide():e.show()})).trigger("change"),jQuery('.wlcms-toggle[type="checkbox"]').change((function(e){var t=jQuery(this).prop("checked"),i=jQuery(this).parent();i.siblings();i.find('input[type="checkbox"]').prop({checked:t}),function e(i){var r=i.parent().parent(),n=!0;if(i.siblings().each((function(){return n=jQuery(this).children('input[type="checkbox"]').prop("checked")===t})),n&&t)r.children('input[type="checkbox"]').prop({checked:t}),e(r);else if(n&&!t)r.children('input[type="checkbox"]').prop("checked",t),r.children('input[type="checkbox"]').prop("indeterminate",r.find('input[type="checkbox"]:checked').length>0),e(r);else{var s=!0;i.parents("li").children('input[type="checkbox"]').hasClass("main-toggle-reverse")&&(s=!1),i.parents("li").children('input[type="checkbox"]').prop({checked:s})}}(i)})),jQuery(".wlcms-menus-settings > ul > li").each((function(){jQuery(this).find('input[type="checkbox"]:checked').length==jQuery(this).find('input[type="checkbox"]').length?jQuery(this).find("ul.sub_menu_wrapper").hide():jQuery(this).find("ul.sub_menu_wrapper").show()}));jQuery(".wlcms-form").validate({ignore:".ignore",rules:{rss_feed_address:{required:!1,feedurl:!0}},invalidHandler:function(e,t){var r=t.errorList;jQuery(".wlcms-navigation ul li span").remove();var n=[];for(i=0;i<r.length;i++){var s=r[i].element,a=jQuery(s).closest("section").attr("id");-1===n.indexOf(a)&&n.push(a),console.log(a)}for(i=0;i<n.length;i++)jQuery(".wlcms-navigation ul li a#wlcms_tab-"+n[i]).append('<span class="dashicons dashicons-no-alt"></span>');var c=t.numberOfInvalids();if(c){var l=1==c?"You missed 1 field. It has been highlighted":"You missed "+c+" fields. They have been highlighted";jQuery("div.wlcms_messages span").html(l),jQuery("div.wlcms_messages").show()}else jQuery("div.wlcms_messages").hide()}});jQuery(".template_type").on("change",(function(){var e=jQuery(this).data("template_type"),t=jQuery(".template_type"+e).filter(":checked"),i=t.data("page_type");if("html"==t.val()){if(jQuery(".welcome-basicHtml"+e).show(),jQuery(".welcome-page"+e).hide(),jQuery(".welcome-basicHtml"+e+" .welcome_panel_fullwidth").is(":checked"))return void jQuery(".wlcms_welcome_panel_dismissible"+e).show();jQuery(".wlcms_welcome_panel_dismissible"+e).hide()}else jQuery(".wlcms_welcome_panel_dismissible"+e).show(),jQuery(".welcome-basicHtml"+e).hide(),jQuery(".welcome-page"+e).show(),"beaver"==i?(jQuery(".beaver_page"+e).next().show(),jQuery(".elementor_page"+e).next().hide()):(jQuery(".beaver_page"+e).next().hide(),jQuery(".elementor_page"+e).next().show())})),jQuery(".template_type").trigger("change"),jQuery("form.wlcms-advert").on("submit",(function(){var e=jQuery("#ad-authorize").is(":checked"),t=jQuery("#inf_custom_GDPR");t.val(e+" "+t.data("date"))}))}))},,,,,function(e,t){},,,,,function(e,t){}]);
changelog.txt CHANGED
@@ -1,5 +1,8 @@
1
  == Changelog ==
2
 
 
 
 
3
  = 2.1.2 =
4
  * Support fonts import
5
  * Added custom javascript for the login page
1
  == Changelog ==
2
 
3
+ = 2.1.3 =
4
+ * Added compatibility with WordPress 5.4
5
+
6
  = 2.1.2 =
7
  * Support fonts import
8
  * Added custom javascript for the login page
includes/classes/Admin_Dashboard.php CHANGED
@@ -16,6 +16,8 @@ class WLCMS_Admin_Dashboard extends WLCMS_Previewable
16
  $this->check_preview();
17
 
18
  add_action('wp_dashboard_setup', array($this, 'dashboard_setup'), 999);
 
 
19
  }
20
 
21
  public function dashboard_setup()
@@ -31,6 +33,7 @@ class WLCMS_Admin_Dashboard extends WLCMS_Previewable
31
  if (is_wlcms_admin()) return;
32
  } else {
33
  $dashboard_widgets_visibility_roles = wlcms_field_setting('dashboard_widgets_visibility_roles');
 
34
  if (!$this->has_current_user_role($dashboard_widgets_visibility_roles))
35
  return;
36
  }
@@ -49,7 +52,8 @@ class WLCMS_Admin_Dashboard extends WLCMS_Previewable
49
  .wlcms-welcome-panel-content .elementor h2,
50
  .wlcms-welcome-panel-content .elementor h3
51
  .wlcms-welcome-panel-content .elementor h4
52
- .wlcms-welcome-panel-content .elementor h5',
 
53
  array(
54
  'border' => '0',
55
  'font-size' => '100%',
@@ -59,6 +63,13 @@ class WLCMS_Admin_Dashboard extends WLCMS_Previewable
59
  'color' => 'inherit'
60
  )
61
  );
 
 
 
 
 
 
 
62
  }
63
 
64
  private function set_dashboard_all_hidden()
@@ -172,6 +183,12 @@ class WLCMS_Admin_Dashboard extends WLCMS_Previewable
172
  private function set_welcome_metabox()
173
  {
174
 
 
 
 
 
 
 
175
  $welcome_panels = wlcms_field_setting('welcome_panel');
176
 
177
  if (!$welcome_panels || !is_array($welcome_panels)) {
@@ -182,20 +199,29 @@ class WLCMS_Admin_Dashboard extends WLCMS_Previewable
182
  return;
183
  }
184
 
185
-
 
 
 
186
  foreach ($welcome_panels as $key => $welcome_panel) {
187
-
188
  if (!$this->is_welcome_panel_visible($welcome_panel) || !is_array($welcome_panel)) {
 
 
 
 
 
 
189
 
190
  continue;
191
  }
192
 
193
- $this->set_welcome_panel_content($welcome_panel);
194
- $this->make_welcome_panel($key);
195
  }
196
 
 
 
197
  wlcms_set_css('.index-php .wlcms-welcome-panel-content', array('margin' => '13px', 'padding-bottom' => '25px!important'));
198
- add_action('admin_footer', array($this, 'welcome_panel_footer'));
199
  }
200
 
201
  private function is_welcome_panel_visible($setting)
@@ -227,109 +253,6 @@ class WLCMS_Admin_Dashboard extends WLCMS_Previewable
227
  return in_array($user_role, $roles);
228
  }
229
 
230
- private function set_welcome_panel_content($config)
231
- {
232
- $this->is_fullwidth = true;
233
-
234
- $this->welcome_show_title = isset($config['show_title']) && $config['show_title'] == 1;
235
- $template_type = isset($config['template_type']) ? $config['template_type'] : 'html';
236
-
237
- if ($template_type == 'Elementor' && wlcms_is_elementor_active()) :
238
- $id = isset($config['page_id_elementor']) ? $config['page_id_elementor'] : null;
239
- $desciption = $this->page_builder_elementor($id);
240
- $title = get_the_title($id);
241
- elseif ($template_type == 'Beaver Builder' && wlcms_is_beaver_builder_active()) :
242
- $id = isset($config['page_id_beaver']) ? $config['page_id_beaver'] : null;
243
- $desciption = $this->page_builder_beaver_builder($id);
244
- $title = get_the_title($id);
245
- else :
246
- $title = isset($config['title']) ? $config['title'] : null;
247
- $desciption = isset($config['description']) ? $config['description'] : null;
248
- $this->is_fullwidth = isset($config['is_fullwidth']) ? $config['is_fullwidth'] : false;
249
- $this->welcome_show_title = true;
250
- endif;
251
-
252
- $this->welcome_title = $title;
253
-
254
- $this->set_welcom_description($desciption);
255
-
256
- }
257
-
258
- public function set_welcom_description($des)
259
- {
260
- $this->welcome_description = $des;
261
- }
262
-
263
- public function get_welcom_description()
264
- {
265
- return $this->welcome_description;
266
- }
267
-
268
- public function compile_welcome_content($key)
269
- {
270
- $title = ($this->welcome_show_title) ? sprintf("<h2>%s</h2>", $this->welcome_title) : '';
271
- $content = sprintf(
272
- "<div id=\"welcome-panel%1\$d\" class=\"welcome-panel\" style=\"display:none\"><div class=\"wlcms-welcome-panel-content\">%2\$s<div class=\"welcome-panel-column-container\">%3\$s</div></div></div>",
273
- $key,
274
- $title,
275
- $this->welcome_description
276
- );
277
-
278
- $this->welcome_content .= $content;
279
- }
280
-
281
- public function welcome_panel_footer()
282
- {
283
- echo $this->welcome_content;
284
- }
285
-
286
- private function make_welcome_panel($key)
287
- {
288
-
289
- if ($this->is_fullwidth) {
290
- $this->compile_welcome_content($key);
291
- $welcome = sprintf(";jQuery('#welcome-panel%1\$d').insertBefore('#dashboard-widgets-wrap');jQuery('#welcome-panel%1\$d').show();", $key);
292
- wlcms_add_js($welcome);
293
- return;
294
- }
295
-
296
- wp_add_dashboard_widget(
297
- 'custom_help_widget' . $key,
298
- $this->welcome_title,
299
- array($this, 'welcome_description'),
300
- null,
301
- array('desc' => $this->get_welcom_description())
302
- );
303
-
304
- }
305
-
306
- public function welcome_description($post, $callback_args)
307
- {
308
- echo $callback_args['args']['desc'];
309
- }
310
-
311
- public function page_builder_beaver_builder($template = false)
312
- {
313
- if (!$template) return;
314
-
315
- add_action('admin_enqueue_scripts', 'FLBuilder::register_layout_styles_scripts');
316
- return do_shortcode('[fl_builder_insert_layout id="' . $template . '"]');
317
- }
318
-
319
- public function page_builder_elementor($template = false)
320
- {
321
- if (!$template) return;
322
-
323
- $elementor = @Elementor\Plugin::instance();
324
-
325
- $elementor->frontend->register_styles();
326
- $elementor->frontend->enqueue_styles();
327
-
328
- $elementor->frontend->register_scripts();
329
- $elementor->frontend->enqueue_scripts();
330
- return $elementor->frontend->get_builder_content($template, true);
331
- }
332
-
333
  /**
334
  * Remove Dashboard Border Line if set to true
335
  *
@@ -457,4 +380,35 @@ class WLCMS_Admin_Dashboard extends WLCMS_Previewable
457
  echo $rss_list;
458
  }
459
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
460
  }
16
  $this->check_preview();
17
 
18
  add_action('wp_dashboard_setup', array($this, 'dashboard_setup'), 999);
19
+ add_action("wp_ajax_hide_vum_dashboard", array($this, "hide_vum_dashboard"));
20
+ add_action("admin_init", array($this, "reset_welcome_dashboard"));
21
  }
22
 
23
  public function dashboard_setup()
33
  if (is_wlcms_admin()) return;
34
  } else {
35
  $dashboard_widgets_visibility_roles = wlcms_field_setting('dashboard_widgets_visibility_roles');
36
+ if( ! $dashboard_widgets_visibility_roles ) return;
37
  if (!$this->has_current_user_role($dashboard_widgets_visibility_roles))
38
  return;
39
  }
52
  .wlcms-welcome-panel-content .elementor h2,
53
  .wlcms-welcome-panel-content .elementor h3
54
  .wlcms-welcome-panel-content .elementor h4
55
+ .wlcms-welcome-panel-content .elementor h5
56
+ .wlcms-welcome-panel-content .fl-builder-content p',
57
  array(
58
  'border' => '0',
59
  'font-size' => '100%',
63
  'color' => 'inherit'
64
  )
65
  );
66
+
67
+ wlcms_set_css( '.wlcms-welcome-panel .welcome-panel-content > h2',
68
+ array(
69
+ 'width' => '95%',
70
+ 'padding-bottom' => '21px'
71
+ )
72
+ );
73
  }
74
 
75
  private function set_dashboard_all_hidden()
183
  private function set_welcome_metabox()
184
  {
185
 
186
+ $user_id = get_current_user_id();
187
+ if( $user_id == 0 )
188
+ {
189
+ return false;
190
+ }
191
+
192
  $welcome_panels = wlcms_field_setting('welcome_panel');
193
 
194
  if (!$welcome_panels || !is_array($welcome_panels)) {
199
  return;
200
  }
201
 
202
+
203
+ $admin_Dashboard_Welcome_Message = wlcms()->require_class("Admin_Dashboard_Welcome_Message");
204
+ $admin_Dashboard_Welcome_Message = new Admin_Dashboard_Welcome_Message();
205
+
206
  foreach ($welcome_panels as $key => $welcome_panel) {
 
207
  if (!$this->is_welcome_panel_visible($welcome_panel) || !is_array($welcome_panel)) {
208
+ continue;
209
+ }
210
+
211
+ $welcome_content_hidden = get_user_meta($user_id, 'vum_hide_dashboard' . $key ,true);
212
+
213
+ if( $welcome_content_hidden && isset($welcome_panel['dismissible']) ) {
214
 
215
  continue;
216
  }
217
 
218
+ $admin_Dashboard_Welcome_Message->set($welcome_panel, $key);
219
+ $admin_Dashboard_Welcome_Message->handle();
220
  }
221
 
222
+ $admin_Dashboard_Welcome_Message->make_welcome_panel($welcome_panels);
223
+
224
  wlcms_set_css('.index-php .wlcms-welcome-panel-content', array('margin' => '13px', 'padding-bottom' => '25px!important'));
 
225
  }
226
 
227
  private function is_welcome_panel_visible($setting)
253
  return in_array($user_role, $roles);
254
  }
255
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
256
  /**
257
  * Remove Dashboard Border Line if set to true
258
  *
380
  echo $rss_list;
381
  }
382
 
383
+ public function hide_vum_dashboard()
384
+ {
385
+ if ( !wp_verify_nonce( $_REQUEST['nonce'], "vum_hide_dashboard_nonce")) {
386
+ exit("No naughty business please");
387
+ }
388
+ $user_id = get_current_user_id();
389
+ if( $user_id == 0 )
390
+ {
391
+ return false;
392
+ }
393
+
394
+ $key = sanitize_text_field($_POST['key']);
395
+ update_user_meta($user_id, 'vum_hide_dashboard' . $key, 1);
396
+ echo json_encode(array('type' => 'success'));
397
+ exit;
398
+ }
399
+
400
+ public function reset_welcome_dashboard()
401
+ {
402
+ if(! isset($_GET['wlcms-action']) ) return;
403
+
404
+ if( $_GET['wlcms-action'] !== 'reset-welcome-dashboard' ) return;
405
+ if(! isset($_GET['dashboard']) ) return;
406
+
407
+ if( ! is_wlcms_super_admin() ) return;
408
+ $key = sanitize_text_field($_GET['dashboard']);
409
+
410
+ delete_metadata( 'user', 0, 'vum_hide_dashboard'. $key, '', true );
411
+
412
+ WLCMS_Queue('Welcome dashboard message successfully reset.');
413
+ }
414
  }
includes/classes/Admin_Dashboard_Welcome_Message.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Admin_Dashboard_Welcome_Message
4
+ {
5
+ private $settings, $key;
6
+
7
+ public function set($settings, $key)
8
+ {
9
+ $this->settings = $settings;
10
+ $this->key = $key;
11
+ }
12
+
13
+ public function handle()
14
+ {
15
+
16
+ if( ! $this->settings['template_type'] ) return;
17
+ $type = $this->settings['template_type'];
18
+ wlcms()->require_class("Welcome_Messages/Welcome_Messages_Elementor");
19
+ wlcms()->require_class("Welcome_Messages/Welcome_Messages_Html");
20
+ wlcms()->require_class("Welcome_Messages/Welcome_Messages_Beaver_Builder");
21
+
22
+ if( $type == 'Elementor' ){
23
+ $template = new Welcome_Messages_Elementor();
24
+ }elseif( $type == 'Beaver Builder' ){
25
+ $template = new Welcome_Messages_Beaver_Builder();
26
+
27
+ }else {
28
+ $template = new Welcome_Messages_Html();
29
+ }
30
+
31
+ $template->process($this->settings, $this->key);
32
+
33
+ }
34
+
35
+ public function make_welcome_panel()
36
+ {
37
+
38
+ $nonce = wp_create_nonce("vum_hide_dashboard_nonce");
39
+ $link = admin_url('admin-ajax.php');
40
+
41
+ $welcome = sprintf(";jQuery('.wlcms-welcome-panel a.welcome-panel-close').on('click', function(e){
42
+ e.preventDefault();
43
+ var vum_panel = jQuery(this).parent('.wlcms-welcome-panel');
44
+ jQuery.ajax({
45
+ type : 'post',
46
+ dataType : 'json',
47
+ url : '%s',
48
+ data : {action: 'hide_vum_dashboard', key : vum_panel.data('welcome_key'), nonce: '%s'},
49
+ success: function(response) {
50
+ if(response.type == 'success') {
51
+ vum_panel.hide();
52
+ }
53
+ }
54
+ })
55
+ });", $link, $nonce);
56
+ wlcms_add_js($welcome);
57
+ }
58
+ }
includes/classes/Admin_Menus.php CHANGED
@@ -568,7 +568,6 @@ class WLCMS_Admin_Menus
568
  <input type="hidden" value="my-account" name="admin_bar_menus[]">
569
  <input type="hidden" value="user-actions" name="admin_bar_menus[]">
570
  <input type="hidden" value="logout" name="admin_bar_menus[]">
571
-
572
  ';
573
 
574
  foreach ($menu as $menu_props) {
568
  <input type="hidden" value="my-account" name="admin_bar_menus[]">
569
  <input type="hidden" value="user-actions" name="admin_bar_menus[]">
570
  <input type="hidden" value="logout" name="admin_bar_menus[]">
 
571
  ';
572
 
573
  foreach ($menu as $menu_props) {
includes/classes/Branding.php CHANGED
@@ -53,6 +53,9 @@ class WLCMS_Branding extends WLCMS_Previewable
53
  'align-items' => 'center'
54
  )
55
  );
 
 
 
56
  }
57
  }
58
 
@@ -205,8 +208,6 @@ class WLCMS_Branding extends WLCMS_Previewable
205
 
206
  if ($footer_image) {
207
  $footer_main_text .= '<img src="' . $footer_image . '" /> ';
208
- wlcms_set_css('#footer-left img', array('vertical-align' => 'middle', 'max-height' => '50px', 'margin-right' => '5px'));
209
- wlcms_set_css('#footer-left a', array('text-decoration' => 'none'));
210
  }
211
 
212
  if ($footer_text) {
53
  'align-items' => 'center'
54
  )
55
  );
56
+
57
+ wlcms_set_css('#footer-left img', array('vertical-align' => 'middle', 'max-height' => '50px', 'margin-right' => '5px'));
58
+ wlcms_set_css('#footer-left a', array('text-decoration' => 'none'));
59
  }
60
  }
61
 
208
 
209
  if ($footer_image) {
210
  $footer_main_text .= '<img src="' . $footer_image . '" /> ';
 
 
211
  }
212
 
213
  if ($footer_text) {
includes/classes/Messages.php CHANGED
@@ -21,6 +21,7 @@ class WLCMS_Messages
21
  public static function show()
22
  {
23
  $group_messages = maybe_unserialize(get_option('_wlcms_messages'));
 
24
  if (!$group_messages) {
25
  return;
26
  }
@@ -29,9 +30,11 @@ class WLCMS_Messages
29
  if (is_array($group_messages)) {
30
  foreach ($group_messages as $class => $messages) {
31
  $errors .= '<div class="notice notice-' . $class . ' is-dismissible"">';
 
32
  foreach ($messages as $message) {
 
33
  $errors .= '<p>' . $message . '</p>';
34
-
35
  }
36
  $errors .= '</div>';
37
  }
@@ -48,4 +51,5 @@ if (class_exists('WLCMS_Messages') && !function_exists('WLCMS_Queue')) {
48
  {
49
  WLCMS_Messages::queue($message, $class);
50
  }
51
- }
 
21
  public static function show()
22
  {
23
  $group_messages = maybe_unserialize(get_option('_wlcms_messages'));
24
+
25
  if (!$group_messages) {
26
  return;
27
  }
30
  if (is_array($group_messages)) {
31
  foreach ($group_messages as $class => $messages) {
32
  $errors .= '<div class="notice notice-' . $class . ' is-dismissible"">';
33
+ $prev_message = '';
34
  foreach ($messages as $message) {
35
+ if( $prev_message != $message)
36
  $errors .= '<p>' . $message . '</p>';
37
+ $prev_message = $message;
38
  }
39
  $errors .= '</div>';
40
  }
51
  {
52
  WLCMS_Messages::queue($message, $class);
53
  }
54
+ }
55
+ add_action('admin_notices', array('WLCMS_Messages', 'show'));
includes/classes/Welcome_Messages/Welcome_Messages_Beaver_Builder.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Welcome_Messages_Beaver_Builder
3
+ {
4
+ private $key;
5
+ private $settings;
6
+ private $template;
7
+ public function process($settings, $key)
8
+ {
9
+ if( ! isset($settings['page_id_beaver']) ) return;
10
+
11
+ $this->key = $key;
12
+ $this->settings = $settings;
13
+ $this->template = $settings['page_id_beaver'];
14
+ add_action( 'admin_notices', array( $this, 'welcome_panel' ) );
15
+ add_action('admin_enqueue_scripts', 'FLBuilder::register_layout_styles_scripts');
16
+ }
17
+
18
+ public function template()
19
+ {
20
+ global $post;
21
+
22
+ $old_post = $post;
23
+ $post = (object) [ 'ID' => $this->template ];
24
+
25
+ echo do_shortcode('[fl_builder_insert_layout id="' . $this->template . '"]');
26
+
27
+ $post = $old_post;
28
+ }
29
+
30
+ public function welcome_panel()
31
+ {
32
+ ?>
33
+ <div id="welcome-panel<?php echo $this->key?>" data-welcome_key="<?php echo $this->key?>" class="welcome-panel wlcms-welcome-panel" style="display:none">
34
+ <?php
35
+ if(isset($this->settings['dismissible'])):
36
+ ?><a class="welcome-panel-close" href="#" aria-label="Dismiss the welcome panel">Dismiss</a>
37
+ <?php endif?>
38
+ <div class="welcome-panel-content welcome-panel-content<?php echo $this->key?>">
39
+ <h2>
40
+ <?php if( isset($this->settings['page_id_beaver']) && isset($this->settings['show_title']) ):?>
41
+ <?php echo get_the_title($this->settings['page_id_beaver'])?>
42
+ <?php endif;?>
43
+ &nbsp;
44
+ </h2>
45
+ <?php $this->template(); ?>
46
+ </div>
47
+ </div>
48
+ <?php
49
+ $welcome = sprintf(";jQuery('#welcome-panel%1\$d').insertBefore('#dashboard-widgets-wrap');jQuery('#welcome-panel%1\$d').show();", $this->key);
50
+ wlcms_add_js($welcome);
51
+ }
52
+ }
includes/classes/Welcome_Messages/Welcome_Messages_Elementor.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Welcome_Messages_Elementor
3
+ {
4
+ private $key;
5
+ private $settings;
6
+ public function process($settings, $key)
7
+ {
8
+ if( ! isset($settings['page_id_elementor']) ) return;
9
+ if( $settings['page_id_elementor'] == "" ) return;
10
+
11
+ $this->key = $key;
12
+ $this->settings = $settings;
13
+ add_action( 'admin_notices', array( $this, 'welcome_panel' ) );
14
+ }
15
+
16
+ public function welcome_panel()
17
+ {
18
+ ?>
19
+ <div id="welcome-panel<?php echo $this->key?>" data-welcome_key="<?php echo $this->key?>" class="welcome-panel wlcms-welcome-panel" style="display:none">
20
+ <?php
21
+ if(isset($this->settings['dismissible'])):
22
+ ?><a class="welcome-panel-close" href="#" aria-label="Dismiss the welcome panel">Dismiss</a>
23
+ <?php endif?>
24
+ <div class="welcome-panel-content welcome-panel-content<?php echo $this->key?>">
25
+ <h2>
26
+ <?php if( isset($this->settings['page_id_elementor']) && isset($this->settings['show_title']) ):?>
27
+ <?php echo get_the_title($this->settings['page_id_elementor'])?>
28
+ <?php endif;?>
29
+ &nbsp;
30
+ </h2>
31
+ <?php $this->template(); ?>
32
+ </div>
33
+ </div>
34
+ <?php
35
+ $welcome = sprintf(";jQuery('#welcome-panel%1\$d').insertBefore('#dashboard-widgets-wrap');jQuery('#welcome-panel%1\$d').show();", $this->key);
36
+ wlcms_add_js($welcome);
37
+ }
38
+
39
+ public function template()
40
+ {
41
+ if( ! $this->settings['page_id_elementor'] ) return;
42
+ $elementor = @Elementor\Plugin::instance();
43
+
44
+ $elementor->frontend->register_styles();
45
+ $elementor->frontend->enqueue_styles();
46
+
47
+ $elementor->frontend->register_scripts();
48
+ $elementor->frontend->enqueue_scripts();
49
+
50
+ echo $elementor->frontend->get_builder_content($this->settings['page_id_elementor'], true);
51
+
52
+ }
53
+ }
includes/classes/Welcome_Messages/Welcome_Messages_Html.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Welcome_Messages_Html
3
+ {
4
+ private $key;
5
+ private $settings;
6
+ public function process($settings, $key)
7
+ {
8
+ $this->key = $key;
9
+ $this->settings = $settings;
10
+ //var_dump($this->settings);
11
+ //exit;
12
+
13
+ if( isset( $this->settings['is_fullwidth']) && $this->settings['is_fullwidth'] == 1 )
14
+ {
15
+ remove_action( 'welcome_panel', 'wp_welcome_panel' );
16
+ add_action( 'welcome_panel', array( $this, 'welcome_panel' ) );
17
+ if ( ! current_user_can( 'edit_theme_options' ) ) {
18
+ add_action( 'admin_notices', array( $this, 'welcome_panel' ) );
19
+ }
20
+ return;
21
+ }
22
+
23
+ wp_add_dashboard_widget(
24
+ 'custom_help_widget' . $key,
25
+ isset($this->settings['title']) ? $this->settings['title'] : '&nbsp;',
26
+ array($this, 'welcome_description'),
27
+ null,
28
+ array('desc' => $this->template())
29
+ );
30
+ }
31
+
32
+ public function welcome_description($post, $callback_args)
33
+ {
34
+ echo $callback_args['args']['desc'];
35
+ }
36
+
37
+ public function welcome_panel()
38
+ {?>
39
+ <div id="welcome-panel<?php echo $this->key?>" data-welcome_key="<?php echo $this->key?>" class="welcome-panel wlcms-welcome-panel">
40
+ <?php
41
+ if(isset($this->settings['dismissible'])):
42
+ ?><a class="welcome-panel-close" href="#" aria-label="Dismiss the welcome panel">Dismiss</a>
43
+ <?php endif?>
44
+ <div class="welcome-panel-content welcome-panel-content<?php echo $this->key?>" style="padding-bottom:20px">
45
+ <?php if(isset( $this->settings['title'] )):?>
46
+ <h2><?php echo $this->settings['title']?></h2>
47
+ <?php endif;?>
48
+ <?php echo $this->template(); ?>
49
+ </div>
50
+ </div>
51
+ <?php
52
+ $welcome = sprintf(";jQuery('#welcome-panel%1\$d').insertBefore('#dashboard-widgets-wrap');jQuery('#welcome-panel%1\$d').show();", $this->key);
53
+ wlcms_add_js($welcome);
54
+ }
55
+
56
+ public function template()
57
+ {
58
+ return isset($this->settings['description']) ? $this->settings['description'] : '';
59
+ }
60
+ }
readme.txt CHANGED
@@ -9,7 +9,7 @@ Author: Video User Manuals
9
  Requires at least: 3.3
10
  Requires PHP: 5.4
11
  Tested up to: 5.4
12
- Stable tag: 2.1.3
13
 
14
  Customise dashboard panels and branding, hide menus plus lots more.
15
 
@@ -66,8 +66,8 @@ There is so much that you can do with White Label CMS, but we want the experienc
66
 
67
  == Changelog ==
68
 
69
- = 2.1.3 =
70
- * Added compatibility with WordPress 5.4
71
 
72
  == Frequently Asked Questions ==
73
  = Who is this plugin for?=
9
  Requires at least: 3.3
10
  Requires PHP: 5.4
11
  Tested up to: 5.4
12
+ Stable tag: 2.2
13
 
14
  Customise dashboard panels and branding, hide menus plus lots more.
15
 
66
 
67
  == Changelog ==
68
 
69
+ = 2.2 =
70
+ * Custom Welcome Dashboard fixes
71
 
72
  == Frequently Asked Questions ==
73
  = Who is this plugin for?=
view/admin/parts/dashboard-custom-welcome-dashboard-panel.php CHANGED
@@ -2,7 +2,7 @@
2
  <?php
3
  $welcome_panel_is_active = wlcms_welcome_value(0, 'is_active');
4
  ?>
5
- <div class="wlcms-input-group toggle-group">
6
  <div class="wlcms-help">
7
  <?php _e('Add your own Welcome Panel to the Dashboard page. This will appear on the dashboard. We recommend providing your contact details and links to the help files you have made for your client.', 'white-label-cms') ?>
8
  </div>
@@ -88,7 +88,7 @@ $welcome_panel_is_active = wlcms_welcome_value(0, 'is_active');
88
 
89
  <div class="welcome-basicHtml1">
90
  <div class="wlcms-input">
91
- <input class="wlcms-toggle wlcms-toggle-light" id="own_welcome_panel_fullwidth" value="1" name="welcome_panel[0][is_fullwidth]" <?php checked(wlcms_welcome_value(0 , 'is_fullwidth'), 1, true) ?> type="checkbox"/>
92
  <label class="wlcms-toggle-btn" for="own_welcome_panel_fullwidth"></label><label class="toggle-label" for="own_welcome_panel_fullwidth"><?php _e('Make full-width');?></label>
93
  </div>
94
  </div>
@@ -102,6 +102,16 @@ $welcome_panel_is_active = wlcms_welcome_value(0, 'is_active');
102
  <?php
103
  endif;
104
  ?>
 
 
 
 
 
 
 
 
 
 
105
  </div>
106
  </div>
107
 
@@ -109,7 +119,7 @@ $welcome_panel_is_active = wlcms_welcome_value(0, 'is_active');
109
  <?php
110
  $welcome_panel_is_active = wlcms_welcome_value(1, 'is_active');
111
  ?>
112
- <div class="wlcms-input-group toggle-group">
113
  <div class="wlcms-input">
114
  <input class="wlcms-toggle wlcms-toggle-light main-toggle" id="add_second_panel" data-revised="1" name="welcome_panel[1][is_active]" value="1" type="checkbox" <?php checked($welcome_panel_is_active, 1, true) ?>/>
115
  <label class="wlcms-toggle-btn" for="add_second_panel"></label><label class="toggle-label" for="add_second_panel"><?php _e('Add Second Panel', 'white-label-cms') ?></label>
@@ -176,7 +186,7 @@ $welcome_panel_is_active = wlcms_welcome_value(1, 'is_active');
176
 
177
  <div class="welcome-basicHtml2">
178
  <div class="wlcms-input">
179
- <input class="wlcms-toggle wlcms-toggle-light" id="second_welcome_panel_fullwidth" value="1" name="welcome_panel[1][is_fullwidth]" <?php checked(wlcms_welcome_value(1, 'is_fullwidth'), 1, true) ?> type="checkbox"/>
180
  <label class="wlcms-toggle-btn" for="second_welcome_panel_fullwidth"></label><label class="toggle-label" for="second_welcome_panel_fullwidth"><?php _e('Make full-width');?></label>
181
  </div>
182
  <div class="wlcms-help">
@@ -193,5 +203,15 @@ $welcome_panel_is_active = wlcms_welcome_value(1, 'is_active');
193
  <?php
194
  endif;
195
  ?>
 
 
 
 
 
 
 
 
 
 
196
  </div>
197
  </div>
2
  <?php
3
  $welcome_panel_is_active = wlcms_welcome_value(0, 'is_active');
4
  ?>
5
+ <div class="wlcms-input-group toggle-group wlcms-dashboard" data-wlcms_dashboard="1">
6
  <div class="wlcms-help">
7
  <?php _e('Add your own Welcome Panel to the Dashboard page. This will appear on the dashboard. We recommend providing your contact details and links to the help files you have made for your client.', 'white-label-cms') ?>
8
  </div>
88
 
89
  <div class="welcome-basicHtml1">
90
  <div class="wlcms-input">
91
+ <input class="wlcms-toggle wlcms-toggle-light welcome_panel_fullwidth" id="own_welcome_panel_fullwidth" value="1" name="welcome_panel[0][is_fullwidth]" <?php checked(wlcms_welcome_value(0 , 'is_fullwidth'), 1, true) ?> type="checkbox"/>
92
  <label class="wlcms-toggle-btn" for="own_welcome_panel_fullwidth"></label><label class="toggle-label" for="own_welcome_panel_fullwidth"><?php _e('Make full-width');?></label>
93
  </div>
94
  </div>
102
  <?php
103
  endif;
104
  ?>
105
+ <div class="wlcms-input-group wlcms_welcome_dismissible wlcms_welcome_panel_dismissible1">
106
+ <div class="wlcms-input">
107
+ <input class="wlcms-toggle wlcms-toggle-light" id="first_welcome_panel_dismissible" value="1" name="welcome_panel[0][dismissible]" <?php checked(wlcms_welcome_value(0, 'dismissible'), 1, true) ?> type="checkbox"/>
108
+ <label class="wlcms-toggle-btn" for="first_welcome_panel_dismissible"></label><label class="toggle-label" for="first_welcome_panel_dismissible"><?php _e('Dismissible'); ?></label>
109
+ </div>
110
+ <?php
111
+ if( is_wlcms_super_admin() ):?>
112
+ <div class="wlcms_welcome_dismissible_reset"><a href="<?php echo wlcms()->admin_url() ?>&wlcms-action=reset-welcome-dashboard&dashboard=0"><?php _e('Reset Dismissed Welcome Dashboard')?></a></div>
113
+ <?php endif;?>
114
+ </div>
115
  </div>
116
  </div>
117
 
119
  <?php
120
  $welcome_panel_is_active = wlcms_welcome_value(1, 'is_active');
121
  ?>
122
+ <div class="wlcms-input-group toggle-group wlcms-dashboard" data-wlcms_dashboard="2">
123
  <div class="wlcms-input">
124
  <input class="wlcms-toggle wlcms-toggle-light main-toggle" id="add_second_panel" data-revised="1" name="welcome_panel[1][is_active]" value="1" type="checkbox" <?php checked($welcome_panel_is_active, 1, true) ?>/>
125
  <label class="wlcms-toggle-btn" for="add_second_panel"></label><label class="toggle-label" for="add_second_panel"><?php _e('Add Second Panel', 'white-label-cms') ?></label>
186
 
187
  <div class="welcome-basicHtml2">
188
  <div class="wlcms-input">
189
+ <input class="wlcms-toggle wlcms-toggle-light welcome_panel_fullwidth" id="second_welcome_panel_fullwidth" value="1" name="welcome_panel[1][is_fullwidth]" <?php checked(wlcms_welcome_value(1, 'is_fullwidth'), 1, true) ?> type="checkbox"/>
190
  <label class="wlcms-toggle-btn" for="second_welcome_panel_fullwidth"></label><label class="toggle-label" for="second_welcome_panel_fullwidth"><?php _e('Make full-width');?></label>
191
  </div>
192
  <div class="wlcms-help">
203
  <?php
204
  endif;
205
  ?>
206
+ <div class="wlcms-input-group wlcms_welcome_dismissible wlcms_welcome_panel_dismissible2">
207
+ <div class="wlcms-input">
208
+ <input class="wlcms-toggle wlcms-toggle-light" id="second_welcome_panel_dismissible" value="1" name="welcome_panel[1][dismissible]" <?php checked(wlcms_welcome_value(1, 'dismissible'), 1, true) ?> type="checkbox"/>
209
+ <label class="wlcms-toggle-btn" for="second_welcome_panel_dismissible"></label><label class="toggle-label" for="second_welcome_panel_dismissible"><?php _e('Dismissible'); ?></label>
210
+ </div>
211
+ <?php
212
+ if( is_wlcms_super_admin() ):?>
213
+ <div class="wlcms_welcome_dismissible_reset"><a href="<?php echo wlcms()->admin_url() ?>&wlcms-action=reset-welcome-dashboard&dashboard=1"><?php _e('Reset Dismissed Welcome Dashboard')?></a></div>
214
+ <?php endif;?>
215
+ </div>
216
  </div>
217
  </div>
wlcms-plugin.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: White Label CMS
4
  Plugin URI: http://www.videousermanuals.com/white-label-cms/?utm_campaign=wlcms&utm_medium=plugin&utm_source=readme-txt
5
  Description: A plugin that allows you to brand WordPress CMS as your own
6
- Version: 2.1.3
7
  Author: www.videousermanuals.com
8
  Author URI: http://www.videousermanuals.com/?utm_campaign=wlcms&utm_medium=plugin&utm_source=readme-txt
9
  Text Domain: white-label-cms
@@ -13,7 +13,7 @@ Domain Path: /languages
13
 
14
  if (!defined('ABSPATH')) exit; // Exit if accessed directly
15
 
16
- define('WLCMS_VERSION', '2.1.3');
17
  define("WLCMS_DIR", plugin_dir_path(__FILE__));
18
  define("WLCMS_ASSETS_URL", plugin_dir_url(__FILE__) . 'assets/');
19
  define("WLCMS_BASENAME", plugin_basename(__FILE__));
3
  Plugin Name: White Label CMS
4
  Plugin URI: http://www.videousermanuals.com/white-label-cms/?utm_campaign=wlcms&utm_medium=plugin&utm_source=readme-txt
5
  Description: A plugin that allows you to brand WordPress CMS as your own
6
+ Version: 2.2
7
  Author: www.videousermanuals.com
8
  Author URI: http://www.videousermanuals.com/?utm_campaign=wlcms&utm_medium=plugin&utm_source=readme-txt
9
  Text Domain: white-label-cms
13
 
14
  if (!defined('ABSPATH')) exit; // Exit if accessed directly
15
 
16
+ define('WLCMS_VERSION', '2.2');
17
  define("WLCMS_DIR", plugin_dir_path(__FILE__));
18
  define("WLCMS_ASSETS_URL", plugin_dir_url(__FILE__) . 'assets/');
19
  define("WLCMS_BASENAME", plugin_basename(__FILE__));