Custom Sidebars – Dynamic Widget Area Manager - Version 3.0.7

Version Description

= 1.0 = Caution: Version 1.0 needs WordPress 3.3 to work. If you are running an earlier version do not upgrade.

= 0.7.1 = Now custom sidebars works with Thesis theme and some minor bugs have been solved.

= 0.7 = This version fix a bug of v0.6 and before that reset the custom sidebars of posts and pages when they are quick edited or bulk edited, so upgrade is recommended. This version also changes the capability for managing custom sidebars to 'switch_themes' the one that allows to see the appearance menu in the admin page. I think the plugin is more coherent this way, but anyway it is easy to modify under plugin edit.

= 0.6 = This version adds several options for customize the sidebars by categories and replace the default blog page sidebars. Now it's possible to edit sidebar properties. Also fixes some minor bugs.

Download this release

Release Info

Developer iworks
Plugin Icon 128x128 Custom Sidebars – Dynamic Widget Area Manager
Version 3.0.7
Comparing to
See all releases

Code changes from version 3.0.6 to 3.0.7

css/cs-cloning.min.css CHANGED
@@ -1,4 +1,4 @@
1
- /*! Custom Sidebars - v3.0.6
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
 
1
+ /*! Custom Sidebars - v3.0.7
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
 
css/cs-scan.min.css CHANGED
@@ -1,4 +1,4 @@
1
- /*! Custom Sidebars - v3.0.6
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
 
1
+ /*! Custom Sidebars - v3.0.7
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
 
css/cs-visibility.min.css CHANGED
@@ -1,4 +1,4 @@
1
- /*! Custom Sidebars - v3.0.6
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
 
1
+ /*! Custom Sidebars - v3.0.7
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
 
css/cs.css CHANGED
@@ -814,14 +814,15 @@ h2 .show-infos {
814
  display: block;
815
  }
816
 
 
 
 
 
817
  /**
818
  * =============================================================================
819
  * == Post list
820
  * =============================================================================
821
  */
822
- #wpbody-content .wp-list-table .column-cs_replacement {
823
- width: 10%;
824
- }
825
  @media screen and (max-width: 782px) {
826
  #wpbody-content .wp-list-table.fixed .column-cs_replacement {
827
  display: none;
@@ -830,47 +831,15 @@ h2 .show-infos {
830
  #wpbody-content .wp-list-table .column-cs_replacement {
831
  width: 10%;
832
  }
833
- #wpbody-content .wp-list-table td.cs_replacement {
834
- /* do not display sidebars that are not replaced */
835
- }
836
- #wpbody-content .wp-list-table td.cs_replacement .def,
837
- #wpbody-content .wp-list-table td.cs_replacement .cust {
838
  opacity: .8;
839
- cursor: default;
840
- position: relative;
841
- padding-left: 110px;
842
- }
843
- #wpbody-content .wp-list-table td.cs_replacement .def:after,
844
- #wpbody-content .wp-list-table td.cs_replacement .cust:after {
845
- content: ' ';
846
- display: block;
847
- clear: both;
848
- }
849
- #wpbody-content .wp-list-table td.cs_replacement .def:hover,
850
- #wpbody-content .wp-list-table td.cs_replacement .cust:hover {
851
- opacity: 1;
852
- background: rgba(0, 0, 0, 0.02);
853
- }
854
- #wpbody-content .wp-list-table td.cs_replacement .def {
855
- display: none;
856
- }
857
- #wpbody-content .wp-list-table td.cs_replacement .cs-val,
858
- #wpbody-content .wp-list-table td.cs_replacement .cs-key {
859
- white-space: nowrap;
860
- text-overflow: ellipsis;
861
- overflow: hidden;
862
- }
863
- #wpbody-content .wp-list-table td.cs_replacement .cs-key {
864
- max-width: 100px;
865
  color: #666;
866
- position: absolute;
867
- left: 0;
868
  }
869
- #wpbody-content .wp-list-table td.cs_replacement .cs-val {
870
- display: block;
871
  }
872
  #wpbody-content .wp-list-table .inline-edit-row fieldset.cs-quickedit {
873
- border-top: 1px solid #EEE;
874
  margin-top: 10px;
875
  padding-top: 10px;
876
  }
814
  display: block;
815
  }
816
 
817
+ .popup-content .message.no-sidebars {
818
+ font-size: 1.4em;
819
+ }
820
+
821
  /**
822
  * =============================================================================
823
  * == Post list
824
  * =============================================================================
825
  */
 
 
 
826
  @media screen and (max-width: 782px) {
827
  #wpbody-content .wp-list-table.fixed .column-cs_replacement {
828
  display: none;
831
  #wpbody-content .wp-list-table .column-cs_replacement {
832
  width: 10%;
833
  }
834
+ #wpbody-content .wp-list-table .column-cs_replacement dt {
 
 
 
 
835
  opacity: .8;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
836
  color: #666;
 
 
837
  }
838
+ #wpbody-content .wp-list-table .column-cs_replacement dd {
839
+ margin-left: 10px;
840
  }
841
  #wpbody-content .wp-list-table .inline-edit-row fieldset.cs-quickedit {
842
+ border-top: 1px solid #eee;
843
  margin-top: 10px;
844
  padding-top: 10px;
845
  }
