Version Description
- Fix: Astra Social Profile: Repeater field not showing in widget block editor. ( https://wpastra.com/docs/resolving-repeater-fields-not-working-in-widget-block-editor/ )
- Fix: Astra List Icons: Repeater field not showing in widget block editor.
- Fix: Displaying double Color options when more than one widgets added.
Download this release
Release Info
Developer | brainstormworg |
Plugin | Astra Widgets |
Version | 1.2.10 |
Comparing to | |
See all releases |
Code changes from version 1.2.9 to 1.2.10
- assets/css/minified/astra-widgets-admin-rtl.min.css +1 -1
- assets/css/minified/astra-widgets-admin.min.css +1 -1
- assets/css/unminified/astra-widgets-admin-rtl.css +10 -0
- assets/css/unminified/astra-widgets-admin.css +10 -0
- assets/js/minified/astra-widgets-backend.min.js +1 -1
- assets/js/unminified/astra-widgets-backend.js +1 -1
- astra-widgets.php +2 -2
- classes/class-astra-widgets-helper.php +40 -11
- classes/widgets/class-astra-widget-list-icons.php +23 -2
- classes/widgets/class-astra-widget-social-profiles.php +22 -1
- readme.txt +7 -2
assets/css/minified/astra-widgets-admin-rtl.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.wp-core-ui .next-field-image .next-select-image{padding:4px 0;width:100%;text-align:center;height:auto}.astra-repeater-field{cursor:move;border-bottom:1px solid #eee}.astra-repeater-field:last-child{border-bottom:none}.astra-repeater-field .dashicons{font-size:1rem;height:1rem;width:1rem;color:#c1c1c1}.astra-repeater-field .dashicons-admin-page.clone{margin-left:.3em}.astra-repeater-container{margin-bottom:1em}.astra-repeater-field label{margin-bottom:.5em;display:inline-block}.astra-repeater .markukp p{margin:1em 0}.astra-repeater .add-new{margin-bottom:1em}.astra-repeater-field .clone,.astra-repeater-field .remove{cursor:pointer}.astra-repeater-field .actions{padding:10px;background:#f6f6f6;text-align:left}.astra-repeater-field .markukp{display:none}.astra-repeater-field .actions .dashicons-move,.astra-repeater-field .actions .title{float:right}.astra-repeater-field .actions .title{margin-right:.5em}.astra-repeater-field .index{display:none}.astra-field-image .astra-remove-image{position:absolute;background:0 0;border:none;-webkit-box-shadow:none;box-shadow:none;color:#ca4a20;top:.6em;right:11em;color:#aaa;font-size:11px;-webkit-transition:all .25s ease;transition:all .25s ease}.astra-field-image .astra-remove-image:hover{outline:0;background:0 0;-webkit-box-shadow:none;box-shadow:none;color:#ca4a20}.astra-field-image-preview{position:relative}.astra-field-image{-js-display:flex;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.astra-field-image .astra-select-image{display:block;color:#666;text-shadow:0 1px 0 #fff;font-weight:600;font-size:11px;cursor:pointer;border:1px solid #bbb;height:8px;padding:14px 5px;line-height:8px;background:#f9f9f9;background:-webkit-gradient(linear,right bottom,right top,color-stop(0,#f2f2f2),color-stop(1,#f9f9f9));background:-o-linear-gradient(#f9f9f9,#f2f2f2);-webkit-box-shadow:0 1px 2px rgba(0,0,0,.1);box-shadow:0 1px 2px rgba(0,0,0,.1);-webkit-border-top-left-radius:3px;-moz-border-top-left-radius:3px;border-top-left-radius:3px;-webkit-border-bottom-left-radius:3px;-moz-border-bottom-left-radius:3px;border-bottom-left-radius:3px;border:1px solid #bbb}.astra-field-image .astra-select-image:hover{background:rgba(255,255,255,.75)}.astra-field-image-preview img{border-width:1px 1px 1px 0;border-color:#bbb;border-style:solid;line-height:0;-webkit-box-shadow:0 1px 1px #fff;box-shadow:0 1px 1px #fff;width:25px;height:25px;padding:5.5px;-webkit-box-shadow:inset 0 1px 3px rgba(0,0,0,.2);box-shadow:inset 0 1px 3px rgba(0,0,0,.2)}.astra-field-image-preview{background:#f9f9f9;background:-webkit-gradient(linear,right bottom,right top,color-stop(0,#f2f2f2),color-stop(1,#f9f9f9));background:-o-linear-gradient(#f9f9f9,#f2f2f2);-webkit-box-shadow:0 1px 2px rgba(0,0,0,.1);box-shadow:0 1px 2px rgba(0,0,0,.1);-webkit-border-top-right-radius:3px;-moz-border-top-right-radius:3px;border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;-moz-border-bottom-right-radius:3px;border-bottom-right-radius:3px;line-height:10px}.astra-field-image img{max-width:100%}.astra-field-image-title{margin-bottom:1em}.astra-icons-list-wrap{display:none}.astra-selected-icon{display:inline-block;margin-left:.5em}.astra-icons-list-wrap .search-icon{width:100%;margin-bottom:1em}.astra-widget-icons-list .astra-widget-icon{display:inline-block;float:right;cursor:pointer;height:1em;padding:1em;width:27px;line-height:1em;font-size:1em;border:1px solid #f1f1f1;margin:0;text-align:center}.astra-widget-icons-list{display:inline-block;margin:1em 0 0 0;padding:0}.astra-widget-icon-selector{margin:1em 0}.astra-widget-field{margin:1em 0}.astra-widget-field label{margin-bottom:.5em;display:block}.astra-widget-field-checkbox label{display:inline-block}.astra-widget-field-heading label{font-weight:700}.astra-widget-field-color .wp-color-result{margin-bottom:0!important}
|
1 |
+
.wp-core-ui .next-field-image .next-select-image{padding:4px 0;width:100%;text-align:center;height:auto}.astra-repeater-field{cursor:move;border-bottom:1px solid #eee}.astra-repeater-field:last-child{border-bottom:none}.astra-repeater-field .dashicons{font-size:1rem;height:1rem;width:1rem;color:#c1c1c1}.astra-repeater-field .dashicons-admin-page.clone{margin-left:.3em}.astra-repeater-container{margin-bottom:1em}.astra-repeater-field label{margin-bottom:.5em;display:inline-block}.astra-repeater .markukp p{margin:1em 0}.astra-repeater .add-new{margin-bottom:1em}.astra-repeater-field .clone,.astra-repeater-field .remove{cursor:pointer}.astra-repeater-field .actions{padding:10px;background:#f6f6f6;text-align:left}.astra-repeater-field .markukp{display:none}.astra-repeater-field .actions .dashicons-move,.astra-repeater-field .actions .title{float:right}.astra-repeater-field .actions .title{margin-right:.5em}.astra-repeater-field .index{display:none}.astra-field-image .astra-remove-image{position:absolute;background:0 0;border:none;-webkit-box-shadow:none;box-shadow:none;color:#ca4a20;top:.6em;right:11em;color:#aaa;font-size:11px;-webkit-transition:all .25s ease;transition:all .25s ease}.astra-field-image .astra-remove-image:hover{outline:0;background:0 0;-webkit-box-shadow:none;box-shadow:none;color:#ca4a20}.astra-field-image-preview{position:relative}.astra-field-image{-js-display:flex;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.astra-field-image .astra-select-image{display:block;color:#666;text-shadow:0 1px 0 #fff;font-weight:600;font-size:11px;cursor:pointer;border:1px solid #bbb;height:8px;padding:14px 5px;line-height:8px;background:#f9f9f9;background:-webkit-gradient(linear,right bottom,right top,color-stop(0,#f2f2f2),color-stop(1,#f9f9f9));background:-o-linear-gradient(#f9f9f9,#f2f2f2);-webkit-box-shadow:0 1px 2px rgba(0,0,0,.1);box-shadow:0 1px 2px rgba(0,0,0,.1);-webkit-border-top-left-radius:3px;-moz-border-top-left-radius:3px;border-top-left-radius:3px;-webkit-border-bottom-left-radius:3px;-moz-border-bottom-left-radius:3px;border-bottom-left-radius:3px;border:1px solid #bbb}.astra-field-image .astra-select-image:hover{background:rgba(255,255,255,.75)}.astra-field-image-preview img{border-width:1px 1px 1px 0;border-color:#bbb;border-style:solid;line-height:0;-webkit-box-shadow:0 1px 1px #fff;box-shadow:0 1px 1px #fff;width:25px;height:25px;padding:5.5px;-webkit-box-shadow:inset 0 1px 3px rgba(0,0,0,.2);box-shadow:inset 0 1px 3px rgba(0,0,0,.2)}.astra-field-image-preview{background:#f9f9f9;background:-webkit-gradient(linear,right bottom,right top,color-stop(0,#f2f2f2),color-stop(1,#f9f9f9));background:-o-linear-gradient(#f9f9f9,#f2f2f2);-webkit-box-shadow:0 1px 2px rgba(0,0,0,.1);box-shadow:0 1px 2px rgba(0,0,0,.1);-webkit-border-top-right-radius:3px;-moz-border-top-right-radius:3px;border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;-moz-border-bottom-right-radius:3px;border-bottom-right-radius:3px;line-height:10px}.astra-field-image img{max-width:100%}.astra-field-image-title{margin-bottom:1em}.astra-icons-list-wrap{display:none}.astra-selected-icon{display:inline-block;margin-left:.5em}.astra-icons-list-wrap .search-icon{width:100%;margin-bottom:1em}.astra-widget-icons-list .astra-widget-icon{display:inline-block;float:right;cursor:pointer;height:1em;padding:1em;width:27px;line-height:1em;font-size:1em;border:1px solid #f1f1f1;margin:0;text-align:center}.astra-widget-icons-list{display:inline-block;margin:1em 0 0 0;padding:0}.astra-widget-icon-selector{margin:1em 0}.astra-widget-field{margin:1em 0}.astra-widget-field label{margin-bottom:.5em;display:block}.astra-widget-field-checkbox label{display:inline-block}.astra-widget-field-heading label{font-weight:700}.astra-widget-field-color .wp-color-result{margin-bottom:0!important}.widgets-php .astra-widget-field-notice.notice {display: block !important;}.astra-widget-field-notice.notice {font-size: 15px;}
|
assets/css/minified/astra-widgets-admin.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.wp-core-ui .next-field-image .next-select-image{padding:4px 0;width:100%;text-align:center;height:auto}.astra-repeater-field{cursor:move;border-bottom:1px solid #eee}.astra-repeater-field:last-child{border-bottom:none}.astra-repeater-field .dashicons{font-size:1rem;height:1rem;width:1rem;color:#c1c1c1}.astra-repeater-field .dashicons-admin-page.clone{margin-right:.3em}.astra-repeater-container{margin-bottom:1em}.astra-repeater-field label{margin-bottom:.5em;display:inline-block}.astra-repeater .markukp p{margin:1em 0}.astra-repeater .add-new{margin-bottom:1em}.astra-repeater-field .clone,.astra-repeater-field .remove{cursor:pointer}.astra-repeater-field .actions{padding:10px;background:#fafafa;text-align:right}.astra-repeater-field .markukp{display:none}.astra-repeater-field .actions .dashicons-move,.astra-repeater-field .actions .title{float:left}.astra-repeater-field .actions .title{margin-left:.5em}.astra-repeater-field .index{display:none}.astra-repeater-field span.title:before{font-size:.9em;margin-right:.5em}.astra-field-image .astra-remove-image{position:absolute;background:0 0;border:none;box-shadow:none;top:.6em;left:4em;color:#a00;font-size:13px;text-decoration:underline;transition:all .25s ease}.astra-field-image .astra-remove-image:hover{outline:0;background:0 0;box-shadow:none;color:#dc3232}.astra-field-image-preview{position:relative}.astra-field-image{-js-display:flex;display:flex}.astra-field-image-preview img{border-width:1px 0 1px 1px;border-color:#bbb;border-style:solid;line-height:0;box-shadow:0 1px 1px #fff;width:40px;height:40px;padding:5.5px;box-shadow:inset 0 1px 3px rgba(0,0,0,.2)}.astra-field-image-preview{background:#f9f9f9;background:-o-linear-gradient(#f9f9f9,#f2f2f2);box-shadow:0 1px 2px rgba(0,0,0,.1);-moz-border-top-left-radius:3px;border-top-left-radius:3px;-moz-border-bottom-left-radius:3px;border-bottom-left-radius:3px;line-height:10px}.astra-field-image img{max-width:100%}.astra-field-image-title{margin-bottom:1em}.astra-icons-list-wrap{display:none}.astra-selected-icon{display:inline-block}.astra-icons-list-wrap .search-icon{width:100%;margin-top:1em;margin-bottom:1em}.astra-widget-icons-list .astra-widget-icon{-js-display:flex;display:flex;align-items:center;justify-content:center;float:left;cursor:pointer;padding:1em;box-sizing:content-box;width:30px;line-height:1em;font-size:1em;border:1px solid #f1f1f1;margin:0;text-align:center}.block-editor-block-list__block .astra-widget-icons-list .astra-widget-icon{width:20px}.astra-widget-icons-list{display:inline-block;margin:1em 0 0 0;padding:0;max-height:250px;overflow:auto}.astra-widget-icon-selector{margin:1em 0}.astra-widget-field{margin:1em 0}.astra-widget-field label,.astra-widget-field+p label{margin-bottom:.5em;display:block}.astra-widget-field .wp-picker-input-wrap label{display:inline-block}.astra-widget-field-checkbox label{display:inline-block}.astra-widget-field-heading label{font-weight:700}.astra-widget-field .wp-picker-input-wrap .wp-picker-clear{min-height:30px;margin-left:6px}.astra-widget-field-color .wp-color-result{margin-bottom:0!important}.astra-widget-icon svg{width:20px;height:20px}.astra-selected-icon svg{width:15px;height:15px;vertical-align:middle;margin-top:-1px}.astra-widget-icon.selected{background:#5897fb}.astra-widget-icon.selected svg{fill:#fff}.astra-widget-unit-field .widefat{width:91%}.astra-widgets-unit{margin-left:5px}.astra-repeater-field .markukp{padding:10px;border-top:1px solid #e5e5e5}.astra-repeater-sortable .astra-repeater-field{border:1px solid #e5e5e5;background:#fff;margin-bottom:5px}.astra-repeater-field.field-open .actions .toggle-arrow:before{content:"\f142"}.astra-repeater-field .actions .toggle-arrow:before{content:"\f140"}.astra-repeater-field .actions .toggle-arrow{display:inline-block;margin-top:-3px;font-size:1.6rem;width:1.6rem;color:silver}.astra-repeater-field title{line-height:1.4em}
|
1 |
+
.wp-core-ui .next-field-image .next-select-image{padding:4px 0;width:100%;text-align:center;height:auto}.astra-repeater-field{cursor:move;border-bottom:1px solid #eee}.astra-repeater-field:last-child{border-bottom:none}.astra-repeater-field .dashicons{font-size:1rem;height:1rem;width:1rem;color:#c1c1c1}.astra-repeater-field .dashicons-admin-page.clone{margin-right:.3em}.astra-repeater-container{margin-bottom:1em}.astra-repeater-field label{margin-bottom:.5em;display:inline-block}.astra-repeater .markukp p{margin:1em 0}.astra-repeater .add-new{margin-bottom:1em}.astra-repeater-field .clone,.astra-repeater-field .remove{cursor:pointer}.astra-repeater-field .actions{padding:10px;background:#fafafa;text-align:right}.astra-repeater-field .markukp{display:none}.astra-repeater-field .actions .dashicons-move,.astra-repeater-field .actions .title{float:left}.astra-repeater-field .actions .title{margin-left:.5em}.astra-repeater-field .index{display:none}.astra-repeater-field span.title:before{font-size:.9em;margin-right:.5em}.astra-field-image .astra-remove-image{position:absolute;background:0 0;border:none;box-shadow:none;top:.6em;left:4em;color:#a00;font-size:13px;text-decoration:underline;transition:all .25s ease}.astra-field-image .astra-remove-image:hover{outline:0;background:0 0;box-shadow:none;color:#dc3232}.astra-field-image-preview{position:relative}.astra-field-image{-js-display:flex;display:flex}.astra-field-image-preview img{border-width:1px 0 1px 1px;border-color:#bbb;border-style:solid;line-height:0;box-shadow:0 1px 1px #fff;width:40px;height:40px;padding:5.5px;box-shadow:inset 0 1px 3px rgba(0,0,0,.2)}.astra-field-image-preview{background:#f9f9f9;background:-o-linear-gradient(#f9f9f9,#f2f2f2);box-shadow:0 1px 2px rgba(0,0,0,.1);-moz-border-top-left-radius:3px;border-top-left-radius:3px;-moz-border-bottom-left-radius:3px;border-bottom-left-radius:3px;line-height:10px}.astra-field-image img{max-width:100%}.astra-field-image-title{margin-bottom:1em}.astra-icons-list-wrap{display:none}.astra-selected-icon{display:inline-block}.astra-icons-list-wrap .search-icon{width:100%;margin-top:1em;margin-bottom:1em}.astra-widget-icons-list .astra-widget-icon{-js-display:flex;display:flex;align-items:center;justify-content:center;float:left;cursor:pointer;padding:1em;box-sizing:content-box;width:30px;line-height:1em;font-size:1em;border:1px solid #f1f1f1;margin:0;text-align:center}.block-editor-block-list__block .astra-widget-icons-list .astra-widget-icon{width:20px}.astra-widget-icons-list{display:inline-block;margin:1em 0 0 0;padding:0;max-height:250px;overflow:auto}.astra-widget-icon-selector{margin:1em 0}.astra-widget-field{margin:1em 0}.astra-widget-field label,.astra-widget-field+p label{margin-bottom:.5em;display:block}.astra-widget-field .wp-picker-input-wrap label{display:inline-block}.astra-widget-field-checkbox label{display:inline-block}.astra-widget-field-heading label{font-weight:700}.astra-widget-field .wp-picker-input-wrap .wp-picker-clear{min-height:30px;margin-left:6px}.astra-widget-field-color .wp-color-result{margin-bottom:0!important}.astra-widget-icon svg{width:20px;height:20px}.astra-selected-icon svg{width:15px;height:15px;vertical-align:middle;margin-top:-1px}.astra-widget-icon.selected{background:#5897fb}.astra-widget-icon.selected svg{fill:#fff}.astra-widget-unit-field .widefat{width:91%}.astra-widgets-unit{margin-left:5px}.astra-repeater-field .markukp{padding:10px;border-top:1px solid #e5e5e5}.astra-repeater-sortable .astra-repeater-field{border:1px solid #e5e5e5;background:#fff;margin-bottom:5px}.astra-repeater-field.field-open .actions .toggle-arrow:before{content:"\f142"}.astra-repeater-field .actions .toggle-arrow:before{content:"\f140"}.astra-repeater-field .actions .toggle-arrow{display:inline-block;margin-top:-3px;font-size:1.6rem;width:1.6rem;color:silver}.astra-repeater-field title{line-height:1.4em}.widgets-php .astra-widget-field-notice.notice {display: block !important;}.astra-widget-field-notice.notice {font-size: 15px;}
|
assets/css/unminified/astra-widgets-admin-rtl.css
CHANGED
@@ -278,3 +278,13 @@
|
|
278 |
.astra-repeater-field title {
|
279 |
line-height: 1.4em;
|
280 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
278 |
.astra-repeater-field title {
|
279 |
line-height: 1.4em;
|
280 |
}
|
281 |
+
|
282 |
+
/**
|
283 |
+
* Notice field
|
284 |
+
*/
|
285 |
+
.widgets-php .astra-widget-field-notice.notice {
|
286 |
+
display: block !important;
|
287 |
+
}
|
288 |
+
.astra-widget-field-notice.notice {
|
289 |
+
font-size: 15px;
|
290 |
+
}
|
assets/css/unminified/astra-widgets-admin.css
CHANGED
@@ -278,3 +278,13 @@
|
|
278 |
.astra-repeater-field title {
|
279 |
line-height: 1.4em;
|
280 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
278 |
.astra-repeater-field title {
|
279 |
line-height: 1.4em;
|
280 |
}
|
281 |
+
|
282 |
+
/**
|
283 |
+
* Notice field
|
284 |
+
*/
|
285 |
+
.widgets-php .astra-widget-field-notice.notice {
|
286 |
+
display: block !important;
|
287 |
+
}
|
288 |
+
.astra-widget-field-notice.notice {
|
289 |
+
font-size: 15px;
|
290 |
+
}
|
assets/js/minified/astra-widgets-backend.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(l){AstraWidgets={init:function(){this._init_colorpicker(),this._init_repeater(),this._getMarkup(),this._bind()},_init_colorpicker:function(){l(".astra-widget-field-color input").not('[id*="__i__"]').wpColorPicker({change:function(e,t){l(e.target).val(t.color.toString()),l(e.target).trigger("change")}})},_bind:function(){l(document).on("widget-updated widget-added",AstraWidgets._reinit_controls),l(document).on("click",".astra-select-icon",AstraWidgets._icon_selector),l(document).on("click",".astra-widget-icon",AstraWidgets._set_icon),l(document).on("click",".astra-repeater-sortable .clone",AstraWidgets._repeater_clone),l(document).on("click",".astra-repeater-sortable .remove",AstraWidgets._repeater_remove),l(document).on("click",".astra-repeater-field .actions",AstraWidgets._repeater_toggle_open),l(document).on("click",".astra-repeater .add-new-btn",AstraWidgets._add_new),l(document).on("click",".widget-control-save",AstraWidgets._repeater_reinit),l(document).on("click",".astra-repeater-field .astra-select-image",AstraWidgets._repeater_add_image_field),l(document).on("click",".astra-repeater-field .astra-remove-image",AstraWidgets._repeater_remove_image_field),l(document).on("input",'.astra-repeater-field [data-field-id="title"]',AstraWidgets._repeater_set_title),l(document).on("keyup",".astra-repeater-field .search-icon",AstraWidgets._searchFuntionality),l(document).on("click",".astra-repeater-field .astra-select-icon",AstraWidgets._showIconsMarkup)},_reinit_controls:function(){AstraWidgets._init_colorpicker(),AstraWidgets._init_repeater()},_getMarkup:function(){var e,t,a,s,i,r=fontAwesomeIcons.font_awesome,n='<input type="search" placeholder="Search icon..." class="search-icon">';for(e in n+='<ul class="astra-widget-icons-list">',r)r.hasOwnProperty(e)&&(i=((t=r[e]).svg.hasOwnProperty("brands")?t.svg.brands:t.svg.solid).viewBox,a=(t.svg.hasOwnProperty("brands")?t.svg.brands:t.svg.solid).path,s=i.join(" "),i=t.search.terms.join(" "),t.search.terms.push(e),t.search.terms.push(t.styles[0]),n+='<li class="astra-widget-icon '+e+'" data-search-terms="'+i+'" data-font="'+e+'" data-viewbox="'+s+'" data-path="'+a+'">',n+='<svg xmlns="http://www.w3.org/2000/svg" viewBox="'+s+'"><path d="'+a+'"></path></svg>',n+="</li>");return n+="</ul>"},_showIconsMarkup:function(){font_awesome_markup=AstraWidgets._getMarkup(),l(this).hasClass("open")?l(this).parents(".astra-widget-icon-selector").find(".astra-icons-list-wrap").append(font_awesome_markup):(l(this).parents(".astra-widget-icon-selector").find(".astra-widget-icons-list").remove(),l(this).parents(".astra-widget-icon-selector").find(".search-icon").remove())},_icon_selector:function(e){l(this).parents(".astra-widget-icon-selector").find(".astra-icons-list-wrap").slideToggle(),l(this).toggleClass("open")},_set_icon:function(e){var t=l(this).parents(".astra-widget-icon-selector"),a=l(this).attr("data-font")||"",s=t.find(".astra-widget-icon."+a),i=t.find(".astra-selected-icon"),r=t.find(".selected-icon"),n=l(this).attr("data-path"),
|
1 |
+
!function(l){AstraWidgets={init:function(){this._init_colorpicker(),this._init_repeater(),this._getMarkup(),this._bind()},_init_colorpicker:function(){l(".astra-widget-field-color .astra-widget-color > input").not('[id*="__i__"]').wpColorPicker({change:function(e,t){l(e.target).val(t.color.toString()),l(e.target).trigger("change")}})},_bind:function(){l(document).on("widget-updated widget-added",AstraWidgets._reinit_controls),l(document).on("click",".astra-select-icon",AstraWidgets._icon_selector),l(document).on("click",".astra-widget-icon",AstraWidgets._set_icon),l(document).on("click",".astra-repeater-sortable .clone",AstraWidgets._repeater_clone),l(document).on("click",".astra-repeater-sortable .remove",AstraWidgets._repeater_remove),l(document).on("click",".astra-repeater-field .actions",AstraWidgets._repeater_toggle_open),l(document).on("click",".astra-repeater .add-new-btn",AstraWidgets._add_new),l(document).on("click",".widget-control-save",AstraWidgets._repeater_reinit),l(document).on("click",".astra-repeater-field .astra-select-image",AstraWidgets._repeater_add_image_field),l(document).on("click",".astra-repeater-field .astra-remove-image",AstraWidgets._repeater_remove_image_field),l(document).on("input",'.astra-repeater-field [data-field-id="title"]',AstraWidgets._repeater_set_title),l(document).on("keyup",".astra-repeater-field .search-icon",AstraWidgets._searchFuntionality),l(document).on("click",".astra-repeater-field .astra-select-icon",AstraWidgets._showIconsMarkup)},_reinit_controls:function(){AstraWidgets._init_colorpicker(),AstraWidgets._init_repeater()},_getMarkup:function(){var e,t,a,s,i,r=fontAwesomeIcons.font_awesome,n='<input type="search" placeholder="Search icon..." class="search-icon">';for(e in n+='<ul class="astra-widget-icons-list">',r)r.hasOwnProperty(e)&&(i=((t=r[e]).svg.hasOwnProperty("brands")?t.svg.brands:t.svg.solid).viewBox,a=(t.svg.hasOwnProperty("brands")?t.svg.brands:t.svg.solid).path,s=i.join(" "),i=t.search.terms.join(" "),t.search.terms.push(e),t.search.terms.push(t.styles[0]),n+='<li class="astra-widget-icon '+e+'" data-search-terms="'+i+'" data-font="'+e+'" data-viewbox="'+s+'" data-path="'+a+'">',n+='<svg xmlns="http://www.w3.org/2000/svg" viewBox="'+s+'"><path d="'+a+'"></path></svg>',n+="</li>");return n+="</ul>"},_showIconsMarkup:function(){font_awesome_markup=AstraWidgets._getMarkup(),l(this).hasClass("open")?l(this).parents(".astra-widget-icon-selector").find(".astra-icons-list-wrap").append(font_awesome_markup):(l(this).parents(".astra-widget-icon-selector").find(".astra-widget-icons-list").remove(),l(this).parents(".astra-widget-icon-selector").find(".search-icon").remove())},_icon_selector:function(e){l(this).parents(".astra-widget-icon-selector").find(".astra-icons-list-wrap").slideToggle(),l(this).toggleClass("open")},_set_icon:function(e){var t=l(this).parents(".astra-widget-icon-selector"),a=l(this).attr("data-font")||"",s=t.find(".astra-widget-icon."+a),i=t.find(".astra-selected-icon"),r=t.find(".selected-icon"),n=l(this).attr("data-path"),o=l(this).attr("data-viewbox"),d=s.html();i.html(d),t.find(".astra-widget-icons-list .astra-widget-icon").removeClass("selected"),s.addClass("selected"),"yes"===l(this).closest(".astra-repeater-field").find(".selected-icon").data("icon-visible")&&(l(this).closest(".astra-repeater-field").find(".title").attr("class","title"),l(this).closest(".astra-repeater-field").find(".title").addClass(a)),iconObj={name:a,path:n,viewbox:o};o=JSON.stringify(iconObj);r.val(o),t.find(".selected-icon").trigger("change")},_searchFuntionality:function(){var e,t,a=this.value.toUpperCase(),s=l(this).parents(".astra-icons-list-wrap").find(".astra-widget-icons-list")[0];setTimeout(function(){for(e=s.getElementsByTagName("li"),t=0;t<e.length;t++)search=l(e[t]).data("search-terms"),search&&(-1<search.toUpperCase().indexOf(a)?e[t].style.display="":e[t].style.display="none")},300)},_repeater_remove_image_field:function(e){var t;confirm("Do you want to remove this image?")&&((t=l(this).parents(".astra-repeater-field")).find(".astra-field-image-preview").html(""),t.find(".astra-field-image-preview img").attr("src",""),t.find(".astra-field-image-preview-id").val(""),t.find(".astra-image-url").val(""),t.find(".astra-image-alt").val(""),t.find(".astra-image-title").val(""),t.find(".astra-image-size-select, .astra-image-width").hide(),t.find(".astra-select-image.button").css("display","inline-block"))},_repeater_add_image_field:function(e){var a=l(this).parents(".astra-repeater-field"),s=wp.media({title:"Select or Upload Image",button:{text:"Choose Image"},library:{type:"image"},multiple:!1});return s.on("close",function(){var e,t=s.state().get("selection").toJSON();l.isEmptyObject(t)||(e=(t[0].sizes.hasOwnProperty("medium")?t[0].sizes.medium:t[0].sizes.hasOwnProperty("thumbnail")?t[0].sizes.thumbnail:t[0].sizes.full).url,0<a.find(".astra-remove-image").length?a.find(".astra-field-image-preview img").attr("src",e):a.find(".astra-field-image-preview").append('<img src="'+e+'" /><span class="astra-remove-image button">Remove</span>'),a.find(".astra-image-url").val(t[0].url),a.find(".astra-image-alt").val(t[0].alt),a.find(".astra-image-title").val(t[0].title),a.find(".astra-field-image-preview-id").val(t[0].id),a.find(".astra-select-image.button").css("display","none"),a.find(".astra-image-size-select, .astra-image-width").show(),a.find("input").trigger("change"))}),s.open(),!1},_get_sub_string:function(e){var t="";return 24<e.length&&(t=".."),e=e.substring(0,24)+t},_repeater_set_title:function(e){var t=l(this).val()||"",t=AstraWidgets._get_sub_string(t);l(this).closest(".astra-repeater-field").find(".title").text(t)},_repeater_reinit:function(e){l(".astra-repeater-sortable").sortable()},_add_new:function(e){e.preventDefault();var t=l(this).closest(".astra-repeater"),a=l(".astra-repeater-field").length||0,s=t.find(".astra-repeater-fields").html(),i=t.find(".astra-repeater-fields").attr("title")||"",e=(t.find(".astra-repeater-fields").attr("data-id"),'<div class="astra-repeater-field">');e+='\t<div class="actions">',e+='\t<span class="index">'+a+"</span>",e+='\t\t<span class="dashicons dashicons-move"></span>',e+='\t<span class="title">'+i+"</span>",e+='\t\t<span class="dashicons dashicons-admin-page clone"></span>',e+='\t\t<span class="dashicons dashicons-trash remove"></span>',e+='\t\t<span class="dashicons toggle-arrow"></span>',e+="\t</div>",e+='\t<div class="markukp">',e+=s=s.replace("][][","]["+a+"]["),e+="\t</div>",e+="</div>",t.find(".astra-repeater-sortable").append(e),AstraWidgets._set_repeater_names()},_set_repeater_names:function(){l(".astra-repeater").each(function(e,t){var r=l(t).find(".astra-repeater-fields").attr("data-id")||"";l(t).find(".astra-repeater-sortable").find(".astra-repeater-field").each(function(s,i){l(i).find(":input").each(function(e,t){var a=l(t).attr("data-field-id")||"",a=r+"["+s+"]["+a+"]";l(i).find(".index").text(s),l(t).attr("name",a)})})})},_repeater_toggle_open:function(e){e.preventDefault(),(e.target===this||l(e.target).hasClass("title")||l(e.target).hasClass("dashicons-move"))&&(l(this).parents(".astra-repeater-field").toggleClass("field-open"),l(this).parents(".astra-repeater-field").find(".markukp").slideToggle())},_repeater_clone:function(e){e.preventDefault();var t=l(this),e=t.closest(".astra-repeater");e.find(".astra-repeater-fields").html();l(t).closest(".astra-repeater-field").clone().insertAfter(t.closest(".astra-repeater-field")),l(".astra-repeater-sortable").sortable(),e.find("input").trigger("change"),AstraWidgets._set_repeater_names()},_repeater_remove:function(e){e.preventDefault();var t=l(this),a=t.closest(".astra-repeater"),s=t.parent().find(".title").html(),e="",e=0<s.length?s:"this field";confirm("Are you sure you want to delete "+e+"?")&&t.closest(".astra-repeater-field").remove(),AstraWidgets._set_repeater_names(),a.find("input").trigger("change")},_init_repeater:function(){l(".astra-repeater-sortable").sortable({cursor:"move",stop:function(e,t){AstraWidgets._set_repeater_names(),t.item.find("input").trigger("change")}}),AstraWidgets._set_repeater_names(),l(".astra-repeater-field").length&&l(".astra-repeater-field").each(function(e,t){var a=l(t).find('[data-field-id="title"]').val()||"",s=l(t).find('[data-field-id="icon"]').val()||"",a=AstraWidgets._get_sub_string(a);l(t).find(".title").text(a),"yes"===l(t).find(".selected-icon").data("icon-visible")&&l(t).find(".title").addClass(s)})}},l(function(){AstraWidgets.init()})}(jQuery);
|
assets/js/unminified/astra-widgets-backend.js
CHANGED
@@ -13,7 +13,7 @@
|
|
13 |
this._bind();
|
14 |
},
|
15 |
_init_colorpicker: function() {
|
16 |
-
$('.astra-widget-field-color input').not('[id*="__i__"]').wpColorPicker({
|
17 |
change: function (event, ui) {
|
18 |
$( event.target ).val( ui.color.toString() );
|
19 |
$( event.target ).trigger('change');
|
13 |
this._bind();
|
14 |
},
|
15 |
_init_colorpicker: function() {
|
16 |
+
$('.astra-widget-field-color .astra-widget-color > input').not('[id*="__i__"]').wpColorPicker({
|
17 |
change: function (event, ui) {
|
18 |
$( event.target ).val( ui.color.toString() );
|
19 |
$( event.target ).trigger('change');
|
astra-widgets.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Astra Widgets
|
4 |
* Plugin URI: https://wpastra.com/
|
5 |
* Description: The Fastest Way to Add More Widgets into Your WordPress Website.
|
6 |
-
* Version: 1.2.
|
7 |
* Author: Brainstorm Force
|
8 |
* Author URI: https://www.brainstormforce.com
|
9 |
* Text Domain: astra-widgets
|
@@ -25,7 +25,7 @@ define( 'ASTRA_WIDGETS_FILE', __FILE__ );
|
|
25 |
define( 'ASTRA_WIDGETS_BASE', plugin_basename( ASTRA_WIDGETS_FILE ) );
|
26 |
define( 'ASTRA_WIDGETS_DIR', plugin_dir_path( ASTRA_WIDGETS_FILE ) );
|
27 |
define( 'ASTRA_WIDGETS_URI', plugins_url( '/', ASTRA_WIDGETS_FILE ) );
|
28 |
-
define( 'ASTRA_WIDGETS_VER', '1.2.
|
29 |
define( 'ASTRA_WIDGETS_TEMPLATE_DEBUG_MODE', false );
|
30 |
|
31 |
require_once ASTRA_WIDGETS_DIR . 'classes/class-astra-widgets.php';
|
3 |
* Plugin Name: Astra Widgets
|
4 |
* Plugin URI: https://wpastra.com/
|
5 |
* Description: The Fastest Way to Add More Widgets into Your WordPress Website.
|
6 |
+
* Version: 1.2.10
|
7 |
* Author: Brainstorm Force
|
8 |
* Author URI: https://www.brainstormforce.com
|
9 |
* Text Domain: astra-widgets
|
25 |
define( 'ASTRA_WIDGETS_BASE', plugin_basename( ASTRA_WIDGETS_FILE ) );
|
26 |
define( 'ASTRA_WIDGETS_DIR', plugin_dir_path( ASTRA_WIDGETS_FILE ) );
|
27 |
define( 'ASTRA_WIDGETS_URI', plugins_url( '/', ASTRA_WIDGETS_FILE ) );
|
28 |
+
define( 'ASTRA_WIDGETS_VER', '1.2.10' );
|
29 |
define( 'ASTRA_WIDGETS_TEMPLATE_DEBUG_MODE', false );
|
30 |
|
31 |
require_once ASTRA_WIDGETS_DIR . 'classes/class-astra-widgets.php';
|
classes/class-astra-widgets-helper.php
CHANGED
@@ -364,9 +364,10 @@ if ( ! class_exists( 'Astra_Widgets_Helper' ) ) :
|
|
364 |
* @param object $self Widget object.
|
365 |
* @param array $fields Fields array.
|
366 |
* @param string $repeater_id Repeater ID.
|
|
|
367 |
* @return void
|
368 |
*/
|
369 |
-
public function generate( $self, $fields = array(), $repeater_id = '' ) {
|
370 |
|
371 |
$defaults = array(
|
372 |
'type' => '',
|
@@ -450,7 +451,7 @@ if ( ! class_exists( 'Astra_Widgets_Helper' ) ) :
|
|
450 |
<div class="astra-repeater-container">
|
451 |
<div class="astra-repeater-sortable">
|
452 |
<?php
|
453 |
-
$this->generate_repeater_fields( $self, $fields, $value );
|
454 |
?>
|
455 |
</div>
|
456 |
</div>
|
@@ -577,14 +578,14 @@ if ( ! class_exists( 'Astra_Widgets_Helper' ) ) :
|
|
577 |
break;
|
578 |
case 'hidden':
|
579 |
?>
|
580 |
-
|
581 |
-
|
582 |
break;
|
583 |
case 'color':
|
584 |
?>
|
585 |
|
586 |
<div class="astra-widget-field astra-widget-field-color astra-widget-field-<?php echo esc_attr( $value['id'] ); ?>">
|
587 |
-
<div class="astra-widget-field-<?php echo esc_attr( $value['id'] ); ?>">
|
588 |
<label for="<?php echo esc_attr( $self->get_field_id( $value['id'] ) ); ?>"><?php echo esc_html( $value['name'] ); ?></label>
|
589 |
<input class="<?php echo esc_attr( $class ); ?> widefat" type="text" name="<?php echo esc_attr( $self->get_field_name( $value['id'] ) ); ?>" value="<?php echo esc_attr( $value['default'] ); ?>"/>
|
590 |
</div>
|
@@ -636,25 +637,53 @@ if ( ! class_exists( 'Astra_Widgets_Helper' ) ) :
|
|
636 |
<hr />
|
637 |
<?php
|
638 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
639 |
}
|
640 |
}
|
641 |
}
|
642 |
}
|
643 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
644 |
/**
|
645 |
* Generate repeatable fields.
|
646 |
*
|
647 |
* @param object $self Widget object.
|
648 |
* @param array $fields Fields array.
|
649 |
* @param array $value Default value.
|
|
|
650 |
* @return void
|
651 |
*/
|
652 |
-
public function generate_repeater_fields( $self, $fields, $value ) {
|
653 |
$instances = $self->get_settings();
|
|
|
654 |
|
655 |
-
|
656 |
-
|
|
|
|
|
657 |
|
|
|
|
|
658 |
if ( array_key_exists( $value['id'], $instance ) ) {
|
659 |
$stored = $instance[ $value['id'] ];
|
660 |
$repeater_options = $value['options'];
|
@@ -691,7 +720,6 @@ if ( ! class_exists( 'Astra_Widgets_Helper' ) ) :
|
|
691 |
}
|
692 |
}
|
693 |
}
|
694 |
-
|
695 |
}
|
696 |
|
697 |
/**
|
@@ -713,11 +741,12 @@ if ( ! function_exists( 'astra_generate_widget_fields' ) ) :
|
|
713 |
*
|
714 |
* @param object $self Widget object.
|
715 |
* @param array $fields Fields array.
|
|
|
716 |
* @param string $repeater_id Repeater ID.
|
717 |
* @return void
|
718 |
*/
|
719 |
-
function astra_generate_widget_fields( $self, $fields = array(), $repeater_id = '' ) {
|
720 |
-
Astra_Widgets_Helper::get_instance()->generate( $self, $fields, $repeater_id );
|
721 |
}
|
722 |
endif;
|
723 |
|
364 |
* @param object $self Widget object.
|
365 |
* @param array $fields Fields array.
|
366 |
* @param string $repeater_id Repeater ID.
|
367 |
+
* @param array $instance_data Widget saved data.
|
368 |
* @return void
|
369 |
*/
|
370 |
+
public function generate( $self, $fields = array(), $repeater_id = '', $instance_data = array() ) {
|
371 |
|
372 |
$defaults = array(
|
373 |
'type' => '',
|
451 |
<div class="astra-repeater-container">
|
452 |
<div class="astra-repeater-sortable">
|
453 |
<?php
|
454 |
+
$this->generate_repeater_fields( $self, $fields, $value, $instance_data );
|
455 |
?>
|
456 |
</div>
|
457 |
</div>
|
578 |
break;
|
579 |
case 'hidden':
|
580 |
?>
|
581 |
+
<input class="widefat" type="hidden" name="<?php echo esc_attr( $self->get_field_name( $value['id'] ) ); ?>" value="<?php echo esc_attr( $value['default'] ); ?>"/>
|
582 |
+
<?php
|
583 |
break;
|
584 |
case 'color':
|
585 |
?>
|
586 |
|
587 |
<div class="astra-widget-field astra-widget-field-color astra-widget-field-<?php echo esc_attr( $value['id'] ); ?>">
|
588 |
+
<div class="astra-widget-color astra-widget-field-<?php echo esc_attr( $value['id'] ); ?>">
|
589 |
<label for="<?php echo esc_attr( $self->get_field_id( $value['id'] ) ); ?>"><?php echo esc_html( $value['name'] ); ?></label>
|
590 |
<input class="<?php echo esc_attr( $class ); ?> widefat" type="text" name="<?php echo esc_attr( $self->get_field_name( $value['id'] ) ); ?>" value="<?php echo esc_attr( $value['default'] ); ?>"/>
|
591 |
</div>
|
637 |
<hr />
|
638 |
<?php
|
639 |
break;
|
640 |
+
case 'notice':
|
641 |
+
if ( true === $value['show_if'] ) {
|
642 |
+
?>
|
643 |
+
<p class="astra-widget-field astra-widget-field-notice notice inline notice-warning notice-alt">
|
644 |
+
<?php echo wp_kses_post( $value['desc'] ); ?>
|
645 |
+
</p>
|
646 |
+
<?php
|
647 |
+
}
|
648 |
+
break;
|
649 |
}
|
650 |
}
|
651 |
}
|
652 |
}
|
653 |
|
654 |
+
/**
|
655 |
+
* Check if block editor is active or not.
|
656 |
+
*
|
657 |
+
* @return boolean true|false
|
658 |
+
* @since x.x.x
|
659 |
+
*/
|
660 |
+
public function is_widget_block_editor() {
|
661 |
+
if ( current_theme_supports( 'widgets-block-editor' ) ) {
|
662 |
+
return true;
|
663 |
+
}
|
664 |
+
return false;
|
665 |
+
}
|
666 |
+
|
667 |
/**
|
668 |
* Generate repeatable fields.
|
669 |
*
|
670 |
* @param object $self Widget object.
|
671 |
* @param array $fields Fields array.
|
672 |
* @param array $value Default value.
|
673 |
+
* @param array $instance_data Widget data.
|
674 |
* @return void
|
675 |
*/
|
676 |
+
public function generate_repeater_fields( $self, $fields, $value, $instance_data ) {
|
677 |
$instances = $self->get_settings();
|
678 |
+
$widget_id = $self->number;
|
679 |
|
680 |
+
// Getting widget ID from their saved meta option and assigned it for further rendering.
|
681 |
+
if ( $this->is_widget_block_editor() && ( isset( $instance_data['widget_unique_id'] ) && 1 !== $instance_data['widget_unique_id'] ) ) {
|
682 |
+
$widget_id = $instance_data['widget_unique_id'];
|
683 |
+
}
|
684 |
|
685 |
+
if ( array_key_exists( $widget_id, $instances ) ) {
|
686 |
+
$instance = $instances[ $widget_id ];
|
687 |
if ( array_key_exists( $value['id'], $instance ) ) {
|
688 |
$stored = $instance[ $value['id'] ];
|
689 |
$repeater_options = $value['options'];
|
720 |
}
|
721 |
}
|
722 |
}
|
|
|
723 |
}
|
724 |
|
725 |
/**
|
741 |
*
|
742 |
* @param object $self Widget object.
|
743 |
* @param array $fields Fields array.
|
744 |
+
* @param array $instance_data Widget saved data array.
|
745 |
* @param string $repeater_id Repeater ID.
|
746 |
* @return void
|
747 |
*/
|
748 |
+
function astra_generate_widget_fields( $self, $fields = array(), $instance_data = array(), $repeater_id = '' ) {
|
749 |
+
Astra_Widgets_Helper::get_instance()->generate( $self, $fields, $repeater_id, $instance_data );
|
750 |
}
|
751 |
endif;
|
752 |
|
classes/widgets/class-astra-widget-list-icons.php
CHANGED
@@ -210,7 +210,7 @@ if ( ! class_exists( 'Astra_Widget_List_Icons' ) ) :
|
|
210 |
<?php } ?>
|
211 |
</span>
|
212 |
</div>
|
213 |
-
<?php } else { ?>
|
214 |
<div class="image" <?php echo ( isset( $image_width ) ) ? esc_attr( $image_width ) : ''; ?>>
|
215 |
<?php echo wp_get_attachment_image( $list['image'] ); ?>
|
216 |
</div>
|
@@ -252,6 +252,14 @@ if ( ! class_exists( 'Astra_Widget_List_Icons' ) ) :
|
|
252 |
}
|
253 |
}
|
254 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
255 |
return $instance;
|
256 |
}
|
257 |
|
@@ -267,6 +275,8 @@ if ( ! class_exists( 'Astra_Widget_List_Icons' ) ) :
|
|
267 |
wp_enqueue_script( 'astra-widgets-' . $this->id_base );
|
268 |
wp_add_inline_style( 'astra-font-style-style', $custom_css );
|
269 |
|
|
|
|
|
270 |
$fields = array(
|
271 |
array(
|
272 |
'type' => 'text',
|
@@ -333,6 +343,12 @@ if ( ! class_exists( 'Astra_Widget_List_Icons' ) ) :
|
|
333 |
),
|
334 |
),
|
335 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
336 |
array(
|
337 |
'type' => 'separator',
|
338 |
),
|
@@ -416,13 +432,18 @@ if ( ! class_exists( 'Astra_Widget_List_Icons' ) ) :
|
|
416 |
'default' => ( isset( $instance['width'] ) && ! empty( $instance['width'] ) ) ? $instance['width'] : '',
|
417 |
'unit' => 'Px',
|
418 |
),
|
|
|
|
|
|
|
|
|
|
|
419 |
);
|
420 |
?>
|
421 |
|
422 |
<div class="<?php echo esc_attr( $this->id_base ); ?>-fields">
|
423 |
<?php
|
424 |
// Generate fields.
|
425 |
-
astra_generate_widget_fields( $this, $fields );
|
426 |
?>
|
427 |
</div>
|
428 |
<?php
|
210 |
<?php } ?>
|
211 |
</span>
|
212 |
</div>
|
213 |
+
<?php } else { ?>
|
214 |
<div class="image" <?php echo ( isset( $image_width ) ) ? esc_attr( $image_width ) : ''; ?>>
|
215 |
<?php echo wp_get_attachment_image( $list['image'] ); ?>
|
216 |
</div>
|
252 |
}
|
253 |
}
|
254 |
}
|
255 |
+
|
256 |
+
/**
|
257 |
+
* Created new widget meta option to resolve repeater fields not appearing in block editor widgets.
|
258 |
+
*
|
259 |
+
* Case: In WordPress 5.8 block editor for widget areas are released due to that Legacy widget's repeater fields are not appearing when user triggers widget to edit.
|
260 |
+
* Usecase: So that's this new meta option added here & it funrther use for that widget instance number.
|
261 |
+
*/
|
262 |
+
$instance['widget_unique_id'] = ! empty( $_POST[ 'widget-' . $this->id_base ] ) ? absint( array_keys( $_POST[ 'widget-' . $this->id_base ] )[0] ) : 1; // phpcs:ignore WordPress.Security.NonceVerification.Missing, PHPCompatibility.Syntax.NewFunctionArrayDereferencing.Found
|
263 |
return $instance;
|
264 |
}
|
265 |
|
275 |
wp_enqueue_script( 'astra-widgets-' . $this->id_base );
|
276 |
wp_add_inline_style( 'astra-font-style-style', $custom_css );
|
277 |
|
278 |
+
$notice_link = __( 'If repeater fields are not appearing then click on the Update button of the widgets page. For more information,', 'astra-widgets' );
|
279 |
+
|
280 |
$fields = array(
|
281 |
array(
|
282 |
'type' => 'text',
|
343 |
),
|
344 |
),
|
345 |
),
|
346 |
+
array(
|
347 |
+
'type' => 'notice',
|
348 |
+
'desc' => /* translators:%s module name .*/
|
349 |
+
sprintf( '%1$s %2$s', $notice_link, '<a rel="noopener" target="_blank" href="' . esc_url_raw( 'https://wpastra.com/docs/resolving-repeater-fields-not-working-in-widget-block-editor/' ) . '">' . __( 'click here.', 'astra-widgets' ) . '</a>' ),
|
350 |
+
'show_if' => ( ! empty( $instance ) && ! isset( $instance['widget_unique_id'] ) && Astra_Widgets_Helper::get_instance()->is_widget_block_editor() ),
|
351 |
+
),
|
352 |
array(
|
353 |
'type' => 'separator',
|
354 |
),
|
432 |
'default' => ( isset( $instance['width'] ) && ! empty( $instance['width'] ) ) ? $instance['width'] : '',
|
433 |
'unit' => 'Px',
|
434 |
),
|
435 |
+
array(
|
436 |
+
'type' => 'hidden',
|
437 |
+
'id' => 'widget_unique_id',
|
438 |
+
'default' => ( isset( $instance['widget_unique_id'] ) && ! empty( $instance['widget_unique_id'] ) ) ? $instance['widget_unique_id'] : '',
|
439 |
+
),
|
440 |
);
|
441 |
?>
|
442 |
|
443 |
<div class="<?php echo esc_attr( $this->id_base ); ?>-fields">
|
444 |
<?php
|
445 |
// Generate fields.
|
446 |
+
astra_generate_widget_fields( $this, $fields, $instance );
|
447 |
?>
|
448 |
</div>
|
449 |
<?php
|
classes/widgets/class-astra-widget-social-profiles.php
CHANGED
@@ -388,6 +388,14 @@ if ( ! class_exists( 'Astra_Widget_Social_Profiles' ) ) :
|
|
388 |
*/
|
389 |
$instance['display-title'] = isset( $new_instance['display-title'] ) ? (bool) $new_instance['display-title'] : false;
|
390 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
391 |
return $instance;
|
392 |
}
|
393 |
|
@@ -403,6 +411,8 @@ if ( ! class_exists( 'Astra_Widget_Social_Profiles' ) ) :
|
|
403 |
wp_enqueue_style( 'astra-widget-social-profiles-admin' );
|
404 |
wp_enqueue_style( 'astra-widgets-font-style' );
|
405 |
|
|
|
|
|
406 |
$fields = array(
|
407 |
array(
|
408 |
'type' => 'text',
|
@@ -463,6 +473,12 @@ if ( ! class_exists( 'Astra_Widget_Social_Profiles' ) ) :
|
|
463 |
),
|
464 |
),
|
465 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
466 |
array(
|
467 |
'type' => 'separator',
|
468 |
),
|
@@ -554,6 +570,11 @@ if ( ! class_exists( 'Astra_Widget_Social_Profiles' ) ) :
|
|
554 |
'unit' => 'Px',
|
555 |
'default' => ( isset( $instance['space_btn_social_profiles'] ) && ! empty( $instance['space_btn_social_profiles'] ) ) ? $instance['space_btn_social_profiles'] : '',
|
556 |
),
|
|
|
|
|
|
|
|
|
|
|
557 |
);
|
558 |
|
559 |
?>
|
@@ -561,7 +582,7 @@ if ( ! class_exists( 'Astra_Widget_Social_Profiles' ) ) :
|
|
561 |
<div class="<?php echo esc_attr( $this->id_base ); ?>-fields">
|
562 |
<?php
|
563 |
// Generate fields.
|
564 |
-
astra_generate_widget_fields( $this, $fields );
|
565 |
?>
|
566 |
</div>
|
567 |
<?php
|
388 |
*/
|
389 |
$instance['display-title'] = isset( $new_instance['display-title'] ) ? (bool) $new_instance['display-title'] : false;
|
390 |
|
391 |
+
/**
|
392 |
+
* Created new widget meta option to resolve repeater fields not appearing in block editor widgets.
|
393 |
+
*
|
394 |
+
* Case: In WordPress 5.8 block editor for widget areas are released due to that Legacy widget's repeater fields are not appearing when user triggers widget to edit.
|
395 |
+
* Usecase: So that's this new meta option added here & it funrther use for that widget instance number.
|
396 |
+
*/
|
397 |
+
$instance['widget_unique_id'] = ! empty( $_POST[ 'widget-' . $this->id_base ] ) ? absint( array_keys( $_POST[ 'widget-' . $this->id_base ] )[0] ) : 1; // phpcs:ignore WordPress.Security.NonceVerification.Missing, PHPCompatibility.Syntax.NewFunctionArrayDereferencing.Found
|
398 |
+
|
399 |
return $instance;
|
400 |
}
|
401 |
|
411 |
wp_enqueue_style( 'astra-widget-social-profiles-admin' );
|
412 |
wp_enqueue_style( 'astra-widgets-font-style' );
|
413 |
|
414 |
+
$notice_link = __( 'If repeater fields are not appearing then click on the Update button of the widgets page. For more information,', 'astra-widgets' );
|
415 |
+
|
416 |
$fields = array(
|
417 |
array(
|
418 |
'type' => 'text',
|
473 |
),
|
474 |
),
|
475 |
),
|
476 |
+
array(
|
477 |
+
'type' => 'notice',
|
478 |
+
'desc' => /* translators:%s module name .*/
|
479 |
+
sprintf( '%1$s %2$s', $notice_link, '<a rel="noopener" target="_blank" href="' . esc_url_raw( 'https://wpastra.com/docs/resolving-repeater-fields-not-working-in-widget-block-editor/' ) . '">' . __( 'click here.', 'astra-widgets' ) . '</a>' ),
|
480 |
+
'show_if' => ( ! empty( $instance ) && ! isset( $instance['widget_unique_id'] ) && Astra_Widgets_Helper::get_instance()->is_widget_block_editor() ),
|
481 |
+
),
|
482 |
array(
|
483 |
'type' => 'separator',
|
484 |
),
|
570 |
'unit' => 'Px',
|
571 |
'default' => ( isset( $instance['space_btn_social_profiles'] ) && ! empty( $instance['space_btn_social_profiles'] ) ) ? $instance['space_btn_social_profiles'] : '',
|
572 |
),
|
573 |
+
array(
|
574 |
+
'type' => 'hidden',
|
575 |
+
'id' => 'widget_unique_id',
|
576 |
+
'default' => ( isset( $instance['widget_unique_id'] ) && ! empty( $instance['widget_unique_id'] ) ) ? $instance['widget_unique_id'] : '',
|
577 |
+
),
|
578 |
);
|
579 |
|
580 |
?>
|
582 |
<div class="<?php echo esc_attr( $this->id_base ); ?>-fields">
|
583 |
<?php
|
584 |
// Generate fields.
|
585 |
+
astra_generate_widget_fields( $this, $fields, $instance );
|
586 |
?>
|
587 |
</div>
|
588 |
<?php
|
readme.txt
CHANGED
@@ -3,9 +3,9 @@ Contributors: brainstormforce
|
|
3 |
Donate link: https://www.paypal.me/BrainstormForce
|
4 |
Tags: Address widget, Social profile widget, List icon widget, Social media, Add widget
|
5 |
Requires at least: 4.7
|
6 |
-
Tested up to: 5.9
|
7 |
Requires PHP: 5.2
|
8 |
-
Stable tag: 1.2.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -76,6 +76,11 @@ In your WordPress admin dashboard go to Appearance -> Widgets, drag the Astra :
|
|
76 |
|
77 |
== Changelog ==
|
78 |
|
|
|
|
|
|
|
|
|
|
|
79 |
= 1.2.9 =
|
80 |
- Improvement: WordPress 5.8 compatibility.
|
81 |
- Fix: Handled PHP notice in customizer with Astra Social Profiles Widget.
|
3 |
Donate link: https://www.paypal.me/BrainstormForce
|
4 |
Tags: Address widget, Social profile widget, List icon widget, Social media, Add widget
|
5 |
Requires at least: 4.7
|
6 |
+
Tested up to: 5.9.2
|
7 |
Requires PHP: 5.2
|
8 |
+
Stable tag: 1.2.10
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
76 |
|
77 |
== Changelog ==
|
78 |
|
79 |
+
= 1.2.10 =
|
80 |
+
- Fix: Astra Social Profile: Repeater field not showing in widget block editor. ( https://wpastra.com/docs/resolving-repeater-fields-not-working-in-widget-block-editor/ )
|
81 |
+
- Fix: Astra List Icons: Repeater field not showing in widget block editor.
|
82 |
+
- Fix: Displaying double Color options when more than one widgets added.
|
83 |
+
|
84 |
= 1.2.9 =
|
85 |
- Improvement: WordPress 5.8 compatibility.
|
86 |
- Fix: Handled PHP notice in customizer with Astra Social Profiles Widget.
|