css/cs.min.css CHANGED
@@ -1,5 +1,5 @@
1
- /*! Custom Sidebars - v3.0.6
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
 
5
- .module-export .pro-layer{position:absolute;left:0;top:0;right:0;bottom:0;z-index:99999;background:rgba(255,255,255,.8);text-align:center;font-size:26px;font-weight:100;padding-top:120px;line-height:1.5}.module-export .pro-layer a{margin-top:20px;display:inline-block;background:#2EA2CC;color:#FAFAFA;text-decoration:none;padding:10px 20px;font-size:18px;font-weight:700}.module-export .pro-layer a:hover,.module-export .pro-layer a:focus,.module-export .pro-layer a:active{background:#1E8CBE;color:#FFF}.frm-location .pro-layer{padding:10px;text-align:center;font-size:26px;font-weight:100;line-height:1.5}.frm-location .pro-layer a{margin-top:20px;display:inline-block;background:#2EA2CC;color:#FAFAFA;text-decoration:none;padding:10px 20px;font-size:18px;font-weight:700}.frm-location .pro-layer a:hover,.frm-location .pro-layer a:focus,.frm-location .pro-layer a:active{background:#1E8CBE;color:#FFF}.csb-pro-layer{float:left;position:relative;opacity:.5;margin-right:10px}.csb-pro-layer .pro-info{position:absolute;left:0;top:0;right:0;bottom:0;opacity:0;background:rgba(96,96,96,.75);z-index:99999;text-align:center;text-decoration:none;line-height:28px;font-size:16px;font-weight:100;color:#FFF;text-decoration:underline;padding:0;margin:0;overflow:hidden}.csb-pro-layer:hover{opacity:1}.csb-pro-layer:hover .pro-info,.csb-pro-layer:hover .pro-info:hover,.csb-pro-layer:hover .pro-info:active,.csb-pro-layer:hover .pro-info:focus{line-height:48px;left:-10px;top:-10px;right:-5px;bottom:-10px;opacity:1}.csb-pro-layer .button{margin:0 5px 0 0;float:left}.csb-pro-layer .button .dashicons{line-height:26px;height:26px;float:left;margin-right:6px}#defaultsidebarspage p.submit{padding:0 0 10px;clear:both}#poststuff.defaultsdetailscontainer h2{border-bottom:0;margin-bottom:5px}#defaultsforposts,#defaultsforpages{padding:0 10px;background:#fcfcfc;overflow:hidden}.defaultsSelector{margin-bottom:30px}.cscolright{clear:right;float:right;margin:0;overflow:hidden;padding:0;width:49%}.cscolleft{margin:0;overflow:hidden;padding:0;width:49%}.widgets-php .widget-liquid-left{width:100%}.widgets-php .widget-liquid-right{padding:0 0 75px;margin:-10px -214% 0 0;width:210%;background:#e4e4e4;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.widgets-php .widget-liquid-right #widgets-right{margin:20px}.widgets-php .widget-liquid-right .overview{list-style:none;position:absolute;left:0;top:0;width:auto;right:0;padding-left:20px;border-left:1px solid #DDD}.widgets-php #wpcontent{position:relative}.widgets-php #wpcontent .wrap .cs-wrap{margin-right:68%;padding-top:1em;position:relative}.widgets-php #wpcontent #screen-meta-links{position:relative;z-index:10}.widgets-php #wpcontent #screen-meta{position:relative;z-index:10}.widgets-php #widgets-left{margin-right:0!important}.widgets-php #footer{background:#fff;margin-right:0;padding-right:20px}.widgets-php .sidebars-column-1 .custom-sidebars-add-new{background-color:#fff;padding:15px}.widgets-php .sidebars-column-1 .custom-sidebars-add-new p{border-radius:4px;border:3px dashed #ddd;color:#777;cursor:pointer;font-weight:700;margin:0;padding:90px 10px;text-align:center}.widgets-php .sidebars-column-1 .inner .custom-sidebars-box{border-radius:4px;margin:55px 0 16px}.widgets-php .sidebars-column-1 .inner .custom-sidebars-upfront{background-color:#f9c200}.widgets-php .sidebars-column-1 .inner .custom-sidebars-upfront .cs-inner{min-height:145px;margin-right:-16px;background:url(../img/devman.png) no-repeat 100% 50%;padding:50px 120px 45px 20px}.widgets-php .sidebars-column-1 .inner .custom-sidebars-upfront .cs-inner p{font-size:1.4em;color:#000;margin-top:0}.widgets-php .sidebars-column-1 .inner .custom-sidebars-upfront .cs-inner p:last-of-type{margin-bottom:0}.widgets-php .sidebars-column-1 .inner .custom-sidebars-upfront .cs-inner .button{background-color:#00a7e6;color:#fff;font-weight:700;height:auto;padding:15px 16px;text-transform:uppercase}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup{background-color:#fff}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner{background:url(../img/hand-with-heart.png) no-repeat 100% 100%;font-size:1.2em;min-height:227px;padding-bottom:10px}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner h4,.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner p{margin:0;padding:0 120px 0 30px;font-size:1.1em}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner h4{color:#222;font-size:1.2em;padding-top:50px}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner p{color:#c1272c;padding-top:16px}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner form{border-radius:4px;background-color:#fafafa;display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-pack:justify;justify-content:space-between;margin:24px 30px 0;padding:0}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner form input{background-color:transparent;border:0;font-size:1em;margin:0;padding:10px 15px;text-align:center}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner form input[type=submit]{border-radius:0 4px 4px 0;background-color:#00a7e6;color:#fff;min-width:3em;text-transform:uppercase}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner form input[type=text]{color:#aaa;-ms-flex-positive:1;flex-grow:1}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner form input[type=text]:active{box-shadow:none}#cs-options .cs-action{line-height:26px;margin-right:20px}#cs-options .cs-filter{float:right}.sidebar-form{margin:0 15px}.sidebar-form label{display:block}.sidebar-form .submit{text-align:right;margin:0;padding:1em 0}.sidebar-form .description{margin-top:5px;text-align:right}.sidebar_name,.sidebar_description{width:100%}div#widgets-right .sidebar-name>h3{padding:15px}div#widgets-right .widgets-sortables .sidebar-name>h3{padding:15px 7px}.widgets-holder-wrap.closed>div:nth-child(2){display:none}#defaultsidebarspage .hndle{cursor:pointer}#customsidebarspage #col-right{width:62%}.widgets_access .widget-liquid-right{position:static}#oldbrowsererror{display:none}#defaultsidebarspage .postbox{position:static}#defaultsidebarspage .inside{position:static}body.appearance_page_customsidebars .wrap h2{float:none}body.appearance_page_customsidebars #poststuff h2{margin-top:0}.widget.ui-draggable-dragging{z-index:10001!important}.csb-more-content{display:none}.csb-has-more .csb-more-content{display:block}#cs-widgets-extra{display:none}#cs-title-options{zoom:1;background:#E8E8E8;margin:-20px -20px 0 -20px;padding:10px 20px 20px;border-bottom:1px solid #DDD}.cs-title h3{font-weight:100}.cs-title h3 .cs-icon{margin-left:10px;color:#999}.replaceable{position:relative}.replaceable .replace-marker{position:absolute;left:0;top:0;bottom:0;width:5px;margin:0 5px 0 0;border-left:2px solid #05c944;z-index:10}.replaceable .replace-marker:hover:before{content:attr(data-label);background:#333;color:#EEE;font-size:13px;white-space:nowrap;padding:5px;position:absolute;top:7px;right:13px;line-height:20px}.replaceable .replace-marker:hover:after{content:'';position:absolute;top:16px;right:3px;border:6px solid transparent;border-left-color:#333}.cs-message{margin:.5em 0;padding:10px;position:absolute;left:0;right:0;box-shadow:0 1px 10px rgba(0,0,0,.2);z-index:100}.cs-message .close{position:absolute;top:.5em;right:.5em;opacity:.3;color:#000;cursor:pointer;text-decoration:none;font-size:14px;line-height:26px;width:26px;text-align:center;background:rgba(0,0,0,.1)}.cs-message .close:hover,.cs-message .close:focus,.cs-message .close:active{opacity:1}.cs-update{background:#ffffe0;border:1px solid #E6DB55}.cs-error{background:#FFEBE8;border:1px solid #C00}.cs-toolbar{color:#333;padding:0;background:#FCFCFC;border-top:1px solid #E5E5E5}.cs-toolbar:after{display:table;content:'';clear:both}.closed .cs-toolbar{display:none}.cs-toolbar .cs-tool{text-decoration:none;line-height:40px;height:40px;padding:0 10px;white-space:nowrap;background:#FFF;position:relative;overflow:hidden}.cs-toolbar .dashicons{line-height:40px}.cs-toolbar .cs-separator{border-left:1px solid #E5E5E5;width:1px;padding:0;margin:0;height:40px;overflow:hidden;display:inline-block;color:#DDD}.cs-custom-sidebar .cs-tool,.cs-custom-sidebar .cs-separator{float:right}.cs-theme-sidebar .cs-tool,.cs-theme-sidebar .cs-separator{float:left}.cs-toolbar .delete-sidebar{color:#A00}.cs-toolbar .delete-sidebar:hover,.cs-toolbar .delete-sidebar:focus,.cs-toolbar .delete-sidebar:active{color:red}.cs-toolbar .cs-tool.btn-replaceable{color:#555;padding-left:32px}.cs-toolbar .cs-tool.btn-replaceable:hover{color:#333!important}.cs-toolbar .cs-tool.btn-replaceable .chk-replaceable{position:absolute;top:50%;left:10px;height:16px;margin-top:-8px}.replaceable .cs-toolbar .cs-tool.btn-replaceable{background:#edfff3;color:#333}.replace-tip-box{float:left}.replace-tip{width:200px}.csb .button{outline:0}.csb .button>.dashicons,.csb .button-primary>.dashicons,.csb .button-secondary>.dashicons{opacity:.75;line-height:26px;margin-right:5px;transition:opacity .2s}.csb .button:hover>.dashicons,.csb .button-primary:hover>.dashicons,.csb .button-secondary:hover>.dashicons{opacity:1}.rtl div.widget-liquid-right{float:left;right:auto;left:0}.rtl.widgets-php #wpcontent .wrap .cs-wrap{margin-right:2px;margin-left:68%}.rtl.widgets-php .widget-liquid-right{margin:-10px 0 0 -214%}.rtl.widgets-php #widgets-left{margin-left:0!important}.rtl.widgets-php.folded #wpcontent,.rtl.widgets-php.folded #wpfooter{margin-left:325px;margin-right:52px}.rtl #cs-title-options h2{margin-right:5px}.rtl #cs-options .cs-filter{float:left}.rtl #cs-options .cs-action{margin-right:0;margin-left:20px}.rtl .sidebar-form .submit{text-align:left}.rtl #TB_ajaxWindowTitle{float:right}.rtl #TB_closeAjaxWindow{float:left}.csb-export-head{min-width:450px}.csb-export-head th{vertical-align:top;text-align:right;color:#679;width:150px}.csb-export-head tr:hover{background:#FAFAFA}.csb-export-head ul{margin:0}.csb-export-head .dashicons.hint{font-size:12px;line-height:22px}.csb-form{padding-left:15px}.csb-form h2,.csb-form h3,.csb-form .form-buttons,#poststuff .csb-form h2,#poststuff .csb-form h3,#poststuff .csb-form .form-buttons{padding-left:0;margin-left:-15px}.form-buttons{clear:both}.show-infos{position:relative;display:inline-block;margin:0 5px}h2 .show-infos{top:4px}.show-infos .export-infos{position:absolute;top:-5px;left:30px;font-size:13px;line-height:1.4em;font-weight:400;background:#FFF;box-shadow:0 1px 8px rgba(0,0,0,.2);border:3px solid #FAFAFA;padding:5px;z-index:10}.show-infos .export-infos:before,.show-infos .export-infos:after{content:'';position:absolute;left:-17px;top:5px;border:7px solid transparent;border-right-color:#FAFAFA;z-index:1}.show-infos .export-infos:after{left:-18px;top:5px;border-right-color:rgba(0,0,0,.15);z-index:0}.show-infos:hover .export-infos{display:block!important}.export-infos .section{font-weight:700;margin:10px 0 5px -2px;color:#666}.cs-half{float:left;width:49%;margin-right:1%}.cs-replaceable{margin-bottom:5px}.cs-replaceable>.details{display:none;margin:5px 0}.cs-replaceable.open>.details{display:block}#wpbody-content .wp-list-table .column-cs_replacement{width:10%}@media screen and (max-width:782px){#wpbody-content .wp-list-table.fixed .column-cs_replacement{display:none}}#wpbody-content .wp-list-table .column-cs_replacement{width:10%}#wpbody-content .wp-list-table td.cs_replacement{}#wpbody-content .wp-list-table td.cs_replacement .def,#wpbody-content .wp-list-table td.cs_replacement .cust{opacity:.8;cursor:default;position:relative;padding-left:110px}#wpbody-content .wp-list-table td.cs_replacement .def:after,#wpbody-content .wp-list-table td.cs_replacement .cust:after{content:' ';display:block;clear:both}#wpbody-content .wp-list-table td.cs_replacement .def:hover,#wpbody-content .wp-list-table td.cs_replacement .cust:hover{opacity:1;background:rgba(0,0,0,.02)}#wpbody-content .wp-list-table td.cs_replacement .def{display:none}#wpbody-content .wp-list-table td.cs_replacement .cs-val,#wpbody-content .wp-list-table td.cs_replacement .cs-key{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}#wpbody-content .wp-list-table td.cs_replacement .cs-key{max-width:100px;color:#666;position:absolute;left:0}#wpbody-content .wp-list-table td.cs_replacement .cs-val{display:block}#wpbody-content .wp-list-table .inline-edit-row fieldset.cs-quickedit{border-top:1px solid #EEE;margin-top:10px;padding-top:10px}#wpbody-content .wp-list-table .inline-edit-row fieldset.cs-quickedit label span.title{display:block;float:left;min-width:5em;white-space:nowrap;padding-right:10px;width:auto}#wpbody-content .wp-list-table .inline-edit-row-page .inline-edit-col-right{float:right}
1
+ /*! Custom Sidebars - v3.0.7
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
 
5
+ .module-export .pro-layer{position:absolute;left:0;top:0;right:0;bottom:0;z-index:99999;background:rgba(255,255,255,.8);text-align:center;font-size:26px;font-weight:100;padding-top:120px;line-height:1.5}.module-export .pro-layer a{margin-top:20px;display:inline-block;background:#2EA2CC;color:#FAFAFA;text-decoration:none;padding:10px 20px;font-size:18px;font-weight:700}.module-export .pro-layer a:hover,.module-export .pro-layer a:focus,.module-export .pro-layer a:active{background:#1E8CBE;color:#FFF}.frm-location .pro-layer{padding:10px;text-align:center;font-size:26px;font-weight:100;line-height:1.5}.frm-location .pro-layer a{margin-top:20px;display:inline-block;background:#2EA2CC;color:#FAFAFA;text-decoration:none;padding:10px 20px;font-size:18px;font-weight:700}.frm-location .pro-layer a:hover,.frm-location .pro-layer a:focus,.frm-location .pro-layer a:active{background:#1E8CBE;color:#FFF}.csb-pro-layer{float:left;position:relative;opacity:.5;margin-right:10px}.csb-pro-layer .pro-info{position:absolute;left:0;top:0;right:0;bottom:0;opacity:0;background:rgba(96,96,96,.75);z-index:99999;text-align:center;text-decoration:none;line-height:28px;font-size:16px;font-weight:100;color:#FFF;text-decoration:underline;padding:0;margin:0;overflow:hidden}.csb-pro-layer:hover{opacity:1}.csb-pro-layer:hover .pro-info,.csb-pro-layer:hover .pro-info:hover,.csb-pro-layer:hover .pro-info:active,.csb-pro-layer:hover .pro-info:focus{line-height:48px;left:-10px;top:-10px;right:-5px;bottom:-10px;opacity:1}.csb-pro-layer .button{margin:0 5px 0 0;float:left}.csb-pro-layer .button .dashicons{line-height:26px;height:26px;float:left;margin-right:6px}#defaultsidebarspage p.submit{padding:0 0 10px;clear:both}#poststuff.defaultsdetailscontainer h2{border-bottom:0;margin-bottom:5px}#defaultsforposts,#defaultsforpages{padding:0 10px;background:#fcfcfc;overflow:hidden}.defaultsSelector{margin-bottom:30px}.cscolright{clear:right;float:right;margin:0;overflow:hidden;padding:0;width:49%}.cscolleft{margin:0;overflow:hidden;padding:0;width:49%}.widgets-php .widget-liquid-left{width:100%}.widgets-php .widget-liquid-right{padding:0 0 75px;margin:-10px -214% 0 0;width:210%;background:#e4e4e4;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.widgets-php .widget-liquid-right #widgets-right{margin:20px}.widgets-php .widget-liquid-right .overview{list-style:none;position:absolute;left:0;top:0;width:auto;right:0;padding-left:20px;border-left:1px solid #DDD}.widgets-php #wpcontent{position:relative}.widgets-php #wpcontent .wrap .cs-wrap{margin-right:68%;padding-top:1em;position:relative}.widgets-php #wpcontent #screen-meta-links{position:relative;z-index:10}.widgets-php #wpcontent #screen-meta{position:relative;z-index:10}.widgets-php #widgets-left{margin-right:0!important}.widgets-php #footer{background:#fff;margin-right:0;padding-right:20px}.widgets-php .sidebars-column-1 .custom-sidebars-add-new{background-color:#fff;padding:15px}.widgets-php .sidebars-column-1 .custom-sidebars-add-new p{border-radius:4px;border:3px dashed #ddd;color:#777;cursor:pointer;font-weight:700;margin:0;padding:90px 10px;text-align:center}.widgets-php .sidebars-column-1 .inner .custom-sidebars-box{border-radius:4px;margin:55px 0 16px}.widgets-php .sidebars-column-1 .inner .custom-sidebars-upfront{background-color:#f9c200}.widgets-php .sidebars-column-1 .inner .custom-sidebars-upfront .cs-inner{min-height:145px;margin-right:-16px;background:url(../img/devman.png) no-repeat 100% 50%;padding:50px 120px 45px 20px}.widgets-php .sidebars-column-1 .inner .custom-sidebars-upfront .cs-inner p{font-size:1.4em;color:#000;margin-top:0}.widgets-php .sidebars-column-1 .inner .custom-sidebars-upfront .cs-inner p:last-of-type{margin-bottom:0}.widgets-php .sidebars-column-1 .inner .custom-sidebars-upfront .cs-inner .button{background-color:#00a7e6;color:#fff;font-weight:700;height:auto;padding:15px 16px;text-transform:uppercase}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup{background-color:#fff}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner{background:url(../img/hand-with-heart.png) no-repeat 100% 100%;font-size:1.2em;min-height:227px;padding-bottom:10px}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner h4,.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner p{margin:0;padding:0 120px 0 30px;font-size:1.1em}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner h4{color:#222;font-size:1.2em;padding-top:50px}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner p{color:#c1272c;padding-top:16px}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner form{border-radius:4px;background-color:#fafafa;display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-pack:justify;justify-content:space-between;margin:24px 30px 0;padding:0}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner form input{background-color:transparent;border:0;font-size:1em;margin:0;padding:10px 15px;text-align:center}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner form input[type=submit]{border-radius:0 4px 4px 0;background-color:#00a7e6;color:#fff;min-width:3em;text-transform:uppercase}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner form input[type=text]{color:#aaa;-ms-flex-positive:1;flex-grow:1}.widgets-php .sidebars-column-1 .inner .custom-sidebars-checkup .cs-inner form input[type=text]:active{box-shadow:none}#cs-options .cs-action{line-height:26px;margin-right:20px}#cs-options .cs-filter{float:right}.sidebar-form{margin:0 15px}.sidebar-form label{display:block}.sidebar-form .submit{text-align:right;margin:0;padding:1em 0}.sidebar-form .description{margin-top:5px;text-align:right}.sidebar_name,.sidebar_description{width:100%}div#widgets-right .sidebar-name>h3{padding:15px}div#widgets-right .widgets-sortables .sidebar-name>h3{padding:15px 7px}.widgets-holder-wrap.closed>div:nth-child(2){display:none}#defaultsidebarspage .hndle{cursor:pointer}#customsidebarspage #col-right{width:62%}.widgets_access .widget-liquid-right{position:static}#oldbrowsererror{display:none}#defaultsidebarspage .postbox{position:static}#defaultsidebarspage .inside{position:static}body.appearance_page_customsidebars .wrap h2{float:none}body.appearance_page_customsidebars #poststuff h2{margin-top:0}.widget.ui-draggable-dragging{z-index:10001!important}.csb-more-content{display:none}.csb-has-more .csb-more-content{display:block}#cs-widgets-extra{display:none}#cs-title-options{zoom:1;background:#E8E8E8;margin:-20px -20px 0 -20px;padding:10px 20px 20px;border-bottom:1px solid #DDD}.cs-title h3{font-weight:100}.cs-title h3 .cs-icon{margin-left:10px;color:#999}.replaceable{position:relative}.replaceable .replace-marker{position:absolute;left:0;top:0;bottom:0;width:5px;margin:0 5px 0 0;border-left:2px solid #05c944;z-index:10}.replaceable .replace-marker:hover:before{content:attr(data-label);background:#333;color:#EEE;font-size:13px;white-space:nowrap;padding:5px;position:absolute;top:7px;right:13px;line-height:20px}.replaceable .replace-marker:hover:after{content:'';position:absolute;top:16px;right:3px;border:6px solid transparent;border-left-color:#333}.cs-message{margin:.5em 0;padding:10px;position:absolute;left:0;right:0;box-shadow:0 1px 10px rgba(0,0,0,.2);z-index:100}.cs-message .close{position:absolute;top:.5em;right:.5em;opacity:.3;color:#000;cursor:pointer;text-decoration:none;font-size:14px;line-height:26px;width:26px;text-align:center;background:rgba(0,0,0,.1)}.cs-message .close:hover,.cs-message .close:focus,.cs-message .close:active{opacity:1}.cs-update{background:#ffffe0;border:1px solid #E6DB55}.cs-error{background:#FFEBE8;border:1px solid #C00}.cs-toolbar{color:#333;padding:0;background:#FCFCFC;border-top:1px solid #E5E5E5}.cs-toolbar:after{display:table;content:'';clear:both}.closed .cs-toolbar{display:none}.cs-toolbar .cs-tool{text-decoration:none;line-height:40px;height:40px;padding:0 10px;white-space:nowrap;background:#FFF;position:relative;overflow:hidden}.cs-toolbar .dashicons{line-height:40px}.cs-toolbar .cs-separator{border-left:1px solid #E5E5E5;width:1px;padding:0;margin:0;height:40px;overflow:hidden;display:inline-block;color:#DDD}.cs-custom-sidebar .cs-tool,.cs-custom-sidebar .cs-separator{float:right}.cs-theme-sidebar .cs-tool,.cs-theme-sidebar .cs-separator{float:left}.cs-toolbar .delete-sidebar{color:#A00}.cs-toolbar .delete-sidebar:hover,.cs-toolbar .delete-sidebar:focus,.cs-toolbar .delete-sidebar:active{color:red}.cs-toolbar .cs-tool.btn-replaceable{color:#555;padding-left:32px}.cs-toolbar .cs-tool.btn-replaceable:hover{color:#333!important}.cs-toolbar .cs-tool.btn-replaceable .chk-replaceable{position:absolute;top:50%;left:10px;height:16px;margin-top:-8px}.replaceable .cs-toolbar .cs-tool.btn-replaceable{background:#edfff3;color:#333}.replace-tip-box{float:left}.replace-tip{width:200px}.csb .button{outline:0}.csb .button>.dashicons,.csb .button-primary>.dashicons,.csb .button-secondary>.dashicons{opacity:.75;line-height:26px;margin-right:5px;transition:opacity .2s}.csb .button:hover>.dashicons,.csb .button-primary:hover>.dashicons,.csb .button-secondary:hover>.dashicons{opacity:1}.rtl div.widget-liquid-right{float:left;right:auto;left:0}.rtl.widgets-php #wpcontent .wrap .cs-wrap{margin-right:2px;margin-left:68%}.rtl.widgets-php .widget-liquid-right{margin:-10px 0 0 -214%}.rtl.widgets-php #widgets-left{margin-left:0!important}.rtl.widgets-php.folded #wpcontent,.rtl.widgets-php.folded #wpfooter{margin-left:325px;margin-right:52px}.rtl #cs-title-options h2{margin-right:5px}.rtl #cs-options .cs-filter{float:left}.rtl #cs-options .cs-action{margin-right:0;margin-left:20px}.rtl .sidebar-form .submit{text-align:left}.rtl #TB_ajaxWindowTitle{float:right}.rtl #TB_closeAjaxWindow{float:left}.csb-export-head{min-width:450px}.csb-export-head th{vertical-align:top;text-align:right;color:#679;width:150px}.csb-export-head tr:hover{background:#FAFAFA}.csb-export-head ul{margin:0}.csb-export-head .dashicons.hint{font-size:12px;line-height:22px}.csb-form{padding-left:15px}.csb-form h2,.csb-form h3,.csb-form .form-buttons,#poststuff .csb-form h2,#poststuff .csb-form h3,#poststuff .csb-form .form-buttons{padding-left:0;margin-left:-15px}.form-buttons{clear:both}.show-infos{position:relative;display:inline-block;margin:0 5px}h2 .show-infos{top:4px}.show-infos .export-infos{position:absolute;top:-5px;left:30px;font-size:13px;line-height:1.4em;font-weight:400;background:#FFF;box-shadow:0 1px 8px rgba(0,0,0,.2);border:3px solid #FAFAFA;padding:5px;z-index:10}.show-infos .export-infos:before,.show-infos .export-infos:after{content:'';position:absolute;left:-17px;top:5px;border:7px solid transparent;border-right-color:#FAFAFA;z-index:1}.show-infos .export-infos:after{left:-18px;top:5px;border-right-color:rgba(0,0,0,.15);z-index:0}.show-infos:hover .export-infos{display:block!important}.export-infos .section{font-weight:700;margin:10px 0 5px -2px;color:#666}.cs-half{float:left;width:49%;margin-right:1%}.cs-replaceable{margin-bottom:5px}.cs-replaceable>.details{display:none;margin:5px 0}.cs-replaceable.open>.details{display:block}.popup-content .message.no-sidebars{font-size:1.4em}@media screen and (max-width:782px){#wpbody-content .wp-list-table.fixed .column-cs_replacement{display:none}}#wpbody-content .wp-list-table .column-cs_replacement{width:10%}#wpbody-content .wp-list-table .column-cs_replacement dt{opacity:.8;color:#666}#wpbody-content .wp-list-table .column-cs_replacement dd{margin-left:10px}#wpbody-content .wp-list-table .inline-edit-row fieldset.cs-quickedit{border-top:1px solid #eee;margin-top:10px;padding-top:10px}#wpbody-content .wp-list-table .inline-edit-row fieldset.cs-quickedit label span.title{display:block;float:left;min-width:5em;white-space:nowrap;padding-right:10px;width:auto}#wpbody-content .wp-list-table .inline-edit-row-page .inline-edit-col-right{float:right}
customsidebars.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Custom Sidebars
4
  * Plugin URI: https://wordpress.org/plugins/custom-sidebars/
5
  * Description: Allows you to create widgetized areas and custom sidebars. Replace whole sidebars or single widgets for specific posts and pages.
6
- * Version: 3.0.6
7
  * Author: WPMU DEV
8
  * Author URI: http://premium.wpmudev.org/
9
  * Textdomain: custom-sidebars
3
  * Plugin Name: Custom Sidebars
4
  * Plugin URI: https://wordpress.org/plugins/custom-sidebars/
5
  * Description: Allows you to create widgetized areas and custom sidebars. Replace whole sidebars or single widgets for specific posts and pages.
6
+ * Version: 3.0.7
7
  * Author: WPMU DEV
8
  * Author URI: http://premium.wpmudev.org/
9
  * Textdomain: custom-sidebars
inc/class-custom-sidebars-editor.php CHANGED
@@ -376,16 +376,54 @@ class CustomSidebarsEditor extends CustomSidebars {
376
  $defaults = self::get_options();
377
  $raw_posttype = self::get_post_types( 'objects' );
378
  $raw_cat = self::get_all_categories();
 
 
 
 
379
 
380
  $archive_type = array(
381
  '_blog' => __( 'Front Page', 'custom-sidebars' ),
382
  '_search' => __( 'Search Results', 'custom-sidebars' ),
383
  '_404' => __( 'Not found (404)', 'custom-sidebars' ),
384
  '_authors' => __( 'Any Author Archive', 'custom-sidebars' ),
385
- '_tags' => __( 'Tag Archives', 'custom-sidebars' ),
386
  '_date' => __( 'Date Archives', 'custom-sidebars' ),
387
  );
388
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
389
  $raw_authors = array();
390
  $raw_authors = get_users(
391
  array(
@@ -450,6 +488,45 @@ class CustomSidebarsEditor extends CustomSidebars {
450
  );
451
  }
452
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
453
  // Build a list of authors.
454
  $authors = array();
455
  foreach ( $raw_authors as $user ) {
@@ -483,6 +560,7 @@ class CustomSidebarsEditor extends CustomSidebars {
483
  $sidebars = $options['modifiable'];
484
  $raw_posttype = self::get_post_types( 'objects' );
485
  $raw_cat = self::get_all_categories();
 
486
  $data = array();
487
 
488
  foreach ( $_POST as $key => $value ) {
@@ -602,6 +680,44 @@ class CustomSidebarsEditor extends CustomSidebars {
602
  unset( $options['author_archive'][ $key ][ $sb_id ] );
603
  }
604
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
605
  }
606
 
607
  $req->message = sprintf(
376
  $defaults = self::get_options();
377
  $raw_posttype = self::get_post_types( 'objects' );
378
  $raw_cat = self::get_all_categories();
379
+ $raw_taxonomies = array(
380
+ '_builtin' => self::get_taxonomies( 'objects', true ),
381
+ 'custom' => self::get_taxonomies( 'objects', false ),
382
+ );
383
 
384
  $archive_type = array(
385
  '_blog' => __( 'Front Page', 'custom-sidebars' ),
386
  '_search' => __( 'Search Results', 'custom-sidebars' ),
387
  '_404' => __( 'Not found (404)', 'custom-sidebars' ),
388
  '_authors' => __( 'Any Author Archive', 'custom-sidebars' ),
 
389
  '_date' => __( 'Date Archives', 'custom-sidebars' ),
390
  );
391
 
392
+ /**
393
+ * taxonomies
394
+ *
395
+ * @since 3.0.7
396
+ */
397
+ $default_taxonomies = array();
398
+ foreach ( $raw_taxonomies['_builtin'] as $taxonomy ) {
399
+ $default_taxonomies[] = $taxonomy->labels->singular_name;
400
+ switch ( $taxonomy->name ) {
401
+ case 'post_format':
402
+ break;
403
+ case 'post_tag':
404
+ /**
405
+ * this a legacy and backward compatibility
406
+ */
407
+ $archive_type['_tags'] = sprintf( __( '%s Archives', 'custom-sidebars' ), $taxonomy->labels->singular_name );
408
+ break;
409
+ case 'category':
410
+ $archive_type[ '_'.$taxonomy->name ] = sprintf( __( '%s Archives', 'custom-sidebars' ), $taxonomy->labels->singular_name );
411
+ break;
412
+ }
413
+ }
414
+ foreach ( $raw_taxonomies['custom'] as $taxonomy ) {
415
+ if ( in_array( $taxonomy->labels->singular_name, $default_taxonomies ) ) {
416
+ $archive_type[ '_taxonomy_'.$taxonomy->name ] = sprintf( __( '%s Archives', 'custom-sidebars' ), ucfirst( $taxonomy->name ) );
417
+ } else {
418
+ $archive_type[ '_taxonomy_'.$taxonomy->name ] = sprintf( __( '%s Archives', 'custom-sidebars' ), $taxonomy->labels->singular_name );
419
+ }
420
+ }
421
+
422
+ /**
423
+ * sort array by values
424
+ */
425
+ asort( $archive_type );
426
+
427
  $raw_authors = array();
428
  $raw_authors = get_users(
429
  array(
488
  );
489
  }
490
 
491
+ /**
492
+ * Custom taxonomies
493
+ *
494
+ * @since 3.0.7
495
+ */
496
+ foreach ( $raw_taxonomies['custom'] as $t ) {
497
+ $taxonomy = $t->name;
498
+ if (
499
+ isset( $defaults['taxonomies_archive'] )
500
+ && isset( $defaults['taxonomies_archive'][ $taxonomy ] )
501
+ ) {
502
+ $name = sprintf( __( '%s Archives', 'custom-sidebars' ), $t->labels->singular_name );
503
+ if ( in_array( $t->labels->singular_name, $default_taxonomies ) ) {
504
+ $name = sprintf( __( '%s Archives', 'custom-sidebars' ), ucfirst( $taxonomy ) );
505
+ }
506
+ $sel_archive = $defaults['taxonomies_archive'][ $taxonomy ];
507
+ $key = '_taxonomy_'.$taxonomy;
508
+ $archives[ $key ] = array(
509
+ 'name' => $name,
510
+ 'archive' => self::get_array( $sel_archive ),
511
+ );
512
+ }
513
+ }
514
+
515
+ /**
516
+ * Category archive.
517
+ */
518
+ foreach ( $raw_taxonomies['_builtin'] as $t ) {
519
+ if ( 'category' == $t->name ) {
520
+ if ( isset( $defaults['category_archive'] ) ) {
521
+ $sel_archive = $defaults['category_archive'];
522
+ $archives[ $key ] = array(
523
+ 'name' => sprintf( __( '%s Archives', 'custom-sidebars' ), $t->labels->singular_name ),
524
+ 'archive' => self::get_array( $sel_archive ),
525
+ );
526
+ }
527
+ }
528
+ }
529
+
530
  // Build a list of authors.
531
  $authors = array();
532
  foreach ( $raw_authors as $user ) {
560
  $sidebars = $options['modifiable'];
561
  $raw_posttype = self::get_post_types( 'objects' );
562
  $raw_cat = self::get_all_categories();
563
+ $raw_taxonomies = self::get_taxonomies();
564
  $data = array();
565
 
566
  foreach ( $_POST as $key => $value ) {
680
  unset( $options['author_archive'][ $key ][ $sb_id ] );
681
  }
682
  }
683
+
684
+ /**
685
+ * Custom taxonomies
686
+ *
687
+ * @since 3.0.7
688
+ */
689
+ foreach ( $raw_taxonomies as $taxonomy ) {
690
+ $key = '_taxonomy_'.$taxonomy;
691
+ if (
692
+ isset( $data['arc'][ $sb_id ] )
693
+ && is_array( $data['arc'][ $sb_id ] )
694
+ && in_array( $key, $data['arc'][ $sb_id ] )
695
+ ) {
696
+ $options['taxonomies_archive'][ $taxonomy ][ $sb_id ] = $req->id;
697
+ } elseif (
698
+ isset( $options['taxonomies_archive'][ $key ][ $sb_id ] ) &&
699
+ $options['taxonomies_archive'][ $key ][ $sb_id ] == $req->id
700
+ ) {
701
+ unset( $options['taxonomies_archive'][ $taxonomy ][ $sb_id ] );
702
+ }
703
+ }
704
+ /**
705
+ * category Archive
706
+ *
707
+ * @since 3.0.7
708
+ */
709
+ if (
710
+ isset( $data['arc'][ $sb_id ] )
711
+ && is_array( $data['arc'][ $sb_id ] )
712
+ && in_array( '_category', $data['arc'][ $sb_id ] )
713
+ ) {
714
+ $options['category_archive'][ $sb_id ] = $req->id;
715
+ } elseif (
716
+ isset( $options['category_archive']['_category'][ $sb_id ] ) &&
717
+ $options['category_archive']['category_archive'][ $sb_id ] == $req->id
718
+ ) {
719
+ unset( $options['category_archive'][ $sb_id ] );
720
+ }
721
  }
722
 
723
  $req->message = sprintf(
inc/class-custom-sidebars-explain.php CHANGED
@@ -30,6 +30,20 @@ class CustomSidebarsExplain extends CustomSidebars {
30
  */
31
  private $infos = array();
32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  /**
34
  * Returns the singleton object.
35
  *
@@ -51,117 +65,25 @@ class CustomSidebarsExplain extends CustomSidebars {
51
  * @since 2.0.9.1
52
  */
53
  private function __construct() {
54
- $debug = false;
55
- if ( isset( $_GET['cs-explain'] ) ) {
56
- $debug = true;
57
- self::set_explain( $_GET['cs-explain'] );
58
- }
59
- if (
60
- false === $debug
61
- && isset( $_SESSION )
62
- && isset( $_SESSION['cs-explain'] )
63
- && 'on' == $_SESSION['cs_explain']
64
- ) {
65
- $debug = true;
66
  }
67
- if ( false === $debug ) {
 
68
  return;
69
  }
70
- if ( ! session_id() ) {
71
- session_start();
72
- }
73
-
74
  if ( is_admin() ) {
75
- add_action(
76
- 'cs_widget_header',
77
- array( $this, 'widget_header' )
78
- );
79
-
80
- add_action(
81
- 'cs_ajax_request',
82
- array( $this, 'handle_ajax' )
83
- );
84
- } else {
85
- if ( self::do_explain() ) {
86
- add_action(
87
- 'cs_explain',
88
- array( $this, 'add_info' ),
89
- 10, 2
90
- );
91
-
92
- add_action(
93
- 'wp_footer',
94
- array( $this, 'show_infos' )
95
- );
96
-
97
- add_action(
98
- 'dynamic_sidebar_before',
99
- array( $this, 'before_sidebar' ),
100
- 0, 2
101
- );
102
-
103
- add_action(
104
- 'dynamic_sidebar_after',
105
- array( $this, 'after_sidebar' ),
106
- 0, 2
107
- );
108
- }
109
- }
110
- }
111
-
112
- /**
113
- * Called by action 'cs_widget_header'. Output the export/import button in
114
- * the widget header.
115
- *
116
- * @since 2.0.9.1
117
- */
118
- public function widget_header() {
119
- /*
120
- $state = self::do_explain() ? 'on' : 'off';
121
- ?>
122
- <a href="#"
123
- class="cs-action btn-explain"
124
- data-status="<?php echo esc_attr( $state ); ?>"
125
- data-label-off="<?php _e( 'Show explanations', 'custom-sidebars' ); ?>"
126
- data-label-on="<?php _e( 'Hide explanations', 'custom-sidebars' ); ?>">
127
- </a>
128
- <?php
129
- */
130
- }
131
-
132
- /**
133
- * When the custom sidebars section is visible we see if export-action
134
- * needs to be processed.
135
- *
136
- * @since 2.0.9.1
137
- */
138
- public function handle_ajax( $ajax_action ) {
139
- $handle_it = false;
140
- $req = (object) array(
141
- 'status' => 'ERR',
142
- );
143
-
144
- switch ( $ajax_action ) {
145
- case 'explain':
146
- $handle_it = true;
147
- break;
148
- }
149
-
150
- if ( ! $handle_it ) {
151
- return false;
152
- }
153
-
154
- $state = @$_POST['state'];
155
-
156
- switch ( $ajax_action ) {
157
- case 'explain':
158
- self::set_explain( $state );
159
- $req->status = 'OK';
160
- $req->state = self::do_explain() ? 'on' : 'off';
161
- break;
162
  }
163
-
164
- self::json_response( $req );
 
 
165
  }
166
 
167
  /**
@@ -173,11 +95,8 @@ class CustomSidebarsExplain extends CustomSidebars {
173
  * @since 2.0.9.1
174
  * @return boolean
175
  */
176
- public static function do_explain() {
177
- return
178
- isset( $_SESSION['cs-explain'] )
179
- && is_string( $_SESSION['cs-explain'] )
180
- && 'on' == $_SESSION['cs-explain'];
181
  }
182
 
183
  /**
@@ -186,11 +105,20 @@ class CustomSidebarsExplain extends CustomSidebars {
186
  * @since 2.0.9.1
187
  * @param string $state [on|off]
188
  */
189
- public static function set_explain( $state ) {
190
- if ( 'on' != $state ) {
191
- $state = 'off';
192
  }
193
- $_SESSION['cs-explain'] = $state;
 
 
 
 
 
 
 
 
 
194
  }
195
 
196
  /**
@@ -221,7 +149,6 @@ class CustomSidebarsExplain extends CustomSidebars {
221
  .cs-infos h5 { color: #006; margin: 10px 0 0 -15px; }
222
  </style>
223
  <h3>Sidebar Infos</h3>
224
- <a href="?cs-explain=off" style="float:right;color:#009">Turn off explanations</a>
225
  <ul>
226
  <?php foreach ( $this->infos as $info ) : ?>
227
  <li><?php echo $info; ?></li>
@@ -279,4 +206,29 @@ class CustomSidebarsExplain extends CustomSidebars {
279
  </div>
280
  <?php
281
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
282
  };
30
  */
31
  private $infos = array();
32
 
33
+ /**
34
+ * Explain debug status.
35
+ *
36
+ * @since 3.0.7
37
+ */
38
+ private $debug = false;
39
+
40
+ /**
41
+ * Current user id
42
+ *
43
+ * @since 3.0.7
44
+ */
45
+ private $current_user_id = 0;
46
+
47
  /**
48
  * Returns the singleton object.
49
  *
65
  * @since 2.0.9.1
66
  */
67
  private function __construct() {
68
+ $this->debug = false;
69
+ $this->current_user_id = get_current_user_id();
70
+ if ( 0 == $this->current_user_id ) {
71
+ $this->debug = apply_filters( 'custom_sidebars_explain', $this->debug );
72
+ } else {
73
+ $this->debug = (boolean) get_user_meta( $this->current_user_id, 'custom_sidebars_explain', true );
74
+ $this->set_explain();
 
 
 
 
 
75
  }
76
+ add_action( 'admin_bar_menu', array( $this, 'admin_bar_menu' ), 999 );
77
+ if ( false === $this->debug ) {
78
  return;
79
  }
 
 
 
 
80
  if ( is_admin() ) {
81
+ return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  }
83
+ add_action( 'cs_explain', array( $this, 'add_info' ), 10, 2 );
84
+ add_action( 'wp_footer', array( $this, 'show_infos' ) );
85
+ add_action( 'dynamic_sidebar_before', array( $this, 'before_sidebar' ), 0, 2 );
86
+ add_action( 'dynamic_sidebar_after', array( $this, 'after_sidebar' ), 0, 2 );
87
  }
88
 
89
  /**
95
  * @since 2.0.9.1
96
  * @return boolean
97
  */
98
+ public function do_explain() {
99
+ return $this->debug;
 
 
 
100
  }
101
 
102
  /**
105
  * @since 2.0.9.1
106
  * @param string $state [on|off]
107
  */
108
+ public function set_explain() {
109
+ if ( ! isset( $_GET['cs-explain'] ) ) {
110
+ return;
111
  }
112
+ if ( 'on' == $_GET['cs-explain'] ) {
113
+ $this->debug = true;
114
+ $result = add_user_meta( $this->current_user_id, 'custom_sidebars_explain', $this->debug, true );
115
+ if ( ! $result ) {
116
+ update_user_meta( $this->current_user_id, 'custom_sidebars_explain', $this->debug );
117
+ }
118
+ return;
119
+ }
120
+ $this->debug = false;
121
+ delete_user_meta( $this->current_user_id, 'custom_sidebars_explain' );
122
  }
123
 
124
  /**
149
  .cs-infos h5 { color: #006; margin: 10px 0 0 -15px; }
150
  </style>
151
  <h3>Sidebar Infos</h3>
 
152
  <ul>
153
  <?php foreach ( $this->infos as $info ) : ?>
154
  <li><?php echo $info; ?></li>
206
  </div>
207
  <?php
208
  }
209
+
210
+
211
+ public function admin_bar_menu( $wp_admin_bar ) {
212
+ if ( 0 == $this->current_user_id ) {
213
+ return;
214
+ }
215
+ $args = array(
216
+ 'id' => 'cs-explain',
217
+ 'title' => __( 'Turn on explanations', 'custom-sidebars' ),
218
+ 'href' => add_query_arg( 'cs-explain', 'on' ),
219
+ 'parent' => 'top-secondary',
220
+ 'meta' => array(
221
+ 'title' => __( 'Turn on Custom Sidebars explain mode.', 'custom-sidebars' ),
222
+ ),
223
+ );
224
+ if ( $this->debug ) {
225
+ $args['href'] = add_query_arg( 'cs-explain', 'off' );
226
+ $args['title'] = __( 'Turn off explanations', 'custom-sidebars' );
227
+ $args['meta'] = array(
228
+ 'title' => __( 'Turn off Custom Sidebars explain mode.', 'custom-sidebars' ),
229
+ 'class' => 'cs-explain-on',
230
+ );
231
+ }
232
+ $wp_admin_bar->add_node( $args );
233
+ }
234
  };
inc/class-custom-sidebars-replacer.php CHANGED
@@ -102,7 +102,8 @@ class CustomSidebarsReplacer extends CustomSidebars {
102
  $wp_registered_sidebars,
103
  $wp_registered_widgets;
104
 
105
- $expl = CustomSidebarsExplain::do_explain();
 
106
 
107
  $expl && do_action( 'cs_explain', '<h4>Replace sidebars</h4>', true );
108
 
@@ -185,7 +186,9 @@ class CustomSidebarsReplacer extends CustomSidebars {
185
  $sidebars = self::get_options( 'modifiable' );
186
  $replacements_todo = sizeof( $sidebars );
187
  $replacements = array();
188
- $expl = CustomSidebarsExplain::do_explain();
 
 
189
 
190
  foreach ( $sidebars as $sb ) {
191
  $replacements[ $sb ] = false;
@@ -282,14 +285,16 @@ class CustomSidebarsReplacer extends CustomSidebars {
282
  $current_category = $category_object->term_id;
283
  while ( 0 != $current_category && $replacements_todo > 0 ) {
284
  foreach ( $sidebars as $sb_id ) {
285
- if ( $replacements[ $sb_id ] ) { continue; }
286
- if ( ! empty( $options['category_archive'][ $current_category ][ $sb_id ] ) ) {
 
 
 
287
  $replacements[ $sb_id ] = array(
288
- $options['category_archive'][ $current_category ][ $sb_id ],
289
- 'category_archive',
290
  $current_category,
291
  );
292
- $replacements_todo -= 1;
293
  }
294
  }
295
  $current_category = $category_object->category_parent;
@@ -297,6 +302,18 @@ class CustomSidebarsReplacer extends CustomSidebars {
297
  $category_object = get_category( $current_category );
298
  }
299
  }
 
 
 
 
 
 
 
 
 
 
 
 
300
  } elseif ( is_search() ) {
301
  // 3 |== Search --------------------------------------------------------
302
  // Must be before the post-type archive section; otherwise a search with
@@ -313,7 +330,7 @@ class CustomSidebarsReplacer extends CustomSidebars {
313
  );
314
  }
315
  }
316
- } elseif ( ! is_category() && ! is_singular() && get_post_type() != 'post' ) {
317
  // 4 |== Post-Tpe Archive ----------------------------------------------
318
  // `get_post_type() != 'post'` .. post-archive = post-index (see 7)
319
 
@@ -482,7 +499,6 @@ class CustomSidebarsReplacer extends CustomSidebars {
482
  // 8 |== Tag archive ---------------------------------------------------
483
 
484
  $expl && do_action( 'cs_explain', 'Type 8: Tag Archive' );
485
-
486
  foreach ( $sidebars as $sb_id ) {
487
  if ( ! empty( $options['tags'][ $sb_id ] ) ) {
488
  $replacements[ $sb_id ] = array(
@@ -540,7 +556,6 @@ class CustomSidebarsReplacer extends CustomSidebars {
540
  }
541
  } elseif ( is_404() ) {
542
  // 11 |== 404 not found ------------------------------------------------
543
-
544
  $expl && do_action( 'cs_explain', 'Type 11: 404 not found' );
545
 
546
  foreach ( $sidebars as $sb_id ) {
@@ -552,6 +567,25 @@ class CustomSidebarsReplacer extends CustomSidebars {
552
  );
553
  }
554
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
555
  }
556
 
557
  /**
@@ -566,8 +600,6 @@ class CustomSidebarsReplacer extends CustomSidebars {
566
  return $replacements;
567
  }
568
 
569
-
570
-
571
  /**
572
  * Makes sure that the replacement sidebar exists.
573
  * If the custom sidebar does not exist then the WordPress/Post options are
102
  $wp_registered_sidebars,
103
  $wp_registered_widgets;
104
 
105
+ $custom_sidebars_explain = CustomSidebarsExplain::instance();
106
+ $expl = $custom_sidebars_explain->do_explain();
107
 
108
  $expl && do_action( 'cs_explain', '<h4>Replace sidebars</h4>', true );
109
 
186
  $sidebars = self::get_options( 'modifiable' );
187
  $replacements_todo = sizeof( $sidebars );
188
  $replacements = array();
189
+
190
+ $custom_sidebars_explain = CustomSidebarsExplain::instance();
191
+ $expl = $custom_sidebars_explain->do_explain();
192
 
193
  foreach ( $sidebars as $sb ) {
194
  $replacements[ $sb ] = false;
285
  $current_category = $category_object->term_id;
286
  while ( 0 != $current_category && $replacements_todo > 0 ) {
287
  foreach ( $sidebars as $sb_id ) {
288
+ if (
289
+ isset( $options['category_single'] )
290
+ && isset( $options['category_single'][ $current_category ] )
291
+ && isset( $options['category_single'][ $current_category ][ $sb_id ] )
292
+ ) {
293
  $replacements[ $sb_id ] = array(
294
+ $options['category_single'][ $current_category ][ $sb_id ],
295
+ 'category_single',
296
  $current_category,
297
  );
 
298
  }
299
  }
300
  $current_category = $category_object->category_parent;
302
  $category_object = get_category( $current_category );
303
  }
304
  }
305
+ /**
306
+ * Category archive
307
+ */
308
+ foreach ( $sidebars as $sb_id ) {
309
+ if ( ! $replacements[ $sb_id ] && isset( $options['category_archive'][ $sb_id ] ) ) {
310
+ $replacements[ $sb_id ] = array(
311
+ $options['category_archive'][ $sb_id ],
312
+ 'category_archive',
313
+ 0,
314
+ );
315
+ }
316
+ }
317
  } elseif ( is_search() ) {
318
  // 3 |== Search --------------------------------------------------------
319
  // Must be before the post-type archive section; otherwise a search with
330
  );
331
  }
332
  }
333
+ } elseif ( ! is_tax() && ! is_404() && ! is_category() && ! is_singular() && get_post_type() != 'post' ) {
334
  // 4 |== Post-Tpe Archive ----------------------------------------------
335
  // `get_post_type() != 'post'` .. post-archive = post-index (see 7)
336
 
499
  // 8 |== Tag archive ---------------------------------------------------
500
 
501
  $expl && do_action( 'cs_explain', 'Type 8: Tag Archive' );
 
502
  foreach ( $sidebars as $sb_id ) {
503
  if ( ! empty( $options['tags'][ $sb_id ] ) ) {
504
  $replacements[ $sb_id ] = array(
556
  }
557
  } elseif ( is_404() ) {
558
  // 11 |== 404 not found ------------------------------------------------
 
559
  $expl && do_action( 'cs_explain', 'Type 11: 404 not found' );
560
 
561
  foreach ( $sidebars as $sb_id ) {
567
  );
568
  }
569
  }
570
+ } elseif ( is_tax() ) {
571
+ // 12 |== Taxonomy Archive ----------------------------------------------
572
+ $current_term = get_queried_object();
573
+ $taxonomy = $current_term->taxonomy;
574
+ $taxonomy = apply_filters( 'cs_replace_taxonomy', $taxonomy, 'archive' );
575
+ $expl && do_action( 'cs_explain', 'Type 12: ' . ucfirst( $taxonomy ) . ' Archive' );
576
+ foreach ( $sidebars as $sb_id ) {
577
+ if (
578
+ isset( $options['taxonomies_archive'] )
579
+ && isset( $options['taxonomies_archive'][ $taxonomy ] )
580
+ && isset( $options['taxonomies_archive'][ $taxonomy ][ $sb_id ] )
581
+ ) {
582
+ $replacements[ $sb_id ] = array(
583
+ $options['taxonomies_archive'][ $taxonomy ][ $sb_id ],
584
+ 'taxonomies_archive',
585
+ -1,
586
+ );
587
+ }
588
+ }
589
  }
590
 
591
  /**
600
  return $replacements;
601
  }
602
 
 
 
603
  /**
604
  * Makes sure that the replacement sidebar exists.
605
  * If the custom sidebar does not exist then the WordPress/Post options are
inc/class-custom-sidebars-visibility.php CHANGED
@@ -149,17 +149,17 @@ class CustomSidebarsVisibility extends CustomSidebars {
149
  $membership_levels = $this->get_membership_levels();
150
  $membership2_items = $this->get_membership2_items();
151
  $pagetype_list = array(
152
- 'frontpage' => 'Front Page',
153
- 'home' => 'Post Index',
154
- 'single' => 'Single page',
155
- //'posts' => 'Posts page', "Posts page" is same as "Post Index"...
156
- 'archive' => 'Archives',
157
- 'search' => 'Search results',
158
- 'e404' => 'Not found (404)',
159
- 'preview' => 'Preview',
160
- 'day' => 'Archive: Day',
161
- 'month' => 'Archive: Month',
162
- 'year' => 'Archive: Year',
163
  );
164
 
165
  // Remove taxonomies without values.
@@ -580,7 +580,8 @@ foreach ( $tags as $one ) {
580
  static $Settings = array();
581
  static $Result = array();
582
 
583
- $expl = CustomSidebarsExplain::do_explain();
 
584
 
585
  if ( ! did_action( 'cs_before_replace_sidebars' ) ) {
586
  return $widget_areas;
@@ -644,7 +645,9 @@ foreach ( $tags as $one ) {
644
  $condition_true = true;
645
  $action = 'show';
646
  $explain = ''; // This is used to explain why a widget is not displayed.
647
- $expl = CustomSidebarsExplain::do_explain();
 
 
648
 
649
  if ( empty( $instance['csb_visibility'] ) || empty( $instance['csb_visibility']['conditions'] ) ) {
650
  return $show_widget;
149
  $membership_levels = $this->get_membership_levels();
150
  $membership2_items = $this->get_membership2_items();
151
  $pagetype_list = array(
152
+ 'frontpage' => __( 'aFront Page', 'custom-sidebars' ),
153
+ 'home' => __( 'Post Index', 'custom-sidebars' ),
154
+ 'single' => __( 'Single page', 'custom-sidebars' ),
155
+ //'posts' => __( 'Posts page', 'custom-sidebars' ), "Posts page" is same as "Post Index"...
156
+ 'archive' => __( 'Archives', 'custom-sidebars' ),
157
+ 'search' => __( 'Search results', 'custom-sidebars' ),
158
+ 'e404' => __( 'Not found (404)', 'custom-sidebars' ),
159
+ 'preview' => __( 'Preview', 'custom-sidebars' ),
160
+ 'day' => __( 'Archive: Day', 'custom-sidebars' ),
161
+ 'month' => __( 'Archive: Month', 'custom-sidebars' ),
162
+ 'year' => __( 'Archive: Year', 'custom-sidebars' ),
163
  );
164
 
165
  // Remove taxonomies without values.
580
  static $Settings = array();
581
  static $Result = array();
582
 
583
+ $custom_sidebars_explain = CustomSidebarsExplain::instance();
584
+ $expl = $custom_sidebars_explain->do_explain();
585
 
586
  if ( ! did_action( 'cs_before_replace_sidebars' ) ) {
587
  return $widget_areas;
645
  $condition_true = true;
646
  $action = 'show';
647
  $explain = ''; // This is used to explain why a widget is not displayed.
648
+
649
+ $custom_sidebars_explain = CustomSidebarsExplain::instance();
650
+ $expl = $custom_sidebars_explain->do_explain();
651
 
652
  if ( empty( $instance['csb_visibility'] ) || empty( $instance['csb_visibility']['conditions'] ) ) {
653
  return $show_widget;
inc/class-custom-sidebars-widgets.php CHANGED
@@ -55,7 +55,9 @@ class CustomSidebarsWidgets extends CustomSidebars {
55
  * Adds the additional HTML code to the widgets section.
56
  */
57
  public function widget_sidebar_content() {
58
- include CSB_VIEWS_DIR . 'widgets.php';
 
 
59
  }
60
 
61
  /**
55
  * Adds the additional HTML code to the widgets section.
56
  */
57
  public function widget_sidebar_content() {
58
+ if ( false === self::$accessibility_mode ) {
59
+ include CSB_VIEWS_DIR . 'widgets.php';
60
+ }
61
  }
62
 
63
  /**
inc/class-custom-sidebars.php CHANGED
@@ -698,6 +698,30 @@ class CustomSidebars {
698
  return $Valid[ $type ];
699
  }
700
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
701
  /**
702
  * Returns an array of all categories.
703
  *
698
  return $Valid[ $type ];
699
  }
700
 
701
+ /**
702
+ * Returns a list of all taxonomies that support custom sidebars.
703
+ *
704
+ * @since 3.0.7
705
+ *
706
+ * @uses self::supported_post_type()
707
+ * @param string $type [names|objects] Defines details of return data.
708
+ * @return array List of posttype names or objects, depending on the param.
709
+ */
710
+ static public function get_taxonomies( $type = 'names', $_builtin = true ) {
711
+ $Valid = array();
712
+ if ( 'objects' != $type ) {
713
+ $type = 'names';
714
+ }
715
+ if ( ! isset( $Valid[ $type ] ) ) {
716
+ $all = get_taxonomies( array( 'public' => true, '_builtin' => $_builtin ), $type );
717
+ $Valid[ $type ] = array();
718
+ foreach ( $all as $one ) {
719
+ $Valid[ $type ][] = $one;
720
+ }
721
+ }
722
+ return $Valid[ $type ];
723
+ }
724
+
725
  /**
726
  * Returns an array of all categories.
727
  *
js/cs-cloning.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! Custom Sidebars - v3.0.6
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
  /*global jQuery:false */
1
+ /*! Custom Sidebars - v3.0.7
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
  /*global jQuery:false */
js/cs-cloning.min.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! Custom Sidebars - v3.0.6
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
 
1
+ /*! Custom Sidebars - v3.0.7
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
 
js/cs-visibility.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! Custom Sidebars - v3.0.6
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
  /*global jQuery:false */
@@ -219,4 +219,4 @@ jQuery(function init_visibility() {
219
 
220
  jQuery( '#widgets-right .widget' ).each( init_widget );
221
  $doc.on( 'widget-added', init_widget );
222
- });
1
+ /*! Custom Sidebars - v3.0.7
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
  /*global jQuery:false */
219
 
220
  jQuery( '#widgets-right .widget' ).each( init_widget );
221
  $doc.on( 'widget-added', init_widget );
222
+ });
js/cs-visibility.min.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! Custom Sidebars - v3.0.6
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
 
1
+ /*! Custom Sidebars - v3.0.7
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
 
js/cs.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! Custom Sidebars - v3.0.6
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
  /*global window:false */
@@ -997,6 +997,16 @@ window.csSidebars = null;
997
  popup.$().find( '.sb-name' ).text( resp.sidebar.name );
998
  var sb_id = resp.sidebar.id;
999
 
 
 
 
 
 
 
 
 
 
 
1000
  // Only show settings for replaceable sidebars
1001
  var sidebars = popup.$().find( '.cs-replaceable' );
1002
  sidebars.hide();
@@ -1006,6 +1016,15 @@ window.csSidebars = null;
1006
  continue;
1007
  }
1008
  sidebars.filter( '.' + resp.replaceable[key0] ).show();
 
 
 
 
 
 
 
 
 
1009
  }
1010
 
1011
  // Add a new option to the replacement list.
1
+ /*! Custom Sidebars - v3.0.7
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
  /*global window:false */
997
  popup.$().find( '.sb-name' ).text( resp.sidebar.name );
998
  var sb_id = resp.sidebar.id;
999
 
1000
+ /**
1001
+ * hide message
1002
+ */
1003
+ popup.$().find('.message.no-sidebars').hide();
1004
+
1005
+ /**
1006
+ * Count sidebars
1007
+ */
1008
+ var visible_sidebars = 0;
1009
+
1010
  // Only show settings for replaceable sidebars
1011
  var sidebars = popup.$().find( '.cs-replaceable' );
1012
  sidebars.hide();
1016
  continue;
1017
  }
1018
  sidebars.filter( '.' + resp.replaceable[key0] ).show();
1019
+ visible_sidebars++;
1020
+ }
1021
+
1022
+ /**
1023
+ * no visible_sidebars - show information about it
1024
+ */
1025
+ if ( 0 === visible_sidebars ) {
1026
+ popup.$().find( '.wpmui-box, .message, .button-primary' ).hide();
1027
+ popup.$().find('.message.no-sidebars').show().parent().addClass('notice notice-error').removeClass('hidden');
1028
  }
1029
 
1030
  // Add a new option to the replacement list.
js/cs.min.js CHANGED
@@ -1,5 +1,5 @@
1
- /*! Custom Sidebars - v3.0.6
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
 
5
- function trim(a){a=a.replace(/^\s\s*/,"");for(var b=a.length-1;b>=0;b--)if(/\S/.test(a.charAt(b))){a=a.substring(0,b+1);break}return a}function CsSidebar(a,b){var c;this.id=a.split("%").join("\\%"),this.type=b,this.sb=jQuery("#"+this.id),this.widgets="",this.name=trim(this.sb.find(".sidebar-name h2").text()),this.description=trim(this.sb.find(".sidebar-description").text()),c="custom"===b?window.csSidebars.extras.find(".cs-custom-sidebar").clone():window.csSidebars.extras.find(".cs-theme-sidebar").clone(),this.sb.parent().append(c),c.find("label").each(function(){var b=jQuery(this);window.csSidebars.addIdToLabel(b,a)})}CsSidebar.prototype.getID=function(){return this.id.split("\\").join("")},window.csSidebars=null,function(a){window.csSidebars={sidebars:[],sidebar_prefix:"cs-",edit_form:null,delete_form:null,export_form:null,location_form:null,right:null,extras:null,action_handlers:{},init:function(){"undefined"!=typeof csSidebarsData&&csSidebars.initControls().initTopTools().initSidebars().initToolbars().initColumns()},initControls:function(){return csSidebars.right=jQuery("#widgets-right"),csSidebars.extras=jQuery("#cs-widgets-extra"),null===csSidebars.edit_form&&(csSidebars.edit_form=csSidebars.extras.find(".cs-editor").clone(),csSidebars.extras.find(".cs-editor").remove()),null===csSidebars.delete_form&&(csSidebars.delete_form=csSidebars.extras.find(".cs-delete").clone(),csSidebars.extras.find(".cs-delete").remove()),null===csSidebars.export_form&&(csSidebars.export_form=csSidebars.extras.find(".cs-export").clone(),csSidebars.extras.find(".cs-export").remove()),null===csSidebars.location_form&&(csSidebars.location_form=csSidebars.extras.find(".cs-location").clone(),csSidebars.extras.find(".cs-location").remove()),jQuery("#cs-title-options").detach().prependTo(csSidebars.right),csSidebars},initColumns:function(){function a(){var a=jQuery(this),b=a.closest(".sidebars-column-1, .sidebars-column-2"),c=b.data("sort-dir");c="asc"===c?"desc":"asc",csSidebars.sort_sidebars(b,c)}var b=csSidebars.right.find(".sidebars-column-1"),c=csSidebars.right.find(".sidebars-column-2"),d=jQuery('<div class="cs-title"><h2></h2></div>'),e=csSidebars.right.find(".widgets-holder-wrap");c.length||(c=jQuery('<div class="sidebars-column-2"></div>'),c.appendTo(csSidebars.right)),d.find("h2").append('<span class="cs-title-val"></span><i class="cs-icon dashicons dashicons-sort"></i>').css({cursor:"pointer"}),d.clone().prependTo(b).click(a).find(".cs-title-val").text(csSidebarsData.custom_sidebars),d.clone().prependTo(c).click(a).find(".cs-title-val").text(csSidebarsData.theme_sidebars),b=jQuery('<div class="inner"></div>').appendTo(b),c=jQuery('<div class="inner"></div>').appendTo(c),e.each(function(){var a=jQuery(this),d=a.find(".widgets-sortables");csSidebars.isCustomSidebar(d)?a.appendTo(b):a.appendTo(c)})},initSidebars:function(){return csSidebars.right.find(".widgets-sortables").each(function(){var a,b,c=!1,d=jQuery(this),e=d.attr("id");if(!0!==d.data("cs-init"))if(d.data("cs-init",!0),csSidebars.isCustomSidebar(this))b=csSidebars.add(e,"custom");else{b=csSidebars.add(e,"theme");for(a in csSidebarsData.replaceable)if(csSidebarsData.replaceable.hasOwnProperty(a)&&csSidebarsData.replaceable[a]===e){c=!0;break}csSidebars.setReplaceable(b,c,!1)}}),csSidebars},initTopTools:function(){var a=jQuery(".btn-create-sidebar"),b=jQuery(".btn-export"),c=jQuery(".cs-options"),d=jQuery('<input type="search" class="cs-filter" />'),e={};return a.click(function(){e.id="",e.title=csSidebarsData.title_new,e.button=csSidebarsData.btn_new,e.description="",e.name="",csSidebars.showEditor(e)}),b.click(csSidebars.showExport),d.appendTo(c).attr("placeholder",csSidebarsData.filter).keyup(csSidebars.filter_sidebars).on("search",csSidebars.filter_sidebars),csSidebars},initToolbars:function(){function a(a){var b=jQuery(a.target).closest(".cs-tool"),c=b.data("action"),d=csSidebars.getIdFromEditbar(b),e=csSidebars.find(d);return!csSidebars.handleAction(c,e)}return csSidebars.registerAction("edit",csSidebars.showEditor),csSidebars.registerAction("location",csSidebars.showLocations),csSidebars.registerAction("delete",csSidebars.showRemove),csSidebars.registerAction("replaceable",csSidebars.setReplaceable),csSidebars.right.on("click",".cs-tool",a),csSidebars},handleAction:function(a,b){return"function"==typeof csSidebars.action_handlers[a]&&!!csSidebars.action_handlers[a](b)},registerAction:function(a,b){csSidebars.action_handlers[a]=b},showAjaxError:function(a){var b={};b.message=csSidebarsData.ajax_error,b.details=a,b.parent="#widgets-right",b.insert_after="#cs-title-options",b.id="editor",b.type="err",wpmUi.message(b)},sort_sidebars:function(a,b){var c=a.find(".widgets-holder-wrap"),d=a.find(".cs-title .cs-icon");c.sortElements(function(a,c){var d=jQuery(a).find(".sidebar-name h2").text(),e=jQuery(c).find(".sidebar-name h2").text();return"asc"===b?d>e?1:-1:d<e?1:-1}),a.data("sort-dir",b),"asc"===b?d.removeClass("dashicons-arrow-down dashicons-sort").addClass("dashicons-arrow-up"):d.removeClass("dashicons-arrow-up dashicons-sort").addClass("dashicons-arrow-down")},filter_sidebars:function(a){var b=jQuery("input.cs-filter").val().toLowerCase();csSidebars.right.find(".widgets-holder-wrap").each(function(){var a=jQuery(this);-1!==a.find(".sidebar-name h2").text().toLowerCase().indexOf(b)?a.show():a.hide()}),jQuery(window).trigger("cs-resize")},showEditor:function(b){function c(){i.$().removeClass("csb-has-more"),i.size(782,215)}function d(){i.$().addClass("csb-has-more"),i.size(782,545)}function e(){jQuery(this).prop("checked")?d():c()}function f(a,b,c){return i.loading(!1),!!a&&(b?(a.sidebar&&(a=a.sidebar),a.id&&i.$().find("#csb-id").val(a.id),a.name&&i.$().find("#csb-name").val(a.name),a.description&&i.$().find("#csb-description").val(a.description),a.before_title&&i.$().find("#csb-before-title").val(a.before_title),a.after_title&&i.$().find("#csb-after-title").val(a.after_title),a.before_widget&&i.$().find("#csb-before-widget").val(a.before_widget),a.after_widget&&i.$().find("#csb-after-widget").val(a.after_widget),void(a.button&&i.$().find(".btn-save").text(a.button))):(i.destroy(),csSidebars.showAjaxError(a),!1))}function g(b,c,d){var e,f={};i.loading(!1),i.destroy(),f.message=b.message,f.parent="#widgets-right",f.insert_after="#cs-title-options",f.id="editor",c?"update"===b.action?(e=csSidebars.find(b.data.id),csSidebars.updateSidebar(e,b.data)):"insert"===b.action&&(csSidebars.insertSidebar(b.data),a(".cs-wrap .custom-sidebars-add-new").detach()):f.type="err",wpmUi.message(f)}function h(){var a=i.$().find("form");return i.loading(!0),j.reset().data(a).ondone(g).load_json(),!1}var i=null,j=null;return b instanceof CsSidebar&&(b={id:b.getID(),title:csSidebarsData.title_edit.replace("[Sidebar]",b.name),button:csSidebarsData.btn_edit}),i=wpmUi.popup().modal(!0).title(b.title).onshow(c).content(csSidebars.edit_form),c(),f(b,!0,null),j=wpmUi.ajax(null,"cs-ajax"),b.id&&(i.loading(!0),j.reset().data({do:"get",sb:b.id}).ondone(f).load_json()),i.show(),i.$().find("#csb-name").focus(),i.$().on("keypress","#csb-name",function(b){13===b.keyCode&&0<a(this).val().length&&a("#csb-description").focus()}),i.$().on("keypress","#csb-description",function(a){13===a.keyCode&&i.$(".btn-save").click()}),i.$().on("click","#csb-more",e),i.$().on("click",".btn-save",h),i.$().on("click",".btn-cancel",i.destroy),!0},updateSidebar:function(a,b){return a.sb.find(".sidebar-name h2").text(b.name),a.sb.find(".sidebar-description").html('<p class="description"></p>').find(".description").text(b.description),csSidebars},insertSidebar:function(a){var b=jQuery('<div class="widgets-holder-wrap"></div>'),c=jQuery('<div class="widgets-sortables ui-sortable"></div>'),d=jQuery('<div class="sidebar-name"><div class="sidebar-name-arrow"><br></div><h2></h2></div>'),e=jQuery('<div class="sidebar-description"></div>'),f=csSidebars.right.find(".sidebars-column-1 > .inner:first");return c.attr("id",a.id),d.find("h2").text(a.name),e.html('<p class="description"></p>').find(".description").text(a.description),d.appendTo(c),e.appendTo(c),c.appendTo(b),b.prependTo(f),jQuery("#widgets-right .sidebar-name").unbind("click"),jQuery("#widgets-left .sidebar-name").unbind("click"),jQuery(document.body).unbind("click.widgets-toggle"),jQuery(".widgets-chooser").off("click.widgets-chooser").off("keyup.widgets-chooser"),jQuery("#available-widgets .widget .widget-title").off("click.widgets-chooser"),jQuery(".widgets-chooser-sidebars").empty(),window.wpWidgets.init(),csSidebars.initSidebars(),csSidebars},showExport:function(){function a(a){var b=jQuery(this).closest("form");return h.reset().data(b).load_http(),g.destroy(),a.preventDefault(),!1}function b(a,b,c){var d={};g.loading(!1),b?g.size(900,600).content(a.html):(d.message=a.message,d.parent=g.$().find(".wpmui-wnd-content"),d.insert_after=!1,d.id="export",d.class="wpmui-wnd-err",d.type="err",wpmUi.message(d))}function c(a){var c=jQuery(this).closest("form");return g.loading(!0),h.reset().data(c).ondone(b).load_json("cs-ajax"),a.preventDefault(),!1}function d(){var a=jQuery(this),b=a.prop("checked"),c=g.$().find(".column-widgets, .import-widgets");b?c.show():c.hide()}function e(){g.size(782,480),g.content(csSidebars.export_form)}function f(){var a=g.$().find(".frm-import");g.loading(!0),h.reset().data(a).load_http("_self")}var g=null,h=null;return g=wpmUi.popup().modal(!0).size(782,480).title(csSidebarsData.title_export).content(csSidebars.export_form).show(),h=wpmUi.ajax(null,"cs-ajax"),g.$().on("submit",".frm-export",a),g.$().on("submit",".frm-preview-import",c),g.$().on("change","#import-widgets",d),g.$().on("click",".btn-cancel",e),g.$().on("click",".btn-import",f),!0},showRemove:function(a){function b(a){a.find(".name").text(i)}function c(){f.loading(!1),f.destroy()}function d(a,b,c){var d={};f.loading(!1),f.destroy(),d.message=a.message,d.parent="#widgets-right",d.insert_after="#cs-title-options",d.id="editor",b?(csSidebars.right.find("#"+h).closest(".widgets-holder-wrap").remove(),csSidebars.remove(h),"delete"===a.action&&window.csSidebars.showGetStartedBox()):d.type="err",wpmUi.message(d)}function e(){f.loading(!0),g.reset().data({do:"delete",sb:h}).ondone(d).load_json()}var f=null,g=null,h=a.getID(),i=a.name;return f=wpmUi.popup().modal(!0).size(560,160).title(csSidebarsData.title_delete).content(csSidebars.delete_form).onshow(b).show(),g=wpmUi.ajax(null,"cs-ajax"),f.$().on("click",".btn-cancel",c),f.$().on("click",".btn-delete",e),!0},showLocations:function(a){function b(a,b,c){function d(a,b,c){var d=jQuery("<option></option>");d.attr("value",c).text(a.name),b.append(d)}function e(a,b,c,d){var e=d.closest(".cs-replaceable").filter("."+b),f=e.find('option[value="'+c+'"]'),g=e.find("optgroup.used"),h=e.find(".detail-toggle");a===j?(f.prop("selected",!0),!0!==h.prop("checked")&&(h.prop("checked",!0),e.addClass("open"),wpmUi.upgrade_multiselect(e))):(g.length||(g=jQuery('<optgroup class="used">').attr("label",e.data("lbl-used")).appendTo(e.find(".details select"))),f.detach().appendTo(g))}var g,h,i;if(f.loading(!1),!b)return f.destroy(),void csSidebars.showAjaxError(a);f.$().find(".sb-name").text(a.sidebar.name);var j=a.sidebar.id,k=f.$().find(".cs-replaceable");k.hide(),a.replaceable=wpmUi.obj(a.replaceable);for(var l in a.replaceable)a.replaceable.hasOwnProperty(l)&&k.filter("."+a.replaceable[l]).show();var m=f.$().find(".cs-datalist.cs-cat"),n=f.$().find(".cs-datalist.cs-arc-cat"),o=a.categories;n.empty(),m.empty();for(var p in o)d(o[p],n,p),d(o[p],m,p);for(var q in o){if(o[q].single)for(g in o[q].single)e(o[q].single[g],g,q,m);if(o[q].archive)for(g in o[q].archive)e(o[q].archive[g],g,q,n)}var r=f.$().find(".cs-datalist.cs-pt"),s=a.posttypes;r.empty();for(var t in s)h=jQuery("<option></option>"),i=s[t].name,h.attr("value",t).text(i),r.append(h);for(var u in s)if(s[u].single)for(g in s[u].single)e(s[u].single[g],g,u,r);var v=f.$().find(".cs-datalist.cs-arc"),w=a.archives;v.empty();for(var x in w)h=jQuery("<option></option>"),i=w[x].name,h.attr("value",x).text(i),v.append(h);for(var y in w)if(w[y].archive)for(g in w[y].archive)e(w[y].archive[g],g,y,v);var z=f.$().find(".cs-datalist.cs-arc-aut"),A=a.authors;z.empty();for(var B in A)h=jQuery("<option></option>"),i=A[B].name,h.attr("value",B).text(i),z.append(h);for(var C in A)if(A[C].archive)for(g in A[C].archive)e(A[C].archive[g],g,C,z)}function c(a){var b=jQuery(this),c=b.closest(".cs-replaceable"),d=c.find("select");b.prop("checked")?(c.addClass("open"),wpmUi.upgrade_multiselect(c),d.trigger("change.select2")):(c.removeClass("open"),d.val([]))}function d(a,b,c){var d={};f.loading(!1),f.destroy(),d.message=a.message,d.parent="#widgets-right",d.insert_after="#cs-title-options",d.id="editor",b||(d.type="err"),wpmUi.message(d)}function e(){f.loading(!0),g.reset().data(h).ondone(d).load_json()}var f=null,g=null,h=null,i=a.getID();return f=wpmUi.popup().modal(!0).size(782,560).title(csSidebarsData.title_location).content(csSidebars.location_form).show(),f.loading(!0),h=f.$().find(".frm-location"),h.find(".sb-id").val(i),g=wpmUi.ajax(null,"cs-ajax"),g.reset().data({do:"get-location",sb:i}).ondone(b).load_json(),f.$().on("click",".detail-toggle",c),f.$().on("click",".btn-save",e),f.$().on("click",".btn-cancel",f.destroy),!0},setReplaceable:function(a,b,c){function d(a,b,c){a instanceof Object&&"object"==typeof a.replaceable&&(csSidebarsData.replaceable=wpmUi.obj(a.replaceable),f.find(".widgets-sortables").each(function(){var a=!1,b=jQuery(this),c=b.attr("id"),d=csSidebars.find(c);for(var e in csSidebarsData.replaceable)if(csSidebarsData.replaceable.hasOwnProperty(e)&&csSidebarsData.replaceable[e]===c){a=!0;break}csSidebars.setReplaceable(d,a,!1)})),f.find(".cs-toolbar .chk-replaceable").prop("disabled",!1),f.find(".cs-toolbar .btn-replaceable").removeClass("wpmui-loading")}var e,f=csSidebars.right.find(".sidebars-column-2 .widgets-holder-wrap"),g=jQuery(a.sb).closest(".widgets-holder-wrap"),h=g.find(".cs-toolbar .chk-replaceable"),i=g.find(".replace-marker");g.find(".cs-toolbar .btn-replaceable");return void 0===b&&(b=h.prop("checked")),void 0===c&&(c=!0),h.data("active")!==b&&(h.data("active",b),h.prop("checked",b),b?(i.length||jQuery("<div></div>").appendTo(g).attr("data-label",csSidebarsData.lbl_replaceable).addClass("replace-marker"),g.addClass("replaceable")):(i.remove(),g.removeClass("replaceable")),c&&(f.find(".cs-toolbar .chk-replaceable").prop("disabled",!0),f.find(".cs-toolbar .btn-replaceable").addClass("wpmui-loading"),e=wpmUi.ajax(null,"cs-ajax"),e.reset().data({do:"replaceable",state:b,sb:a.getID()}).ondone(d).load_json()),!1)},find:function(a){return csSidebars.sidebars[a]},add:function(a,b){return csSidebars.sidebars[a]=new CsSidebar(a,b),csSidebars.sidebars[a]},remove:function(a){delete csSidebars.sidebars[a]},isCustomSidebar:function(a){return jQuery(a).attr("id").substr(0,csSidebars.sidebar_prefix.length)===csSidebars.sidebar_prefix},addIdToLabel:function(a,b){if(!0!==a.data("label-done")){var c=a.attr("for");a.attr("for",c+b),a.find(".has-label").attr("id",c+b),a.data("label-done",!0)}},getIdFromEditbar:function(a){return a.closest(".widgets-holder-wrap").find(".widgets-sortables:first").attr("id")},showGetStartedBox:function(){if(0===a(".sidebars-column-1 .inner .widgets-holder-wrap").length){var b=wp.template("custom-sidebars-new");a(".sidebars-column-1 .inner").before(b()),a(".custom-sidebars-add-new").on("click",function(){a("button.btn-create-sidebar").click()})}}},jQuery(function(a){a("#csfooter").hide(),a("#widgets-right").length>0&&csSidebars.init(),a(".defaultsContainer").hide(),a("#widgets-right .widgets-sortables").on("sort",function(b,c){a("#widgets-right").top;c.position.top=-a("#widgets-right").css("top")})}),jQuery(document).ready(function(a){window.setTimeout(function(){window.csSidebars.showGetStartedBox()},1e3)})}(jQuery),jQuery.fn.sortElements=function(){var a=[].sort;return function(b,c){c=c||function(){return this};var d=this.map(function(){var a=c.call(this),b=a.parentNode,d=b.insertBefore(document.createTextNode(""),a.nextSibling);return function(){if(b===this)throw new Error("You can't sort elements if any one is a descendant of another.");b.insertBefore(this,d),b.removeChild(d)}});return a.call(this,b).each(function(a){d[a].call(c.call(this))})}}();
1
+ /*! Custom Sidebars - v3.0.7
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
 
5
+ function trim(a){a=a.replace(/^\s\s*/,"");for(var b=a.length-1;b>=0;b--)if(/\S/.test(a.charAt(b))){a=a.substring(0,b+1);break}return a}function CsSidebar(a,b){var c;this.id=a.split("%").join("\\%"),this.type=b,this.sb=jQuery("#"+this.id),this.widgets="",this.name=trim(this.sb.find(".sidebar-name h2").text()),this.description=trim(this.sb.find(".sidebar-description").text()),c="custom"===b?window.csSidebars.extras.find(".cs-custom-sidebar").clone():window.csSidebars.extras.find(".cs-theme-sidebar").clone(),this.sb.parent().append(c),c.find("label").each(function(){var b=jQuery(this);window.csSidebars.addIdToLabel(b,a)})}CsSidebar.prototype.getID=function(){return this.id.split("\\").join("")},window.csSidebars=null,function(a){window.csSidebars={sidebars:[],sidebar_prefix:"cs-",edit_form:null,delete_form:null,export_form:null,location_form:null,right:null,extras:null,action_handlers:{},init:function(){"undefined"!=typeof csSidebarsData&&csSidebars.initControls().initTopTools().initSidebars().initToolbars().initColumns()},initControls:function(){return csSidebars.right=jQuery("#widgets-right"),csSidebars.extras=jQuery("#cs-widgets-extra"),null===csSidebars.edit_form&&(csSidebars.edit_form=csSidebars.extras.find(".cs-editor").clone(),csSidebars.extras.find(".cs-editor").remove()),null===csSidebars.delete_form&&(csSidebars.delete_form=csSidebars.extras.find(".cs-delete").clone(),csSidebars.extras.find(".cs-delete").remove()),null===csSidebars.export_form&&(csSidebars.export_form=csSidebars.extras.find(".cs-export").clone(),csSidebars.extras.find(".cs-export").remove()),null===csSidebars.location_form&&(csSidebars.location_form=csSidebars.extras.find(".cs-location").clone(),csSidebars.extras.find(".cs-location").remove()),jQuery("#cs-title-options").detach().prependTo(csSidebars.right),csSidebars},initColumns:function(){function a(){var a=jQuery(this),b=a.closest(".sidebars-column-1, .sidebars-column-2"),c=b.data("sort-dir");c="asc"===c?"desc":"asc",csSidebars.sort_sidebars(b,c)}var b=csSidebars.right.find(".sidebars-column-1"),c=csSidebars.right.find(".sidebars-column-2"),d=jQuery('<div class="cs-title"><h2></h2></div>'),e=csSidebars.right.find(".widgets-holder-wrap");c.length||(c=jQuery('<div class="sidebars-column-2"></div>'),c.appendTo(csSidebars.right)),d.find("h2").append('<span class="cs-title-val"></span><i class="cs-icon dashicons dashicons-sort"></i>').css({cursor:"pointer"}),d.clone().prependTo(b).click(a).find(".cs-title-val").text(csSidebarsData.custom_sidebars),d.clone().prependTo(c).click(a).find(".cs-title-val").text(csSidebarsData.theme_sidebars),b=jQuery('<div class="inner"></div>').appendTo(b),c=jQuery('<div class="inner"></div>').appendTo(c),e.each(function(){var a=jQuery(this),d=a.find(".widgets-sortables");csSidebars.isCustomSidebar(d)?a.appendTo(b):a.appendTo(c)})},initSidebars:function(){return csSidebars.right.find(".widgets-sortables").each(function(){var a,b,c=!1,d=jQuery(this),e=d.attr("id");if(!0!==d.data("cs-init"))if(d.data("cs-init",!0),csSidebars.isCustomSidebar(this))b=csSidebars.add(e,"custom");else{b=csSidebars.add(e,"theme");for(a in csSidebarsData.replaceable)if(csSidebarsData.replaceable.hasOwnProperty(a)&&csSidebarsData.replaceable[a]===e){c=!0;break}csSidebars.setReplaceable(b,c,!1)}}),csSidebars},initTopTools:function(){var a=jQuery(".btn-create-sidebar"),b=jQuery(".btn-export"),c=jQuery(".cs-options"),d=jQuery('<input type="search" class="cs-filter" />'),e={};return a.click(function(){e.id="",e.title=csSidebarsData.title_new,e.button=csSidebarsData.btn_new,e.description="",e.name="",csSidebars.showEditor(e)}),b.click(csSidebars.showExport),d.appendTo(c).attr("placeholder",csSidebarsData.filter).keyup(csSidebars.filter_sidebars).on("search",csSidebars.filter_sidebars),csSidebars},initToolbars:function(){function a(a){var b=jQuery(a.target).closest(".cs-tool"),c=b.data("action"),d=csSidebars.getIdFromEditbar(b),e=csSidebars.find(d);return!csSidebars.handleAction(c,e)}return csSidebars.registerAction("edit",csSidebars.showEditor),csSidebars.registerAction("location",csSidebars.showLocations),csSidebars.registerAction("delete",csSidebars.showRemove),csSidebars.registerAction("replaceable",csSidebars.setReplaceable),csSidebars.right.on("click",".cs-tool",a),csSidebars},handleAction:function(a,b){return"function"==typeof csSidebars.action_handlers[a]&&!!csSidebars.action_handlers[a](b)},registerAction:function(a,b){csSidebars.action_handlers[a]=b},showAjaxError:function(a){var b={};b.message=csSidebarsData.ajax_error,b.details=a,b.parent="#widgets-right",b.insert_after="#cs-title-options",b.id="editor",b.type="err",wpmUi.message(b)},sort_sidebars:function(a,b){var c=a.find(".widgets-holder-wrap"),d=a.find(".cs-title .cs-icon");c.sortElements(function(a,c){var d=jQuery(a).find(".sidebar-name h2").text(),e=jQuery(c).find(".sidebar-name h2").text();return"asc"===b?d>e?1:-1:d<e?1:-1}),a.data("sort-dir",b),"asc"===b?d.removeClass("dashicons-arrow-down dashicons-sort").addClass("dashicons-arrow-up"):d.removeClass("dashicons-arrow-up dashicons-sort").addClass("dashicons-arrow-down")},filter_sidebars:function(a){var b=jQuery("input.cs-filter").val().toLowerCase();csSidebars.right.find(".widgets-holder-wrap").each(function(){var a=jQuery(this);-1!==a.find(".sidebar-name h2").text().toLowerCase().indexOf(b)?a.show():a.hide()}),jQuery(window).trigger("cs-resize")},showEditor:function(b){function c(){i.$().removeClass("csb-has-more"),i.size(782,215)}function d(){i.$().addClass("csb-has-more"),i.size(782,545)}function e(){jQuery(this).prop("checked")?d():c()}function f(a,b,c){return i.loading(!1),!!a&&(b?(a.sidebar&&(a=a.sidebar),a.id&&i.$().find("#csb-id").val(a.id),a.name&&i.$().find("#csb-name").val(a.name),a.description&&i.$().find("#csb-description").val(a.description),a.before_title&&i.$().find("#csb-before-title").val(a.before_title),a.after_title&&i.$().find("#csb-after-title").val(a.after_title),a.before_widget&&i.$().find("#csb-before-widget").val(a.before_widget),a.after_widget&&i.$().find("#csb-after-widget").val(a.after_widget),void(a.button&&i.$().find(".btn-save").text(a.button))):(i.destroy(),csSidebars.showAjaxError(a),!1))}function g(b,c,d){var e,f={};i.loading(!1),i.destroy(),f.message=b.message,f.parent="#widgets-right",f.insert_after="#cs-title-options",f.id="editor",c?"update"===b.action?(e=csSidebars.find(b.data.id),csSidebars.updateSidebar(e,b.data)):"insert"===b.action&&(csSidebars.insertSidebar(b.data),a(".cs-wrap .custom-sidebars-add-new").detach()):f.type="err",wpmUi.message(f)}function h(){var a=i.$().find("form");return i.loading(!0),j.reset().data(a).ondone(g).load_json(),!1}var i=null,j=null;return b instanceof CsSidebar&&(b={id:b.getID(),title:csSidebarsData.title_edit.replace("[Sidebar]",b.name),button:csSidebarsData.btn_edit}),i=wpmUi.popup().modal(!0).title(b.title).onshow(c).content(csSidebars.edit_form),c(),f(b,!0,null),j=wpmUi.ajax(null,"cs-ajax"),b.id&&(i.loading(!0),j.reset().data({do:"get",sb:b.id}).ondone(f).load_json()),i.show(),i.$().find("#csb-name").focus(),i.$().on("keypress","#csb-name",function(b){13===b.keyCode&&0<a(this).val().length&&a("#csb-description").focus()}),i.$().on("keypress","#csb-description",function(a){13===a.keyCode&&i.$(".btn-save").click()}),i.$().on("click","#csb-more",e),i.$().on("click",".btn-save",h),i.$().on("click",".btn-cancel",i.destroy),!0},updateSidebar:function(a,b){return a.sb.find(".sidebar-name h2").text(b.name),a.sb.find(".sidebar-description").html('<p class="description"></p>').find(".description").text(b.description),csSidebars},insertSidebar:function(a){var b=jQuery('<div class="widgets-holder-wrap"></div>'),c=jQuery('<div class="widgets-sortables ui-sortable"></div>'),d=jQuery('<div class="sidebar-name"><div class="sidebar-name-arrow"><br></div><h2></h2></div>'),e=jQuery('<div class="sidebar-description"></div>'),f=csSidebars.right.find(".sidebars-column-1 > .inner:first");return c.attr("id",a.id),d.find("h2").text(a.name),e.html('<p class="description"></p>').find(".description").text(a.description),d.appendTo(c),e.appendTo(c),c.appendTo(b),b.prependTo(f),jQuery("#widgets-right .sidebar-name").unbind("click"),jQuery("#widgets-left .sidebar-name").unbind("click"),jQuery(document.body).unbind("click.widgets-toggle"),jQuery(".widgets-chooser").off("click.widgets-chooser").off("keyup.widgets-chooser"),jQuery("#available-widgets .widget .widget-title").off("click.widgets-chooser"),jQuery(".widgets-chooser-sidebars").empty(),window.wpWidgets.init(),csSidebars.initSidebars(),csSidebars},showExport:function(){function a(a){var b=jQuery(this).closest("form");return h.reset().data(b).load_http(),g.destroy(),a.preventDefault(),!1}function b(a,b,c){var d={};g.loading(!1),b?g.size(900,600).content(a.html):(d.message=a.message,d.parent=g.$().find(".wpmui-wnd-content"),d.insert_after=!1,d.id="export",d.class="wpmui-wnd-err",d.type="err",wpmUi.message(d))}function c(a){var c=jQuery(this).closest("form");return g.loading(!0),h.reset().data(c).ondone(b).load_json("cs-ajax"),a.preventDefault(),!1}function d(){var a=jQuery(this),b=a.prop("checked"),c=g.$().find(".column-widgets, .import-widgets");b?c.show():c.hide()}function e(){g.size(782,480),g.content(csSidebars.export_form)}function f(){var a=g.$().find(".frm-import");g.loading(!0),h.reset().data(a).load_http("_self")}var g=null,h=null;return g=wpmUi.popup().modal(!0).size(782,480).title(csSidebarsData.title_export).content(csSidebars.export_form).show(),h=wpmUi.ajax(null,"cs-ajax"),g.$().on("submit",".frm-export",a),g.$().on("submit",".frm-preview-import",c),g.$().on("change","#import-widgets",d),g.$().on("click",".btn-cancel",e),g.$().on("click",".btn-import",f),!0},showRemove:function(a){function b(a){a.find(".name").text(i)}function c(){f.loading(!1),f.destroy()}function d(a,b,c){var d={};f.loading(!1),f.destroy(),d.message=a.message,d.parent="#widgets-right",d.insert_after="#cs-title-options",d.id="editor",b?(csSidebars.right.find("#"+h).closest(".widgets-holder-wrap").remove(),csSidebars.remove(h),"delete"===a.action&&window.csSidebars.showGetStartedBox()):d.type="err",wpmUi.message(d)}function e(){f.loading(!0),g.reset().data({do:"delete",sb:h}).ondone(d).load_json()}var f=null,g=null,h=a.getID(),i=a.name;return f=wpmUi.popup().modal(!0).size(560,160).title(csSidebarsData.title_delete).content(csSidebars.delete_form).onshow(b).show(),g=wpmUi.ajax(null,"cs-ajax"),f.$().on("click",".btn-cancel",c),f.$().on("click",".btn-delete",e),!0},showLocations:function(a){function b(a,b,c){function d(a,b,c){var d=jQuery("<option></option>");d.attr("value",c).text(a.name),b.append(d)}function e(a,b,c,d){var e=d.closest(".cs-replaceable").filter("."+b),f=e.find('option[value="'+c+'"]'),g=e.find("optgroup.used"),h=e.find(".detail-toggle");a===j?(f.prop("selected",!0),!0!==h.prop("checked")&&(h.prop("checked",!0),e.addClass("open"),wpmUi.upgrade_multiselect(e))):(g.length||(g=jQuery('<optgroup class="used">').attr("label",e.data("lbl-used")).appendTo(e.find(".details select"))),f.detach().appendTo(g))}var g,h,i;if(f.loading(!1),!b)return f.destroy(),void csSidebars.showAjaxError(a);f.$().find(".sb-name").text(a.sidebar.name);var j=a.sidebar.id;f.$().find(".message.no-sidebars").hide();var k=0,l=f.$().find(".cs-replaceable");l.hide(),a.replaceable=wpmUi.obj(a.replaceable);for(var m in a.replaceable)a.replaceable.hasOwnProperty(m)&&(l.filter("."+a.replaceable[m]).show(),k++);0===k&&(f.$().find(".wpmui-box, .message, .button-primary").hide(),f.$().find(".message.no-sidebars").show().parent().addClass("notice notice-error").removeClass("hidden"));var n=f.$().find(".cs-datalist.cs-cat"),o=f.$().find(".cs-datalist.cs-arc-cat"),p=a.categories;o.empty(),n.empty();for(var q in p)d(p[q],o,q),d(p[q],n,q);for(var r in p){if(p[r].single)for(g in p[r].single)e(p[r].single[g],g,r,n);if(p[r].archive)for(g in p[r].archive)e(p[r].archive[g],g,r,o)}var s=f.$().find(".cs-datalist.cs-pt"),t=a.posttypes;s.empty();for(var u in t)h=jQuery("<option></option>"),i=t[u].name,h.attr("value",u).text(i),s.append(h);for(var v in t)if(t[v].single)for(g in t[v].single)e(t[v].single[g],g,v,s);var w=f.$().find(".cs-datalist.cs-arc"),x=a.archives;w.empty();for(var y in x)h=jQuery("<option></option>"),i=x[y].name,h.attr("value",y).text(i),w.append(h);for(var z in x)if(x[z].archive)for(g in x[z].archive)e(x[z].archive[g],g,z,w);var A=f.$().find(".cs-datalist.cs-arc-aut"),B=a.authors;A.empty();for(var C in B)h=jQuery("<option></option>"),i=B[C].name,h.attr("value",C).text(i),A.append(h);for(var D in B)if(B[D].archive)for(g in B[D].archive)e(B[D].archive[g],g,D,A)}function c(a){var b=jQuery(this),c=b.closest(".cs-replaceable"),d=c.find("select");b.prop("checked")?(c.addClass("open"),wpmUi.upgrade_multiselect(c),d.trigger("change.select2")):(c.removeClass("open"),d.val([]))}function d(a,b,c){var d={};f.loading(!1),f.destroy(),d.message=a.message,d.parent="#widgets-right",d.insert_after="#cs-title-options",d.id="editor",b||(d.type="err"),wpmUi.message(d)}function e(){f.loading(!0),g.reset().data(h).ondone(d).load_json()}var f=null,g=null,h=null,i=a.getID();return f=wpmUi.popup().modal(!0).size(782,560).title(csSidebarsData.title_location).content(csSidebars.location_form).show(),f.loading(!0),h=f.$().find(".frm-location"),h.find(".sb-id").val(i),g=wpmUi.ajax(null,"cs-ajax"),g.reset().data({do:"get-location",sb:i}).ondone(b).load_json(),f.$().on("click",".detail-toggle",c),f.$().on("click",".btn-save",e),f.$().on("click",".btn-cancel",f.destroy),!0},setReplaceable:function(a,b,c){function d(a,b,c){a instanceof Object&&"object"==typeof a.replaceable&&(csSidebarsData.replaceable=wpmUi.obj(a.replaceable),f.find(".widgets-sortables").each(function(){var a=!1,b=jQuery(this),c=b.attr("id"),d=csSidebars.find(c);for(var e in csSidebarsData.replaceable)if(csSidebarsData.replaceable.hasOwnProperty(e)&&csSidebarsData.replaceable[e]===c){a=!0;break}csSidebars.setReplaceable(d,a,!1)})),f.find(".cs-toolbar .chk-replaceable").prop("disabled",!1),f.find(".cs-toolbar .btn-replaceable").removeClass("wpmui-loading")}var e,f=csSidebars.right.find(".sidebars-column-2 .widgets-holder-wrap"),g=jQuery(a.sb).closest(".widgets-holder-wrap"),h=g.find(".cs-toolbar .chk-replaceable"),i=g.find(".replace-marker");g.find(".cs-toolbar .btn-replaceable");return void 0===b&&(b=h.prop("checked")),void 0===c&&(c=!0),h.data("active")!==b&&(h.data("active",b),h.prop("checked",b),b?(i.length||jQuery("<div></div>").appendTo(g).attr("data-label",csSidebarsData.lbl_replaceable).addClass("replace-marker"),g.addClass("replaceable")):(i.remove(),g.removeClass("replaceable")),c&&(f.find(".cs-toolbar .chk-replaceable").prop("disabled",!0),f.find(".cs-toolbar .btn-replaceable").addClass("wpmui-loading"),e=wpmUi.ajax(null,"cs-ajax"),e.reset().data({do:"replaceable",state:b,sb:a.getID()}).ondone(d).load_json()),!1)},find:function(a){return csSidebars.sidebars[a]},add:function(a,b){return csSidebars.sidebars[a]=new CsSidebar(a,b),csSidebars.sidebars[a]},remove:function(a){delete csSidebars.sidebars[a]},isCustomSidebar:function(a){return jQuery(a).attr("id").substr(0,csSidebars.sidebar_prefix.length)===csSidebars.sidebar_prefix},addIdToLabel:function(a,b){if(!0!==a.data("label-done")){var c=a.attr("for");a.attr("for",c+b),a.find(".has-label").attr("id",c+b),a.data("label-done",!0)}},getIdFromEditbar:function(a){return a.closest(".widgets-holder-wrap").find(".widgets-sortables:first").attr("id")},showGetStartedBox:function(){if(0===a(".sidebars-column-1 .inner .widgets-holder-wrap").length){var b=wp.template("custom-sidebars-new");a(".sidebars-column-1 .inner").before(b()),a(".custom-sidebars-add-new").on("click",function(){a("button.btn-create-sidebar").click()})}}},jQuery(function(a){a("#csfooter").hide(),a("#widgets-right").length>0&&csSidebars.init(),a(".defaultsContainer").hide(),a("#widgets-right .widgets-sortables").on("sort",function(b,c){a("#widgets-right").top;c.position.top=-a("#widgets-right").css("top")})}),jQuery(document).ready(function(a){window.setTimeout(function(){window.csSidebars.showGetStartedBox()},1e3)})}(jQuery),jQuery.fn.sortElements=function(){var a=[].sort;return function(b,c){c=c||function(){return this};var d=this.map(function(){var a=c.call(this),b=a.parentNode,d=b.insertBefore(document.createTextNode(""),a.nextSibling);return function(){if(b===this)throw new Error("You can't sort elements if any one is a descendant of another.");b.insertBefore(this,d),b.removeChild(d)}});return a.call(this,b).each(function(a){d[a].call(c.call(this))})}}();
lang/custom-sidebars.pot CHANGED
@@ -4,7 +4,7 @@ msgid ""
4
  msgstr ""
5
  "Project-Id-Version: Custom Sidebars Pro PLUGIN_VERSION\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/customsidebars\n"
7
- "POT-Creation-Date: 2017-05-08 08:30:57+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -91,51 +91,75 @@ msgstr ""
91
  msgid "Deleted sidebar <strong>%1$s</strong>"
92
  msgstr ""
93
 
94
- #: inc/class-custom-sidebars-editor.php:381
95
  msgid "Front Page"
96
  msgstr ""
97
 
98
- #: inc/class-custom-sidebars-editor.php:382
99
  msgid "Search Results"
100
  msgstr ""
101
 
102
- #: inc/class-custom-sidebars-editor.php:383
 
103
  msgid "Not found (404)"
104
  msgstr ""
105
 
106
- #: inc/class-custom-sidebars-editor.php:384
107
  msgid "Any Author Archive"
108
  msgstr ""
109
 
110
- #: inc/class-custom-sidebars-editor.php:385
111
- msgid "Tag Archives"
112
  msgstr ""
113
 
114
- #: inc/class-custom-sidebars-editor.php:386
115
- msgid "Date Archives"
 
 
 
 
 
 
116
  msgstr ""
117
 
118
- #: inc/class-custom-sidebars-editor.php:427
 
119
  msgid "Post Index"
120
  msgstr ""
121
 
122
- #: inc/class-custom-sidebars-editor.php:431
123
  msgid "%1$s Archives"
124
  msgstr ""
125
 
126
- #: inc/class-custom-sidebars-editor.php:608
127
  msgid "Updated sidebar <strong>%1$s</strong> settings."
128
  msgstr ""
129
 
130
- #: inc/class-custom-sidebars-editor.php:644 views/widgets.php:17
131
  msgid "Sidebars"
132
  msgstr ""
133
 
134
- #: inc/class-custom-sidebars-editor.php:896 views/import.php:123
135
  #: views/widgets.php:47
136
  msgid "Custom Sidebars"
137
  msgstr ""
138
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  #: inc/class-custom-sidebars-export.php:61 views/widgets.php:46
140
  msgid "Import / Export Sidebars"
141
  msgstr ""
@@ -169,6 +193,38 @@ msgstr ""
169
  msgid "Imported %d widget(s)!"
170
  msgstr ""
171
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
172
  #: inc/class-custom-sidebars-visibility.php:196
173
  msgid "Visibility"
174
  msgstr ""
@@ -280,15 +336,15 @@ msgid ""
280
  "\t\t\t\t\t\tto disable accessibility mode and use the %1$s plugin!"
281
  msgstr ""
282
 
283
- #: inc/class-custom-sidebars.php:919 views/import.php:140
284
  msgid "Widgets"
285
  msgstr ""
286
 
287
- #: inc/class-custom-sidebars.php:929
288
  msgid "Support"
289
  msgstr ""
290
 
291
- #: inc/class-custom-sidebars.php:946
292
  msgid "Create a custom sidebar to get started."
293
  msgstr ""
294
 
@@ -419,7 +475,7 @@ msgid ""
419
  msgstr ""
420
 
421
  #: views/widgets-delete.php:16 views/widgets-editor.php:63
422
- #: views/widgets-location.php:186
423
  msgid "Cancel"
424
  msgstr ""
425
 
@@ -479,10 +535,6 @@ msgstr ""
479
  msgid "Export file"
480
  msgstr ""
481
 
482
- #: views/widgets-export.php:42
483
- msgid "Preview"
484
- msgstr ""
485
-
486
  #: views/widgets-location.php:30
487
  msgid "Replaced by another sidebar:"
488
  msgstr ""
@@ -495,53 +547,57 @@ msgstr ""
495
  msgid "Click here to pick available %1$s"
496
  msgstr ""
497
 
498
- #: views/widgets-location.php:95 views/widgets-location.php:136
 
 
 
 
499
  msgid "Click to toggle"
500
  msgstr ""
501
 
502
- #: views/widgets-location.php:96
503
  msgid "For all Single Entries matching selected criteria"
504
  msgstr ""
505
 
506
- #: views/widgets-location.php:99
507
  msgid ""
508
  "These replacements will be applied to every single post that matches a "
509
  "certain post type or category."
510
  msgstr ""
511
 
512
- #: views/widgets-location.php:107
513
  msgid "categories"
514
  msgstr ""
515
 
516
- #: views/widgets-location.php:119
517
  msgid "Post Types"
518
  msgstr ""
519
 
520
- #: views/widgets-location.php:137
521
  msgid "For Archives"
522
  msgstr ""
523
 
524
- #: views/widgets-location.php:140
525
  msgid "These replacements will be applied to Archive Type posts and pages."
526
  msgstr ""
527
 
528
- #: views/widgets-location.php:143 views/widgets-location.php:154
529
  msgid "Archive Types"
530
  msgstr ""
531
 
532
- #: views/widgets-location.php:144 views/widgets-location.php:165
533
  msgid "Category Archives"
534
  msgstr ""
535
 
536
- #: views/widgets-location.php:145
537
  msgid "Authors"
538
  msgstr ""
539
 
540
- #: views/widgets-location.php:176
541
  msgid "Author Archives"
542
  msgstr ""
543
 
544
- #: views/widgets-location.php:187 views/widgets.php:42
545
  msgid "Save Changes"
546
  msgstr ""
547
 
4
  msgstr ""
5
  "Project-Id-Version: Custom Sidebars Pro PLUGIN_VERSION\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/customsidebars\n"
7
+ "POT-Creation-Date: 2017-05-25 05:53:51+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
91
  msgid "Deleted sidebar <strong>%1$s</strong>"
92
  msgstr ""
93
 
94
+ #: inc/class-custom-sidebars-editor.php:385
95
  msgid "Front Page"
96
  msgstr ""
97
 
98
+ #: inc/class-custom-sidebars-editor.php:386
99
  msgid "Search Results"
100
  msgstr ""
101
 
102
+ #: inc/class-custom-sidebars-editor.php:387
103
+ #: inc/class-custom-sidebars-visibility.php:158
104
  msgid "Not found (404)"
105
  msgstr ""
106
 
107
+ #: inc/class-custom-sidebars-editor.php:388
108
  msgid "Any Author Archive"
109
  msgstr ""
110
 
111
+ #: inc/class-custom-sidebars-editor.php:389
112
+ msgid "Date Archives"
113
  msgstr ""
114
 
115
+ #: inc/class-custom-sidebars-editor.php:407
116
+ #: inc/class-custom-sidebars-editor.php:410
117
+ #: inc/class-custom-sidebars-editor.php:416
118
+ #: inc/class-custom-sidebars-editor.php:418
119
+ #: inc/class-custom-sidebars-editor.php:502
120
+ #: inc/class-custom-sidebars-editor.php:504
121
+ #: inc/class-custom-sidebars-editor.php:523
122
+ msgid "%s Archives"
123
  msgstr ""
124
 
125
+ #: inc/class-custom-sidebars-editor.php:465
126
+ #: inc/class-custom-sidebars-visibility.php:153
127
  msgid "Post Index"
128
  msgstr ""
129
 
130
+ #: inc/class-custom-sidebars-editor.php:469
131
  msgid "%1$s Archives"
132
  msgstr ""
133
 
134
+ #: inc/class-custom-sidebars-editor.php:724
135
  msgid "Updated sidebar <strong>%1$s</strong> settings."
136
  msgstr ""
137
 
138
+ #: inc/class-custom-sidebars-editor.php:760 views/widgets.php:17
139
  msgid "Sidebars"
140
  msgstr ""
141
 
142
+ #: inc/class-custom-sidebars-editor.php:1012 views/import.php:123
143
  #: views/widgets.php:47
144
  msgid "Custom Sidebars"
145
  msgstr ""
146
 
147
+ #: inc/class-custom-sidebars-explain.php:217
148
+ msgid "Turn on explanations"
149
+ msgstr ""
150
+
151
+ #: inc/class-custom-sidebars-explain.php:221
152
+ msgid "Turn on Custom Sidebars explain mode."
153
+ msgstr ""
154
+
155
+ #: inc/class-custom-sidebars-explain.php:226
156
+ msgid "Turn off explanations"
157
+ msgstr ""
158
+
159
+ #: inc/class-custom-sidebars-explain.php:228
160
+ msgid "Turn off Custom Sidebars explain mode."
161
+ msgstr ""
162
+
163
  #: inc/class-custom-sidebars-export.php:61 views/widgets.php:46
164
  msgid "Import / Export Sidebars"
165
  msgstr ""
193
  msgid "Imported %d widget(s)!"
194
  msgstr ""
195
 
196
+ #: inc/class-custom-sidebars-visibility.php:152
197
+ msgid "aFront Page"
198
+ msgstr ""
199
+
200
+ #: inc/class-custom-sidebars-visibility.php:154
201
+ msgid "Single page"
202
+ msgstr ""
203
+
204
+ #: inc/class-custom-sidebars-visibility.php:156
205
+ msgid "Archives"
206
+ msgstr ""
207
+
208
+ #: inc/class-custom-sidebars-visibility.php:157
209
+ msgid "Search results"
210
+ msgstr ""
211
+
212
+ #: inc/class-custom-sidebars-visibility.php:159 views/widgets-export.php:42
213
+ msgid "Preview"
214
+ msgstr ""
215
+
216
+ #: inc/class-custom-sidebars-visibility.php:160
217
+ msgid "Archive: Day"
218
+ msgstr ""
219
+
220
+ #: inc/class-custom-sidebars-visibility.php:161
221
+ msgid "Archive: Month"
222
+ msgstr ""
223
+
224
+ #: inc/class-custom-sidebars-visibility.php:162
225
+ msgid "Archive: Year"
226
+ msgstr ""
227
+
228
  #: inc/class-custom-sidebars-visibility.php:196
229
  msgid "Visibility"
230
  msgstr ""
336
  "\t\t\t\t\t\tto disable accessibility mode and use the %1$s plugin!"
337
  msgstr ""
338
 
339
+ #: inc/class-custom-sidebars.php:943 views/import.php:140
340
  msgid "Widgets"
341
  msgstr ""
342
 
343
+ #: inc/class-custom-sidebars.php:953
344
  msgid "Support"
345
  msgstr ""
346
 
347
+ #: inc/class-custom-sidebars.php:970
348
  msgid "Create a custom sidebar to get started."
349
  msgstr ""
350
 
475
  msgstr ""
476
 
477
  #: views/widgets-delete.php:16 views/widgets-editor.php:63
478
+ #: views/widgets-location.php:189
479
  msgid "Cancel"
480
  msgstr ""
481
 
535
  msgid "Export file"
536
  msgstr ""
537
 
 
 
 
 
538
  #: views/widgets-location.php:30
539
  msgid "Replaced by another sidebar:"
540
  msgstr ""
547
  msgid "Click here to pick available %1$s"
548
  msgstr ""
549
 
550
+ #: views/widgets-location.php:88
551
+ msgid "There are no replaceable sidebars. Please allow at least one as replaceable."
552
+ msgstr ""
553
+
554
+ #: views/widgets-location.php:98 views/widgets-location.php:139
555
  msgid "Click to toggle"
556
  msgstr ""
557
 
558
+ #: views/widgets-location.php:99
559
  msgid "For all Single Entries matching selected criteria"
560
  msgstr ""
561
 
562
+ #: views/widgets-location.php:102
563
  msgid ""
564
  "These replacements will be applied to every single post that matches a "
565
  "certain post type or category."
566
  msgstr ""
567
 
568
+ #: views/widgets-location.php:110
569
  msgid "categories"
570
  msgstr ""
571
 
572
+ #: views/widgets-location.php:122
573
  msgid "Post Types"
574
  msgstr ""
575
 
576
+ #: views/widgets-location.php:140
577
  msgid "For Archives"
578
  msgstr ""
579
 
580
+ #: views/widgets-location.php:143
581
  msgid "These replacements will be applied to Archive Type posts and pages."
582
  msgstr ""
583
 
584
+ #: views/widgets-location.php:146 views/widgets-location.php:157
585
  msgid "Archive Types"
586
  msgstr ""
587
 
588
+ #: views/widgets-location.php:147 views/widgets-location.php:168
589
  msgid "Category Archives"
590
  msgstr ""
591
 
592
+ #: views/widgets-location.php:148
593
  msgid "Authors"
594
  msgstr ""
595
 
596
+ #: views/widgets-location.php:179
597
  msgid "Author Archives"
598
  msgstr ""
599
 
600
+ #: views/widgets-location.php:190 views/widgets.php:42
601
  msgid "Save Changes"
602
  msgstr ""
603
 
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Custom Sidebars - Dynamic Widget Area Manager ===
2
  Contributors: WPMUDEV, marquex, WPMUDEV-Support2, WPMUDEV-Support1, WPMUDEV-Support6, WPMUDEV-Support4, iworks
3
  Tags: sidebar, widget, footer, custom, flexible layout, dynamic widgets, manage sidebars, replace widgets, custom widget area
4
- Requires at least: 3.3
5
- Tested up to: 4.7.4
6
- Stable tag: 3.0.6
7
 
8
  Flexible sidebars for custom widget configurations on every page, post and custom post type on your site.
9
 
@@ -120,10 +120,18 @@ If you are running a earlier version of WordPress download Custom Sidebars 0.8.2
120
 
121
  == Changelog ==
122
 
 
 
 
 
 
 
 
 
123
  = 3.0.6 =
124
  * Added width to "Custom Sidebars" column on entries list screen to avoid uncontrolled column width.
125
  * Added ability to add new sidebar using the only keyboard, after you fill name just push enter to move to the description field. Hit enter on description field to add a new sidebar.
126
- - Fixed "WPMUDEV Frash" module message for pro version.
127
 
128
  = 3.0.5 =
129
  * Improved columns display on post list screen - now "Custom Sidebars" column is hidden by default.
1
  === Custom Sidebars - Dynamic Widget Area Manager ===
2
  Contributors: WPMUDEV, marquex, WPMUDEV-Support2, WPMUDEV-Support1, WPMUDEV-Support6, WPMUDEV-Support4, iworks
3
  Tags: sidebar, widget, footer, custom, flexible layout, dynamic widgets, manage sidebars, replace widgets, custom widget area
4
+ Requires at least: 3.6
5
+ Tested up to: 4.7.5
6
+ Stable tag: 3.0.7
7
 
8
  Flexible sidebars for custom widget configurations on every page, post and custom post type on your site.
9
 
120
 
121
  == Changelog ==
122
 
123
+ 3.0.7
124
+ - Added ability to replace sidebars for category archive.
125
+ - Added ability to replace sidebars for custom taxonomy archive.
126
+ - Added ability to turn on Custom Sidebars Explain mode from Admin Bar.
127
+ - Fixed a replacement problem on 404 pages.
128
+ - Improved "Sidebar Location" popup - added a message when we do not have any replaceable sidebar.
129
+ - Refactored "Column Sidebars" on post list screen.
130
+
131
  = 3.0.6 =
132
  * Added width to "Custom Sidebars" column on entries list screen to avoid uncontrolled column width.
133
  * Added ability to add new sidebar using the only keyboard, after you fill name just push enter to move to the description field. Hit enter on description field to add a new sidebar.
134
+ * Fixed "WPMUDEV Frash" message for pro version.
135
 
136
  = 3.0.5 =
137
  * Improved columns display on post list screen - now "Custom Sidebars" column is hidden by default.
views/col-sidebars.php CHANGED
@@ -25,26 +25,31 @@ if ( $is_front || $is_blog ) {
25
  } else {
26
  global $wp_registered_sidebars;
27
  $available = CustomSidebars::sort_sidebars_by_name( $wp_registered_sidebars );
 
28
  foreach ( $sidebars as $s ) {
29
  $sb_name = $available[ $s ]['name'];
30
  $replaced = ! empty( $available[ $selected[ $s ] ] );
31
  $class = $replaced ? 'cust' : 'def';
32
 
33
- ?>
34
- <div class="<?php echo esc_attr( $class, 'custom-sidebars' ); ?>"
35
- data-sidebar="<?php echo esc_attr( $s ); ?>"
36
- data-replaced="<?php echo esc_attr( @$selected[ $s ] ); ?>">
37
- <small class="cs-key">
38
- <?php echo esc_html( $sb_name ); ?>
39
- </small>
40
- <span class="cs-val">
41
- <?php if ( $replaced ) : ?>
42
- <?php echo esc_html( $available[ $selected[ $s ] ]['name'] ); ?>
43
- <?php else : ?>
44
- -
45
- <?php endif; ?>
46
- </span>
47
- </div>
48
- <?php
 
 
 
 
49
  }
50
  }
25
  } else {
26
  global $wp_registered_sidebars;
27
  $available = CustomSidebars::sort_sidebars_by_name( $wp_registered_sidebars );
28
+ $content = '';
29
  foreach ( $sidebars as $s ) {
30
  $sb_name = $available[ $s ]['name'];
31
  $replaced = ! empty( $available[ $selected[ $s ] ] );
32
  $class = $replaced ? 'cust' : 'def';
33
 
34
+ if ( $replaced ) {
35
+ $content .= sprintf(
36
+ '<dt data-sidebar="%s" data-replaced="%s" class="cs-key %s">',
37
+ esc_attr( $s ),
38
+ isset( $selected[ $s ] )? esc_attr( $selected[ $s ] ):'',
39
+ esc_attr( $class, 'custom-sidebars' )
40
+ );
41
+ $content .= esc_html( $sb_name );
42
+ $content .= '</dt>';
43
+ $content .= '<dd class="cs-val">';
44
+ $content .= esc_html( $available[ $selected[ $s ] ]['name'] );
45
+ $content .= '</dd>';
46
+ }
47
+ }
48
+ if ( empty( $content ) ) {
49
+ echo '-';
50
+ } else {
51
+ echo '<dl>';
52
+ echo $content;
53
+ echo '</dl>';
54
  }
55
  }
views/widgets-location.php CHANGED
@@ -69,7 +69,7 @@ function _show_replaceable( $sidebar, $prefix, $cat_name, $class = '' ) {
69
  <span class="sb-name">...</span>
70
  </h3>
71
  </div>
72
- <p>
73
  <i class="dashicons dashicons-info light"></i>
74
  <?php
75
  printf(
@@ -84,6 +84,9 @@ function _show_replaceable( $sidebar, $prefix, $cat_name, $class = '' ) {
84
  ?>
85
  </p>
86
 
 
 
 
87
  <?php
88
  /**
89
  * =========================================================================
69
  <span class="sb-name">...</span>
70
  </h3>
71
  </div>
72
+ <p class="message unique-post">
73
  <i class="dashicons dashicons-info light"></i>
74
  <?php
75
  printf(
84
  ?>
85
  </p>
86
 
87
+ <div class="hidden">
88
+ <p class="message no-sidebars"><?php _e( 'There are no replaceable sidebars. Please allow at least one as replaceable.', 'custom-sidebars' ); ?></p>
89
+ </div>
90
  <?php
91
  /**
92
  * =========================================================================