Version Description
- April 5 2016 =
- Added Icon widget.
- Moved widget form arrays into separate functions to improve performance.
- Cache widget style CSS if it can't be saved to filesystem.
- Improved preview checking so preview style CSS isn't stored.
- Contact Form: Improved instance hashing for compatibility with Yoast SEO.
- Contact Form: Added description field and customisation.
- Slider: Ensure correct styles are applied to slider images when a link is defined.
- Features: Allow user to select size for uploaded icon image.
- Price Table: Ensure feature icons always vertically centered, alongside feature text.
Download this release
Release Info
Developer | gpriday |
Plugin | SiteOrigin Widgets Bundle |
Version | 1.5.10 |
Comparing to | |
See all releases |
Code changes from version 1.5.9 to 1.5.10
- base/inc/fields/measurement.class.php +2 -2
- base/inc/fields/siteorigin-widget-field-class-loader.class.php +42 -15
- base/inc/post-selector.php +2 -1
- base/js/admin.js +6 -4
- base/js/admin.min.js +1 -1
- base/js/posts-selector.js +2 -2
- base/js/posts-selector.min.js +1 -1
- base/siteorigin-widget.class.php +75 -23
- css/slider/slider.css +3 -1
- readme.txt +292 -281
- so-widgets-bundle.php +5 -4
- widgets/button/button.php +138 -134
- widgets/contact/contact.php +494 -434
- widgets/contact/styles/default.less +22 -8
- widgets/cta/cta.php +48 -44
- widgets/editor/editor.php +19 -15
- widgets/features/features.php +226 -184
- widgets/features/tpl/base.php +4 -3
- widgets/google-map/google-map.php +334 -329
- widgets/headline/headline.php +135 -130
- widgets/hero/hero.php +164 -144
- widgets/hero/styles/default.less +4 -2
- widgets/icon/icon.php +109 -0
- widgets/icon/styles/sow-icon.less +19 -0
- widgets/icon/tpl/icon.php +19 -0
- widgets/image-grid/image-grid.php +61 -68
- widgets/image/image.php +78 -76
- widgets/post-carousel/post-carousel.php +16 -12
- widgets/price-table/price-table.php +120 -116
- widgets/price-table/styles/atom.less +12 -1
- widgets/price-table/tpl/atom.php +11 -5
- widgets/simple-masonry/simple-masonry.php +139 -135
- widgets/slider/slider.php +67 -61
- widgets/social-media-buttons/social-media-buttons.php +118 -113
- widgets/testimonial/testimonial.php +204 -199
- widgets/testimonial/tpl/default.php +1 -0
- widgets/video/video.php +80 -75
base/inc/fields/measurement.class.php
CHANGED
@@ -19,7 +19,7 @@ class SiteOrigin_Widget_Field_Measurement extends SiteOrigin_Widget_Field_Text_I
|
|
19 |
* @return array
|
20 |
*/
|
21 |
protected function get_render_values( $value ) {
|
22 |
-
preg_match('/(\d
|
23 |
$num_matches = count( $matches );
|
24 |
$val = array();
|
25 |
$val['value'] = $num_matches > 1 ? $matches[1] : null;
|
@@ -94,4 +94,4 @@ class SiteOrigin_Widget_Field_Measurement extends SiteOrigin_Widget_Field_Text_I
|
|
94 |
}
|
95 |
return $v_name . '_unit';
|
96 |
}
|
97 |
-
}
|
19 |
* @return array
|
20 |
*/
|
21 |
protected function get_render_values( $value ) {
|
22 |
+
preg_match('/(\d+\.?\d*)([a-z%]+)*/', $value, $matches);
|
23 |
$num_matches = count( $matches );
|
24 |
$val = array();
|
25 |
$val['value'] = $num_matches > 1 ? $matches[1] : null;
|
94 |
}
|
95 |
return $v_name . '_unit';
|
96 |
}
|
97 |
+
}
|
base/inc/fields/siteorigin-widget-field-class-loader.class.php
CHANGED
@@ -8,19 +8,49 @@
|
|
8 |
class SiteOrigin_Widget_Field_Class_Loader {
|
9 |
|
10 |
private $class_prefixes;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
public function add_class_prefixes( $class_prefixes ) {
|
13 |
if( !isset( $this->class_prefixes ) ) $this->class_prefixes = array();
|
14 |
$this->class_prefixes = array_merge( $this->class_prefixes, $class_prefixes );
|
15 |
}
|
16 |
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
19 |
public function add_class_paths( $class_paths ) {
|
20 |
if( !isset( $this->class_paths ) ) $this->class_paths = array();
|
21 |
$this->class_paths = array_merge( $this->class_paths, $class_paths );
|
22 |
}
|
23 |
|
|
|
|
|
|
|
|
|
|
|
24 |
public function load_field_class( $field_classname ) {
|
25 |
$valid_classname = false;
|
26 |
$class_prefix = '';
|
@@ -40,19 +70,16 @@ class SiteOrigin_Widget_Field_Class_Loader {
|
|
40 |
}
|
41 |
}
|
42 |
|
43 |
-
|
44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
}
|
46 |
}
|
47 |
|
48 |
-
|
49 |
-
$field_class_loader = new SiteOrigin_Widget_Field_Class_Loader();
|
50 |
-
$class_prefixes = array( 'SiteOrigin_Widget_Field_' );
|
51 |
-
$class_prefixes = apply_filters( 'siteorigin_widgets_field_class_prefixes', $class_prefixes );
|
52 |
-
$field_class_loader->add_class_prefixes( $class_prefixes );
|
53 |
-
$class_paths = array( plugin_dir_path( __FILE__ ) );
|
54 |
-
$class_paths = apply_filters( 'siteorigin_widgets_field_class_paths', $class_paths );
|
55 |
-
$field_class_loader->add_class_paths( $class_paths );
|
56 |
-
$field_class_loader->register();
|
57 |
-
}
|
58 |
-
add_action( 'init', 'siteorigin_widgets_init_and_register_field_class_loader', 1 );
|
8 |
class SiteOrigin_Widget_Field_Class_Loader {
|
9 |
|
10 |
private $class_prefixes;
|
11 |
+
private $class_paths;
|
12 |
+
|
13 |
+
function __construct(){
|
14 |
+
// Setup the loader with default prefixes and paths
|
15 |
+
$this->add_class_prefixes( array( 'SiteOrigin_Widget_Field_' ) );
|
16 |
+
$this->add_class_paths( array( plugin_dir_path( __FILE__ ) ) );
|
17 |
+
spl_autoload_register( array( $this, 'load_field_class' ) );
|
18 |
+
}
|
19 |
|
20 |
+
static function single(){
|
21 |
+
static $single;
|
22 |
+
if( empty( $single ) ) {
|
23 |
+
$single = new SiteOrigin_Widget_Field_Class_Loader();
|
24 |
+
}
|
25 |
+
|
26 |
+
return $single;
|
27 |
+
}
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Regsiter class prefixes to watch for in this loader
|
31 |
+
*
|
32 |
+
* @param $class_prefixes
|
33 |
+
*/
|
34 |
public function add_class_prefixes( $class_prefixes ) {
|
35 |
if( !isset( $this->class_prefixes ) ) $this->class_prefixes = array();
|
36 |
$this->class_prefixes = array_merge( $this->class_prefixes, $class_prefixes );
|
37 |
}
|
38 |
|
39 |
+
/**
|
40 |
+
* Register paths where we'll look for these classes.
|
41 |
+
*
|
42 |
+
* @param $class_paths
|
43 |
+
*/
|
44 |
public function add_class_paths( $class_paths ) {
|
45 |
if( !isset( $this->class_paths ) ) $this->class_paths = array();
|
46 |
$this->class_paths = array_merge( $this->class_paths, $class_paths );
|
47 |
}
|
48 |
|
49 |
+
/**
|
50 |
+
* Load a class field. This is registered with spl_autoload_register
|
51 |
+
*
|
52 |
+
* @param $field_classname
|
53 |
+
*/
|
54 |
public function load_field_class( $field_classname ) {
|
55 |
$valid_classname = false;
|
56 |
$class_prefix = '';
|
70 |
}
|
71 |
}
|
72 |
|
73 |
+
/**
|
74 |
+
* Initialize and register the class field loader
|
75 |
+
*/
|
76 |
+
function extend(){
|
77 |
+
$class_prefixes = apply_filters( 'siteorigin_widgets_field_class_prefixes', array() );
|
78 |
+
$this->add_class_prefixes( $class_prefixes );
|
79 |
+
|
80 |
+
$class_paths = apply_filters( 'siteorigin_widgets_field_class_paths', array() );
|
81 |
+
$this->add_class_paths( $class_paths );
|
82 |
}
|
83 |
}
|
84 |
|
85 |
+
add_action( 'init', array( SiteOrigin_Widget_Field_Class_Loader::single(), 'extend' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
base/inc/post-selector.php
CHANGED
@@ -91,7 +91,8 @@ function siteorigin_widget_post_selector_process_query($query){
|
|
91 |
}
|
92 |
|
93 |
if ( ! empty( $query['additional'] ) ) {
|
94 |
-
$
|
|
|
95 |
unset( $query['additional'] );
|
96 |
}
|
97 |
|
91 |
}
|
92 |
|
93 |
if ( ! empty( $query['additional'] ) ) {
|
94 |
+
$additional = implode( '&', explode( ',', $query['additional'] ) );
|
95 |
+
$query = wp_parse_args( $additional, $query );
|
96 |
unset( $query['additional'] );
|
97 |
}
|
98 |
|
base/js/admin.js
CHANGED
@@ -351,10 +351,12 @@
|
|
351 |
container.append(icon);
|
352 |
|
353 |
if( $v.val() === family + '-' + i ) {
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
|
|
|
|
358 |
icon.addClass('siteorigin-widget-active');
|
359 |
}
|
360 |
}
|
351 |
container.append(icon);
|
352 |
|
353 |
if( $v.val() === family + '-' + i ) {
|
354 |
+
// Add selected icon to the button.
|
355 |
+
$b.find('span')
|
356 |
+
.show()
|
357 |
+
.attr( 'data-sow-icon', icon.attr('data-sow-icon') )
|
358 |
+
.attr( 'class', '' )
|
359 |
+
.addClass( 'sow-icon-' + family );
|
360 |
icon.addClass('siteorigin-widget-active');
|
361 |
}
|
362 |
}
|
base/js/admin.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(e){e.fn.sowSetupForm=function(){return e(this).each(function(i,t){var n,a,r=e(t),s=!0,o=r.find("input[name]");if(o.length&&-1!==o.attr("name").indexOf("__i__"))return this;if(r.is(".siteorigin-widget-form-main")){if(r.data("sow-form-setup")===!0)return!0;if(e("body").hasClass("widgets-php")&&!r.is(":visible")&&0===r.closest(".panel-dialog").length)return!0;r.on("sowstatechange",function(i,t,n){r.find("[data-state-handler]").each(function(){var i=e(this),a=e.extend({},i.data("state-handler"),s?i.data("state-handler-initial"):{});if(0===Object.keys(a).length)return!0;var r,o,d,l,f,g,c={},u=window.sowForms.getRepeaterId(i);if(u!==!1){var p={};for(var w in a)p[w.replace("{$repeater}",u)]=a[w];a=p}for(var w in a)if(f=!1,r=w.match(/^([a-zA-Z0-9_-]+)(\[([a-zA-Z0-9_\-,]+)\])?(\[\])?$/),null!==r){if(o={group:"default",name:"",multi:!1},void 0!==r[2]?(o.group=r[1],o.name=r[3]):o.name=r[0],o.multi=void 0!==r[4],"_else"===o.group)o.group=o.name,o.name="",f=o.group===t&&"undefined"==typeof c[o.group];else{g=o.name.split(",").map(function(e){return e.trim()});for(var m=0;m<g.length&&!(f=o.group===t&&g[m]===n);m++);}if(f){d=a[w],o.multi||(d=[d]);for(var m=0;m<d.length;m++)l="undefined"!=typeof d[m][1]&&Boolean(d[m][1])?i.find(d[m][1]):i,l[d[m][0]].apply(l,"undefined"!=typeof d[m][2]?d[m][2]:[]);c[o.group]=!0}}})}),r.sowSetupPreview(),n=r}else n=r.closest(".siteorigin-widget-form-main");a=n.find("> .siteorigin-widgets-form-id").val();var d=r.find("> .siteorigin-widget-field");d.find("> .siteorigin-widget-section").sowSetupForm(),d.filter(".siteorigin-widget-field-type-widget:not(:has(> .siteorigin-widget-section))").sowSetupForm(),d.find(".siteorigin-widget-input").each(function(i,t){null===e(t).data("original-name")&&e(t).data("original-name",e(t).attr("name"))}),d.find("> .siteorigin-widget-field-repeater").sowSetupRepeater(),r.find(".siteorigin-widget-field-repeater-item").sowSetupRepeaterItems(),d.find("> .siteorigin-widget-input-color").wpColorPicker(),d.find("> .media-field-wrapper").each(function(){var i=e(this),t=i.closest(".siteorigin-widget-field");i.find("a.media-upload-button").click(function(i){if("undefined"!=typeof wp.media){var n=e(this),a=e(this).closest(".siteorigin-widget-field"),r=e(this).data("frame");return r?(r.open(),!1):(r=wp.media({title:n.data("choose"),library:{type:n.data("library").split(",").map(function(e){return e.trim()})},button:{text:n.data("update"),close:!1}}),n.data("frame",r),r.on("select",function(){var e=r.state().get("selection").first().attributes;a.find(".current .title").html(e.title);var i=a.find("input[type=hidden]");i.val(e.id),i.trigger("change"),"undefined"!=typeof e.sizes?"undefined"!=typeof e.sizes.thumbnail?a.find(".current .thumbnail").attr("src",e.sizes.thumbnail.url).fadeIn():a.find(".current .thumbnail").attr("src",e.sizes.full.url).fadeIn():a.find(".current .thumbnail").attr("src",e.icon).fadeIn(),t.find(".media-remove-button").removeClass("remove-hide"),r.close()}),r.open(),!1)}}),i.find(".current").mouseenter(function(){var i=e(this).find(".title");""!==i.html()&&i.fadeIn("fast")}).mouseleave(function(){e(this).find(".title").clearQueue().fadeOut("fast")}),t.find("a.media-remove-button").click(function(i){i.preventDefault(),t.find(".current .title").html(""),t.find("input[type=hidden]").val(""),t.find(".current .thumbnail").fadeOut("fast"),e(this).addClass("remove-hide")})}),d.filter(".siteorigin-widget-field-type-widget, .siteorigin-widget-field-type-section").find("> label").click(function(){e(this);e(this).toggleClass("siteorigin-widget-section-visible"),e(this).siblings(".siteorigin-widget-section").slideToggle(function(){e(window).resize(),e(this).find("> .siteorigin-widget-field-container-state").val(e(this).is(":visible")?"open":"closed")})});var l={};d.filter(".siteorigin-widget-field-type-icon").each(function(){var i=e(this),t=i.find(".siteorigin-widget-icon-selector"),n=t.find(".siteorigin-widget-icon-icon"),a=i.find(".siteorigin-widget-icon-selector-current");a.click(function(){t.slideToggle()});var r=function(){var i=t.find("select.siteorigin-widget-icon-family").val(),r=t.find(".siteorigin-widget-icon-icons");if("undefined"!=typeof l[i]){r.empty(),0===e("#siteorigin-widget-font-"+i).length&&e("<link rel='stylesheet' type='text/css'>").attr("id","siteorigin-widget-font-"+i).attr("href",l[i].style_uri).appendTo("head");for(var s in l[i].icons){var o=e('<div data-sow-icon="'+l[i].icons[s]+'"/>').attr("data-value",i+"-"+s).addClass("sow-icon-"+i).addClass("siteorigin-widget-icon-icons-icon").click(function(){var s=e(this);s.hasClass("siteorigin-widget-active")?(s.removeClass("siteorigin-widget-active"),n.val(""),a.find("span").hide()):(r.find(".siteorigin-widget-icon-icons-icon").removeClass("siteorigin-widget-active"),s.addClass("siteorigin-widget-active"),n.val(s.data("value")),a.find("span").show().attr("data-sow-icon",s.attr("data-sow-icon")).attr("class","").addClass("sow-icon-"+i)),n.trigger("change"),t.slideUp()});r.append(o),n.val()===i+"-"+s&&(o.hasClass("siteorigin-widget-active")||o.click(),o.addClass("siteorigin-widget-active"))}r.prepend(r.find(".siteorigin-widget-active"))}},s=function(){var i=t.find("select.siteorigin-widget-icon-family").val();"undefined"!=typeof i&&""!==i&&("undefined"==typeof l[i]?e.getJSON(soWidgets.ajaxurl,{action:"siteorigin_widgets_get_icons",family:t.find("select.siteorigin-widget-icon-family").val()},function(e){l[i]=e,r()}):r())};s(),t.find("select.siteorigin-widget-icon-family").change(function(){t.find(".siteorigin-widget-icon-icons").empty(),s()})}),d.filter(".siteorigin-widget-field-type-slider").each(function(){var i=e(this),t=i.find('input[type="number"]'),n=i.find(".siteorigin-widget-value-slider");n.slider({max:parseInt(t.attr("max")),min:parseInt(t.attr("min")),value:parseInt(t.val()),slide:function(e,n){t.val(parseInt(n.value)),i.find(".siteorigin-widget-slider-value").html(n.value)}})}),d.filter(".siteorigin-widget-field-type-link").each(function(){var i=e(this),t=null,n=function(){null!==t&&t.abort();var n=i.find(".content-text-search").val(),a=i.find("ul.posts").empty().addClass("loading");e.get(soWidgets.ajaxurl,{action:"so_widgets_search_posts",query:n},function(i){for(var t=0;t<i.length;t++)""===i[t].post_title&&(i[t].post_title=" "),a.append(e("<li>").addClass("post").html(i[t].post_title+"<span>("+i[t].post_type+")</span>").data(i[t]));a.removeClass("loading")})};i.find(".select-content-button, .button-close").click(function(t){t.preventDefault(),e(this).blur();var a=i.find(".existing-content-selector");a.toggle(),a.is(":visible")&&0===a.find("ul.posts li").length&&n()}),i.on("click",".posts li",function(t){t.preventDefault();var n=e(this);i.find("input.siteorigin-widget-input").val("post: "+n.data("ID")),i.find(".existing-content-selector").toggle()});var a=null;i.find(".content-text-search").keyup(function(){null!==a&&clearTimeout(a),a=setTimeout(function(){n()},500)})});var f=function(){var i=e(this),t=i.closest("[data-state-emitter]").data("state-emitter");if("undefined"!=typeof t){var a=function(t,n){if("undefined"==typeof sowEmitters[t.callback]||"_"===t.callback.substr(0,1))return n;var a=window.sowForms.getRepeaterId(i);return a!==!1&&(t.args=t.args.map(function(e){return e.replace("{$repeater}",a)})),e.extend(n,sowEmitters[t.callback](i.val(),t.args))},r={"default":""};"undefined"==typeof t.length&&(t=[t]);for(var s=0;s<t.length;s++)r=a(t[s],r);var o=n.data("states");"undefined"==typeof o&&(o={"default":""});for(var d in r)("undefined"==typeof o[d]||r[d]!==o[d])&&(o[d]=r[d],n.trigger("sowstatechange",[d,r[d]]));n.data("states",o)}};d.filter("[data-state-emitter]").each(function(){e(this).find(".siteorigin-widget-input").on("keyup change",f),e(this).find(".siteorigin-widget-input").each(function(){var i=e(this);i.is(":radio")?i.is(":checked")&&f.call(i[0]):f.call(i[0])})}),r.trigger("sowsetupform",d).data("sow-form-setup",!0),r.find(".siteorigin-widget-field-repeater-item").trigger("updateFieldPositions"),s=!1})},e.fn.sowSetupPreview=function(){var i=e(this),t=i.siblings(".siteorigin-widget-preview");t.find("> a").click(function(t){t.preventDefault();var n={};i.find("*[name]").each(function(){var i=e(this),t=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(i.attr("name"));if(void 0===t)return!0;t=t[1];var a=t.split("][");a=a.map(function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e});for(var r=n,s=0;s<a.length;s++)if(s===a.length-1)if("checkbox"===i.attr("type"))i.is(":checked")?r[a[s]]=""!==i.val()?i.val():!0:r[a[s]]=!1;else if("radio"===i.attr("type"))i.is(":checked")&&(r[a[s]]=""!==i.val()?i.val():!0);else if("TEXTAREA"===i.prop("tagName")&&i.hasClass("wp-editor-area")){var o=null;"undefined"!=typeof tinyMCE&&(o=tinyMCE.get(i.attr("id"))),null===o||"function"!=typeof o.getContent||o.isHidden()?r[a[s]]=i.val():r[a[s]]=o.getContent()}else r[a[s]]=i.val();else"undefined"==typeof r[a[s]]&&(r[a[s]]={}),r=r[a[s]]});var a=e(e("#so-widgets-bundle-tpl-preview-dialog").html().trim()).appendTo("body");a.find('input[name="data"]').val(JSON.stringify(n)),a.find('input[name="class"]').val(i.data("class")),a.find("iframe").on("load",function(){e(this).css("visibility","visible")}),a.find("form").submit(),a.find(".close").click(function(){a.remove()})})},e.fn.sowSetupRepeater=function(){return e(this).each(function(i,t){var n=e(t),a=n.find(".siteorigin-widget-field-repeater-items"),r=n.data("repeater-name");a.bind("updateFieldPositions",function(){var i=e(this),t=i.find("> .siteorigin-widget-field-repeater-item");t.each(function(i,t){e(t).find(".siteorigin-widget-input").each(function(t,n){var a=e(n).data("repeater-positions");"undefined"==typeof a&&(a={}),a[r]=i,e(n).data("repeater-positions",a)})}),i.find(".siteorigin-widget-input").each(function(i,t){var n=e(t).data("repeater-positions"),a=e(t);if("undefined"!=typeof n){var r=a.data("original-name");if("undefined"==typeof r&&(a.data("original-name",a.attr("name")),r=a.attr("name")),!r)return;for(var s in n)r=r.replace("#"+s+"#",n[s]);e(t).attr("name",r)}});var a=n.data("scroll-count")?parseInt(n.data("scroll-count")):0;if(a>0&&t.length>a){var s=t.first().outerHeight();i.css("max-height",s*a).css("overflow","auto")}else i.css("max-height","").css("overflow","")}),a.sortable({handle:".siteorigin-widget-field-repeater-item-top",items:"> .siteorigin-widget-field-repeater-item",update:function(){a.trigger("updateFieldPositions")}}),a.trigger("updateFieldPositions"),n.find("> .siteorigin-widget-field-repeater-add").disableSelection().click(function(i){i.preventDefault(),n.closest(".siteorigin-widget-field-repeater").sowAddRepeaterItem().find("> .siteorigin-widget-field-repeater-items").slideDown("fast",function(){e(window).resize()})}),n.find("> .siteorigin-widget-field-repeater-top > .siteorigin-widget-field-repeater-expand").click(function(i){i.preventDefault(),n.closest(".siteorigin-widget-field-repeater").find("> .siteorigin-widget-field-repeateritems-").slideToggle("fast",function(){e(window).resize()})})})},e.fn.sowAddRepeaterItem=function(){return e(this).each(function(i,t){var n=e(t),a=n.find("> .siteorigin-widget-field-repeater-items").children().length+1,r=e("<div>"+n.find("> .siteorigin-widget-field-repeater-item-html").html()+"</div>");r.find("[data-name]").each(function(){var i=e(this);0===i.closest(".siteorigin-widget-field-repeater-item-html").length&&i.attr("name",e(this).data("name"))});var s=r.html().replace(/_id_/g,a),o="undefined"!=typeof n.attr("readonly"),d=e('<div class="siteorigin-widget-field-repeater-item ui-draggable" />').append(e('<div class="siteorigin-widget-field-repeater-item-top" />').append(e('<div class="siteorigin-widget-field-expand" />')).append(o?"":e('<div class="siteorigin-widget-field-copy" />')).append(o?"":e('<div class="siteorigin-widget-field-remove" />')).append(e("<h4 />").html(n.data("item-name")))).append(e('<div class="siteorigin-widget-field-repeater-item-form" />').html(s));n.find("> .siteorigin-widget-field-repeater-items").append(d).sortable("refresh").trigger("updateFieldPositions"),d.sowSetupRepeaterItems(),d.hide().slideDown("fast",function(){e(window).resize()})})},e.fn.sowRemoveRepeaterItem=function(){return e(this).each(function(i,t){var n=e(this).closest(".siteorigin-widget-field-repeater-items");e(this).remove(),n.sortable("refresh").trigger("updateFieldPositions")})},e.fn.sowSetupRepeaterItems=function(){return e(this).each(function(i,t){var n=e(t);if("undefined"==typeof n.data("sowrepeater-actions-setup")){var a=n.closest(".siteorigin-widget-field-repeater"),r=n.find("> .siteorigin-widget-field-repeater-item-top"),s=a.data("item-label");if(s&&s.selector){var o=function(){var e=s.hasOwnProperty("valueMethod")&&s.valueMethod?s.valueMethod:"val",i=n.find(s.selector)[e]();i&&(i.length>80&&(i=i.substr(0,79)+"..."),r.find("h4").text(i))};o();var d=s.hasOwnProperty("updateEvent")&&s.updateEvent?s.updateEvent:"change";n.bind(d,o)}r.click(function(i){"siteorigin-widget-field-remove"!==i.target.className&&"siteorigin-widget-field-copy"!==i.target.className&&(i.preventDefault(),e(this).closest(".siteorigin-widget-field-repeater-item").find(".siteorigin-widget-field-repeater-item-form").eq(0).slideToggle("fast",function(){e(window).resize(),e(this).is(":visible")?e(this).trigger("slideToggleOpenComplete"):e(this).trigger("slideToggleCloseComplete")}))}),r.find(".siteorigin-widget-field-remove").click(function(i){if(i.preventDefault(),confirm(soWidgets.sure)){var t=e(this).closest(".siteorigin-widget-field-repeater-items");e(this).closest(".siteorigin-widget-field-repeater-item").slideUp("fast",function(){e(this).remove(),t.sortable("refresh").trigger("updateFieldPositions"),e(window).resize()})}}),r.find(".siteorigin-widget-field-copy").click(function(i){i.preventDefault();var t=e(this).closest(".siteorigin-widget-form-main"),a=e(this).closest(".siteorigin-widget-field-repeater-item"),r=a.clone(),s=a.closest(".siteorigin-widget-field-repeater-items"),o=s.children().length,d={};r.find("*[name]").each(function(){var i=e(this),s=i.attr("id"),l=i.attr("name");if(i.is("textarea")&&i.parent().is(".wp-editor-container")&&"undefined"!=typeof tinymce){i.parent().empty().append(i),i.css("display","");var f=tinymce.get(s);f&&i.val(f.getContent())}else if(i.is(".wp-color-picker")){var g=i.closest(".wp-picker-container"),c=i.closest(".siteorigin-widget-field");g.remove(),c.append(i.remove())}else{var u=a.find('[name="'+l+'"]');u.length&&null!=u.val()&&i.val(u.val())}if(s){var p=s.replace(/-\d+$/,"");d[p]||(d[p]=t.find(".siteorigin-widget-input[id^="+p+"]").not("[id*=_id_]").length+1);var w=p+"-"+d[p]++;i.attr("id",w),r.find("label[for="+s+"]").attr("for",w),r.find("[id*="+s+"]").each(function(){var i=e(this).attr("id"),t=i.replace(s,w);e(this).attr("id",t)}),"undefined"!=typeof tinymce&&tinymce.get(w)&&tinymce.get(w).remove()}var m=a.parents(".siteorigin-widget-field-repeater").length,v=e("body");(v.hasClass("wp-customizer")||v.hasClass("widgets-php"))&&0==n.closest(".panel-dialog").length&&(m+=1);var h=l.replace(new RegExp("((?:.*?\\[\\d+\\]){"+(m-1).toString()+"})?(.*?\\[)\\d+(\\])"),"$1$2"+o.toString()+"$3");i.attr("name",h),i.data("original-name",h)}),s.append(r).sortable("refresh").trigger("updateFieldPositions"),r.sowSetupRepeaterItems(),r.hide().slideDown("fast",function(){e(window).resize()})}),n.find("> .siteorigin-widget-field-repeater-item-form").sowSetupForm(),n.data("sowrepeater-actions-setup",!0)}})};var i={getRepeaterId:function(e){"undefined"==typeof this.id&&(this.id=1);var i=e.closest(".siteorigin-widget-field-repeater-item");if(i.length){var t=i.data("item-id");return void 0===t&&(t=this.id++),i.data("item-id",t),t}return!1},getWidgetFieldVariable:function(e,i,t){var n=window.sow_field_javascript_variables[e];i=i.replace(/\[#.*?#\]/g,"");for(var a=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(i)[1],r=a.split("]["),s=r.length?n:null;r.length;)s=s[r.shift()];return s[t]},fetchWidgetVariable:function(i,t,n){window.sowVars=window.sowVars||{},"undefined"==typeof window.sowVars[t]?e.post(soWidgets.ajaxurl,{action:"sow_get_javascript_variables",widget:t,key:i},function(e){window.sowVars[t]=e,n(window.sowVars[t][i])}):n(window.sowVars[t][i])}};window.sowForms=i,e(".widgets-holder-wrap").on("click",".widget:has(.siteorigin-widget-form-main) .widget-top",function(){var i=e(this).closest(".widget").find(".siteorigin-widget-form-main");setTimeout(function(){i.sowSetupForm()},200)}),e("body").hasClass("wp-customizer")&&e(document).on("widget-added",function(e,i){i.find(".siteorigin-widget-form").sowSetupForm()}),e(document).on("dialogopen",function(i){e(i.target).find(".siteorigin-widget-form-main").sowSetupForm()}),e(document).trigger("sowadminloaded")}(jQuery);var sowEmitters={_match:function(e,i){"undefined"==typeof i&&(i=".*");var t=new RegExp("^([a-zA-Z0-9_-]+)(\\[([a-zA-Z0-9_-]+)\\])? *: *("+i+") *$"),n=t.exec(e);if(null===n)return!1;var a="",r="default";return void 0!==n[3]?(r=n[1],a=n[3]):a=n[1],{match:n[4].trim(),group:r,state:a}},_checker:function(e,i,t,n){var a={};"undefined"==typeof i.length&&(i=[i]);for(var r,s=0;s<i.length;s++)r=sowEmitters._match(i[s],t),r!==!1&&("_true"===r.match||n(e,i,r.match))&&(a[r.group]=r.state);return a},select:function(e,i){"undefined"==typeof i.length&&(i=[i]);for(var t={},n=0;n<i.length;n++)""===i[n]&&(i[n]="default"),t[i[n]]=e;return t},conditional:function(val,args){return sowEmitters._checker(val,args,"[^;{}]*",function(val,args,match){return eval(match)})},"in":function(e,i){return sowEmitters._checker(e,i,"[^;{}]*",function(e,i,t){return-1!==t.split(",").map(function(e){return e.trim()}).indexOf(e)})}};
|
1 |
+
!function(e){e.fn.sowSetupForm=function(){return e(this).each(function(i,t){var n,a,r=e(t),s=!0,o=r.find("input[name]");if(o.length&&-1!==o.attr("name").indexOf("__i__"))return this;if(r.is(".siteorigin-widget-form-main")){if(r.data("sow-form-setup")===!0)return!0;if(e("body").hasClass("widgets-php")&&!r.is(":visible")&&0===r.closest(".panel-dialog").length)return!0;r.on("sowstatechange",function(i,t,n){r.find("[data-state-handler]").each(function(){var i=e(this),a=e.extend({},i.data("state-handler"),s?i.data("state-handler-initial"):{});if(0===Object.keys(a).length)return!0;var r,o,d,l,f,c,g={},u=window.sowForms.getRepeaterId(i);if(u!==!1){var p={};for(var w in a)p[w.replace("{$repeater}",u)]=a[w];a=p}for(var w in a)if(f=!1,r=w.match(/^([a-zA-Z0-9_-]+)(\[([a-zA-Z0-9_\-,]+)\])?(\[\])?$/),null!==r){if(o={group:"default",name:"",multi:!1},void 0!==r[2]?(o.group=r[1],o.name=r[3]):o.name=r[0],o.multi=void 0!==r[4],"_else"===o.group)o.group=o.name,o.name="",f=o.group===t&&"undefined"==typeof g[o.group];else{c=o.name.split(",").map(function(e){return e.trim()});for(var m=0;m<c.length&&!(f=o.group===t&&c[m]===n);m++);}if(f){d=a[w],o.multi||(d=[d]);for(var m=0;m<d.length;m++)l="undefined"!=typeof d[m][1]&&Boolean(d[m][1])?i.find(d[m][1]):i,l[d[m][0]].apply(l,"undefined"!=typeof d[m][2]?d[m][2]:[]);g[o.group]=!0}}})}),r.sowSetupPreview(),n=r}else n=r.closest(".siteorigin-widget-form-main");a=n.find("> .siteorigin-widgets-form-id").val();var d=r.find("> .siteorigin-widget-field");d.find("> .siteorigin-widget-section").sowSetupForm(),d.filter(".siteorigin-widget-field-type-widget:not(:has(> .siteorigin-widget-section))").sowSetupForm(),d.find(".siteorigin-widget-input").each(function(i,t){null===e(t).data("original-name")&&e(t).data("original-name",e(t).attr("name"))}),d.find("> .siteorigin-widget-field-repeater").sowSetupRepeater(),r.find(".siteorigin-widget-field-repeater-item").sowSetupRepeaterItems(),d.find("> .siteorigin-widget-input-color").wpColorPicker(),d.find("> .media-field-wrapper").each(function(){var i=e(this),t=i.closest(".siteorigin-widget-field");i.find("a.media-upload-button").click(function(i){if("undefined"!=typeof wp.media){var n=e(this),a=e(this).closest(".siteorigin-widget-field"),r=e(this).data("frame");return r?(r.open(),!1):(r=wp.media({title:n.data("choose"),library:{type:n.data("library").split(",").map(function(e){return e.trim()})},button:{text:n.data("update"),close:!1}}),n.data("frame",r),r.on("select",function(){var e=r.state().get("selection").first().attributes;a.find(".current .title").html(e.title);var i=a.find("input[type=hidden]");i.val(e.id),i.trigger("change"),"undefined"!=typeof e.sizes?"undefined"!=typeof e.sizes.thumbnail?a.find(".current .thumbnail").attr("src",e.sizes.thumbnail.url).fadeIn():a.find(".current .thumbnail").attr("src",e.sizes.full.url).fadeIn():a.find(".current .thumbnail").attr("src",e.icon).fadeIn(),t.find(".media-remove-button").removeClass("remove-hide"),r.close()}),r.open(),!1)}}),i.find(".current").mouseenter(function(){var i=e(this).find(".title");""!==i.html()&&i.fadeIn("fast")}).mouseleave(function(){e(this).find(".title").clearQueue().fadeOut("fast")}),t.find("a.media-remove-button").click(function(i){i.preventDefault(),t.find(".current .title").html(""),t.find("input[type=hidden]").val(""),t.find(".current .thumbnail").fadeOut("fast"),e(this).addClass("remove-hide")})}),d.filter(".siteorigin-widget-field-type-widget, .siteorigin-widget-field-type-section").find("> label").click(function(){e(this);e(this).toggleClass("siteorigin-widget-section-visible"),e(this).siblings(".siteorigin-widget-section").slideToggle(function(){e(window).resize(),e(this).find("> .siteorigin-widget-field-container-state").val(e(this).is(":visible")?"open":"closed")})});var l={};d.filter(".siteorigin-widget-field-type-icon").each(function(){var i=e(this),t=i.find(".siteorigin-widget-icon-selector"),n=t.find(".siteorigin-widget-icon-icon"),a=i.find(".siteorigin-widget-icon-selector-current");a.click(function(){t.slideToggle()});var r=function(){var i=t.find("select.siteorigin-widget-icon-family").val(),r=t.find(".siteorigin-widget-icon-icons");if("undefined"!=typeof l[i]){r.empty(),0===e("#siteorigin-widget-font-"+i).length&&e("<link rel='stylesheet' type='text/css'>").attr("id","siteorigin-widget-font-"+i).attr("href",l[i].style_uri).appendTo("head");for(var s in l[i].icons){var o=e('<div data-sow-icon="'+l[i].icons[s]+'"/>').attr("data-value",i+"-"+s).addClass("sow-icon-"+i).addClass("siteorigin-widget-icon-icons-icon").click(function(){var s=e(this);s.hasClass("siteorigin-widget-active")?(s.removeClass("siteorigin-widget-active"),n.val(""),a.find("span").hide()):(r.find(".siteorigin-widget-icon-icons-icon").removeClass("siteorigin-widget-active"),s.addClass("siteorigin-widget-active"),n.val(s.data("value")),a.find("span").show().attr("data-sow-icon",s.attr("data-sow-icon")).attr("class","").addClass("sow-icon-"+i)),n.trigger("change"),t.slideUp()});r.append(o),n.val()===i+"-"+s&&(a.find("span").show().attr("data-sow-icon",o.attr("data-sow-icon")).attr("class","").addClass("sow-icon-"+i),o.addClass("siteorigin-widget-active"))}r.prepend(r.find(".siteorigin-widget-active"))}},s=function(){var i=t.find("select.siteorigin-widget-icon-family").val();"undefined"!=typeof i&&""!==i&&("undefined"==typeof l[i]?e.getJSON(soWidgets.ajaxurl,{action:"siteorigin_widgets_get_icons",family:t.find("select.siteorigin-widget-icon-family").val()},function(e){l[i]=e,r()}):r())};s(),t.find("select.siteorigin-widget-icon-family").change(function(){t.find(".siteorigin-widget-icon-icons").empty(),s()})}),d.filter(".siteorigin-widget-field-type-slider").each(function(){var i=e(this),t=i.find('input[type="number"]'),n=i.find(".siteorigin-widget-value-slider");n.slider({max:parseInt(t.attr("max")),min:parseInt(t.attr("min")),value:parseInt(t.val()),slide:function(e,n){t.val(parseInt(n.value)),i.find(".siteorigin-widget-slider-value").html(n.value)}})}),d.filter(".siteorigin-widget-field-type-link").each(function(){var i=e(this),t=null,n=function(){null!==t&&t.abort();var n=i.find(".content-text-search").val(),a=i.find("ul.posts").empty().addClass("loading");e.get(soWidgets.ajaxurl,{action:"so_widgets_search_posts",query:n},function(i){for(var t=0;t<i.length;t++)""===i[t].post_title&&(i[t].post_title=" "),a.append(e("<li>").addClass("post").html(i[t].post_title+"<span>("+i[t].post_type+")</span>").data(i[t]));a.removeClass("loading")})};i.find(".select-content-button, .button-close").click(function(t){t.preventDefault(),e(this).blur();var a=i.find(".existing-content-selector");a.toggle(),a.is(":visible")&&0===a.find("ul.posts li").length&&n()}),i.on("click",".posts li",function(t){t.preventDefault();var n=e(this);i.find("input.siteorigin-widget-input").val("post: "+n.data("ID")),i.find(".existing-content-selector").toggle()});var a=null;i.find(".content-text-search").keyup(function(){null!==a&&clearTimeout(a),a=setTimeout(function(){n()},500)})});var f=function(){var i=e(this),t=i.closest("[data-state-emitter]").data("state-emitter");if("undefined"!=typeof t){var a=function(t,n){if("undefined"==typeof sowEmitters[t.callback]||"_"===t.callback.substr(0,1))return n;var a=window.sowForms.getRepeaterId(i);return a!==!1&&(t.args=t.args.map(function(e){return e.replace("{$repeater}",a)})),e.extend(n,sowEmitters[t.callback](i.val(),t.args))},r={"default":""};"undefined"==typeof t.length&&(t=[t]);for(var s=0;s<t.length;s++)r=a(t[s],r);var o=n.data("states");"undefined"==typeof o&&(o={"default":""});for(var d in r)("undefined"==typeof o[d]||r[d]!==o[d])&&(o[d]=r[d],n.trigger("sowstatechange",[d,r[d]]));n.data("states",o)}};d.filter("[data-state-emitter]").each(function(){e(this).find(".siteorigin-widget-input").on("keyup change",f),e(this).find(".siteorigin-widget-input").each(function(){var i=e(this);i.is(":radio")?i.is(":checked")&&f.call(i[0]):f.call(i[0])})}),r.trigger("sowsetupform",d).data("sow-form-setup",!0),r.find(".siteorigin-widget-field-repeater-item").trigger("updateFieldPositions"),s=!1})},e.fn.sowSetupPreview=function(){var i=e(this),t=i.siblings(".siteorigin-widget-preview");t.find("> a").click(function(t){t.preventDefault();var n={};i.find("*[name]").each(function(){var i=e(this),t=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(i.attr("name"));if(void 0===t)return!0;t=t[1];var a=t.split("][");a=a.map(function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e});for(var r=n,s=0;s<a.length;s++)if(s===a.length-1)if("checkbox"===i.attr("type"))i.is(":checked")?r[a[s]]=""!==i.val()?i.val():!0:r[a[s]]=!1;else if("radio"===i.attr("type"))i.is(":checked")&&(r[a[s]]=""!==i.val()?i.val():!0);else if("TEXTAREA"===i.prop("tagName")&&i.hasClass("wp-editor-area")){var o=null;"undefined"!=typeof tinyMCE&&(o=tinyMCE.get(i.attr("id"))),null===o||"function"!=typeof o.getContent||o.isHidden()?r[a[s]]=i.val():r[a[s]]=o.getContent()}else r[a[s]]=i.val();else"undefined"==typeof r[a[s]]&&(r[a[s]]={}),r=r[a[s]]});var a=e(e("#so-widgets-bundle-tpl-preview-dialog").html().trim()).appendTo("body");a.find('input[name="data"]').val(JSON.stringify(n)),a.find('input[name="class"]').val(i.data("class")),a.find("iframe").on("load",function(){e(this).css("visibility","visible")}),a.find("form").submit(),a.find(".close").click(function(){a.remove()})})},e.fn.sowSetupRepeater=function(){return e(this).each(function(i,t){var n=e(t),a=n.find(".siteorigin-widget-field-repeater-items"),r=n.data("repeater-name");a.bind("updateFieldPositions",function(){var i=e(this),t=i.find("> .siteorigin-widget-field-repeater-item");t.each(function(i,t){e(t).find(".siteorigin-widget-input").each(function(t,n){var a=e(n).data("repeater-positions");"undefined"==typeof a&&(a={}),a[r]=i,e(n).data("repeater-positions",a)})}),i.find(".siteorigin-widget-input").each(function(i,t){var n=e(t).data("repeater-positions"),a=e(t);if("undefined"!=typeof n){var r=a.data("original-name");if("undefined"==typeof r&&(a.data("original-name",a.attr("name")),r=a.attr("name")),!r)return;for(var s in n)r=r.replace("#"+s+"#",n[s]);e(t).attr("name",r)}});var a=n.data("scroll-count")?parseInt(n.data("scroll-count")):0;if(a>0&&t.length>a){var s=t.first().outerHeight();i.css("max-height",s*a).css("overflow","auto")}else i.css("max-height","").css("overflow","")}),a.sortable({handle:".siteorigin-widget-field-repeater-item-top",items:"> .siteorigin-widget-field-repeater-item",update:function(){a.trigger("updateFieldPositions")}}),a.trigger("updateFieldPositions"),n.find("> .siteorigin-widget-field-repeater-add").disableSelection().click(function(i){i.preventDefault(),n.closest(".siteorigin-widget-field-repeater").sowAddRepeaterItem().find("> .siteorigin-widget-field-repeater-items").slideDown("fast",function(){e(window).resize()})}),n.find("> .siteorigin-widget-field-repeater-top > .siteorigin-widget-field-repeater-expand").click(function(i){i.preventDefault(),n.closest(".siteorigin-widget-field-repeater").find("> .siteorigin-widget-field-repeateritems-").slideToggle("fast",function(){e(window).resize()})})})},e.fn.sowAddRepeaterItem=function(){return e(this).each(function(i,t){var n=e(t),a=n.find("> .siteorigin-widget-field-repeater-items").children().length+1,r=e("<div>"+n.find("> .siteorigin-widget-field-repeater-item-html").html()+"</div>");r.find("[data-name]").each(function(){var i=e(this);0===i.closest(".siteorigin-widget-field-repeater-item-html").length&&i.attr("name",e(this).data("name"))});var s=r.html().replace(/_id_/g,a),o="undefined"!=typeof n.attr("readonly"),d=e('<div class="siteorigin-widget-field-repeater-item ui-draggable" />').append(e('<div class="siteorigin-widget-field-repeater-item-top" />').append(e('<div class="siteorigin-widget-field-expand" />')).append(o?"":e('<div class="siteorigin-widget-field-copy" />')).append(o?"":e('<div class="siteorigin-widget-field-remove" />')).append(e("<h4 />").html(n.data("item-name")))).append(e('<div class="siteorigin-widget-field-repeater-item-form" />').html(s));n.find("> .siteorigin-widget-field-repeater-items").append(d).sortable("refresh").trigger("updateFieldPositions"),d.sowSetupRepeaterItems(),d.hide().slideDown("fast",function(){e(window).resize()})})},e.fn.sowRemoveRepeaterItem=function(){return e(this).each(function(i,t){var n=e(this).closest(".siteorigin-widget-field-repeater-items");e(this).remove(),n.sortable("refresh").trigger("updateFieldPositions")})},e.fn.sowSetupRepeaterItems=function(){return e(this).each(function(i,t){var n=e(t);if("undefined"==typeof n.data("sowrepeater-actions-setup")){var a=n.closest(".siteorigin-widget-field-repeater"),r=n.find("> .siteorigin-widget-field-repeater-item-top"),s=a.data("item-label");if(s&&s.selector){var o=function(){var e=s.hasOwnProperty("valueMethod")&&s.valueMethod?s.valueMethod:"val",i=n.find(s.selector)[e]();i&&(i.length>80&&(i=i.substr(0,79)+"..."),r.find("h4").text(i))};o();var d=s.hasOwnProperty("updateEvent")&&s.updateEvent?s.updateEvent:"change";n.bind(d,o)}r.click(function(i){"siteorigin-widget-field-remove"!==i.target.className&&"siteorigin-widget-field-copy"!==i.target.className&&(i.preventDefault(),e(this).closest(".siteorigin-widget-field-repeater-item").find(".siteorigin-widget-field-repeater-item-form").eq(0).slideToggle("fast",function(){e(window).resize(),e(this).is(":visible")?e(this).trigger("slideToggleOpenComplete"):e(this).trigger("slideToggleCloseComplete")}))}),r.find(".siteorigin-widget-field-remove").click(function(i){if(i.preventDefault(),confirm(soWidgets.sure)){var t=e(this).closest(".siteorigin-widget-field-repeater-items");e(this).closest(".siteorigin-widget-field-repeater-item").slideUp("fast",function(){e(this).remove(),t.sortable("refresh").trigger("updateFieldPositions"),e(window).resize()})}}),r.find(".siteorigin-widget-field-copy").click(function(i){i.preventDefault();var t=e(this).closest(".siteorigin-widget-form-main"),a=e(this).closest(".siteorigin-widget-field-repeater-item"),r=a.clone(),s=a.closest(".siteorigin-widget-field-repeater-items"),o=s.children().length,d={};r.find("*[name]").each(function(){var i=e(this),s=i.attr("id"),l=i.attr("name");if(i.is("textarea")&&i.parent().is(".wp-editor-container")&&"undefined"!=typeof tinymce){i.parent().empty().append(i),i.css("display","");var f=tinymce.get(s);f&&i.val(f.getContent())}else if(i.is(".wp-color-picker")){var c=i.closest(".wp-picker-container"),g=i.closest(".siteorigin-widget-field");c.remove(),g.append(i.remove())}else{var u=a.find('[name="'+l+'"]');u.length&&null!=u.val()&&i.val(u.val())}if(s){var p=s.replace(/-\d+$/,"");d[p]||(d[p]=t.find(".siteorigin-widget-input[id^="+p+"]").not("[id*=_id_]").length+1);var w=p+"-"+d[p]++;i.attr("id",w),r.find("label[for="+s+"]").attr("for",w),r.find("[id*="+s+"]").each(function(){var i=e(this).attr("id"),t=i.replace(s,w);e(this).attr("id",t)}),"undefined"!=typeof tinymce&&tinymce.get(w)&&tinymce.get(w).remove()}var m=a.parents(".siteorigin-widget-field-repeater").length,v=e("body");(v.hasClass("wp-customizer")||v.hasClass("widgets-php"))&&0==n.closest(".panel-dialog").length&&(m+=1);var h=l.replace(new RegExp("((?:.*?\\[\\d+\\]){"+(m-1).toString()+"})?(.*?\\[)\\d+(\\])"),"$1$2"+o.toString()+"$3");i.attr("name",h),i.data("original-name",h)}),s.append(r).sortable("refresh").trigger("updateFieldPositions"),r.sowSetupRepeaterItems(),r.hide().slideDown("fast",function(){e(window).resize()})}),n.find("> .siteorigin-widget-field-repeater-item-form").sowSetupForm(),n.data("sowrepeater-actions-setup",!0)}})};var i={getRepeaterId:function(e){"undefined"==typeof this.id&&(this.id=1);var i=e.closest(".siteorigin-widget-field-repeater-item");if(i.length){var t=i.data("item-id");return void 0===t&&(t=this.id++),i.data("item-id",t),t}return!1},getWidgetFieldVariable:function(e,i,t){var n=window.sow_field_javascript_variables[e];i=i.replace(/\[#.*?#\]/g,"");for(var a=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(i)[1],r=a.split("]["),s=r.length?n:null;r.length;)s=s[r.shift()];return s[t]},fetchWidgetVariable:function(i,t,n){window.sowVars=window.sowVars||{},"undefined"==typeof window.sowVars[t]?e.post(soWidgets.ajaxurl,{action:"sow_get_javascript_variables",widget:t,key:i},function(e){window.sowVars[t]=e,n(window.sowVars[t][i])}):n(window.sowVars[t][i])}};window.sowForms=i,e(".widgets-holder-wrap").on("click",".widget:has(.siteorigin-widget-form-main) .widget-top",function(){var i=e(this).closest(".widget").find(".siteorigin-widget-form-main");setTimeout(function(){i.sowSetupForm()},200)}),e("body").hasClass("wp-customizer")&&e(document).on("widget-added",function(e,i){i.find(".siteorigin-widget-form").sowSetupForm()}),e(document).on("dialogopen",function(i){e(i.target).find(".siteorigin-widget-form-main").sowSetupForm()}),e(document).trigger("sowadminloaded")}(jQuery);var sowEmitters={_match:function(e,i){"undefined"==typeof i&&(i=".*");var t=new RegExp("^([a-zA-Z0-9_-]+)(\\[([a-zA-Z0-9_-]+)\\])? *: *("+i+") *$"),n=t.exec(e);if(null===n)return!1;var a="",r="default";return void 0!==n[3]?(r=n[1],a=n[3]):a=n[1],{match:n[4].trim(),group:r,state:a}},_checker:function(e,i,t,n){var a={};"undefined"==typeof i.length&&(i=[i]);for(var r,s=0;s<i.length;s++)r=sowEmitters._match(i[s],t),r!==!1&&("_true"===r.match||n(e,i,r.match))&&(a[r.group]=r.state);return a},select:function(e,i){"undefined"==typeof i.length&&(i=[i]);for(var t={},n=0;n<i.length;n++)""===i[n]&&(i[n]="default"),t[i[n]]=e;return t},conditional:function(val,args){return sowEmitters._checker(val,args,"[^;{}]*",function(val,args,match){return eval(match)})},"in":function(e,i){return sowEmitters._checker(e,i,"[^;{}]*",function(e,i,t){return-1!==t.split(",").map(function(e){return e.trim()}).indexOf(e)})}};
|
base/js/posts-selector.js
CHANGED
@@ -355,7 +355,7 @@ var soWidgetPostSelector = ( function ($, _) {
|
|
355 |
|
356 |
// The additional query arguments field
|
357 |
this.form.append('<div class="query-builder-form-field">' + sowPostsSelectorTpl.fields.additional + '</div>');
|
358 |
-
if( typeof this.model.get('additional') !== 'undefined' ) this.form.find('input[name="additional"]').val( this.model.get('additional'));
|
359 |
|
360 |
|
361 |
var orderField = this.form.find('input[name="order"]');
|
@@ -468,7 +468,7 @@ var soWidgetPostSelector = ( function ($, _) {
|
|
468 |
this.model.set( 'order', this.$el.find('*[name="order"]').val() );
|
469 |
this.model.set( 'posts_per_page', this.$el.find('*[name="posts_per_page"]').val() );
|
470 |
this.model.set( 'sticky', this.$el.find('*[name="sticky"]').val() );
|
471 |
-
this.model.set( 'additional', this.$el.find('*[name="additional"]').val() );
|
472 |
|
473 |
this.model.set( 'query', this.model.getQuery() );
|
474 |
|
355 |
|
356 |
// The additional query arguments field
|
357 |
this.form.append('<div class="query-builder-form-field">' + sowPostsSelectorTpl.fields.additional + '</div>');
|
358 |
+
if( typeof this.model.get('additional') !== 'undefined' ) this.form.find('input[name="additional"]').val( this.model.get('additional').split(',').join('&'));
|
359 |
|
360 |
|
361 |
var orderField = this.form.find('input[name="order"]');
|
468 |
this.model.set( 'order', this.$el.find('*[name="order"]').val() );
|
469 |
this.model.set( 'posts_per_page', this.$el.find('*[name="posts_per_page"]').val() );
|
470 |
this.model.set( 'sticky', this.$el.find('*[name="sticky"]').val() );
|
471 |
+
this.model.set( 'additional', this.$el.find('*[name="additional"]').val().split('&').join(',') );
|
472 |
|
473 |
this.model.set( 'query', this.model.getQuery() );
|
474 |
|
base/js/posts-selector.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var soWidgetPostSelector=function(e,t){var s,i,o,n,r,l,d,a;s=self.Post=Backbone.Model.extend({title:null,thumbnail:null,id:null}),i=self.PostCollection=Backbone.Collection.extend({model:s,foundPosts:null,updateWithQuery:function(t){if(""!==t){var s=this;e.post(sowPostsSelectorTpl.ajaxurl,{action:"sow_get_posts",query:t,ignore_pagination:!0},function(e){s.foundPosts=e.found_posts,s.reset(e.posts)})}}}),l=self.Query=Backbone.Model.extend({query:null,syncField:null,post_type:null,terms:null,post_status:null,posts_per_page:null,post__in:null,tax_query:null,date_range:null,orderby:null,order:null,sticky:null,defaults:{post_type:"post",orderby:"post_date",order:"DESC",posts_per_page:"",post_status:"publish",sticky:""},initialize:function(e,t){this.set(this.parseQuery(e.query))},getQuery:function(){var e=[];return"undefined"!=typeof this.get("post_type")&&e.push("post_type="+this.get("post_type")),"undefined"==typeof this.get("post__in")||t.isEmpty(this.get("post__in"))||e.push("post__in="+this.get("post__in").join(",")),"undefined"==typeof this.get("tax_query")||t.isEmpty(this.get("tax_query"))||e.push("tax_query="+this.get("tax_query").join(",")),"undefined"==typeof this.get("date_query")||t.isEmpty(this.get("date_query"))||e.push("date_query="+JSON.stringify(this.get("date_query"))),"undefined"!=typeof this.get("orderby")&&e.push("orderby="+this.get("orderby")),"undefined"!=typeof this.get("order")&&e.push("order="+this.get("order")),"undefined"!=typeof this.get("posts_per_page")&&e.push("posts_per_page="+this.get("posts_per_page")),"undefined"!=typeof this.get("sticky")&&e.push("sticky="+this.get("sticky")),"undefined"!=typeof this.get("additional")&&e.push("additional="+this.get("additional")),e.join("&")},setQuery:function(e){return this.set(this.parseQuery(e)),this},parseQuery:function(e){for(var t,s=/([^&=]+)=?([^&]*)/g,i=/\+/g,o=function(e){return decodeURIComponent(e.replace(i," "))},n={};t=s.exec(e);){var r=o(t[1]),l=o(t[2]);"[]"===r.substring(r.length-2)?(r=r.substring(0,r.length-2),(n[r]||(n[r]=[])).push(l)):n[r]=l}var d={};return n.hasOwnProperty("post_type")&&(d.post_type=n.post_type),n.hasOwnProperty("post__in")&&(d.post__in=n.post__in.split(",")),n.hasOwnProperty("tax_query")&&(d.tax_query=n.tax_query.split(",")),n.hasOwnProperty("date_query")&&(d.date_query=JSON.parse(n.date_query)),n.hasOwnProperty("orderby")&&(d.orderby=n.orderby),n.hasOwnProperty("order")&&(d.order=n.order),n.hasOwnProperty("posts_per_page")&&(d.posts_per_page=n.posts_per_page),n.hasOwnProperty("sticky")&&(d.sticky=n.sticky),n.hasOwnProperty("additional")&&(d.additional=n.additional),d.query=e,d},sync:function(e,t){if("create"===e){var s=this.syncField.val(),i=this.getQuery();s!==i&&(this.syncField.val(i),this.syncField.trigger("change"))}else this.setQuery(this.syncField.val())},setSyncField:function(e){this.syncField=e}}),a=self.QueryBuilder=Backbone.View.extend({attached:!1,rendered:!1,views:{},activeView:null,events:{"click .media-modal-backdrop, .media-modal-close":"escapeHandler","click .media-toolbar-primary .button":"buttonHandler"},initialize:function(){this.listenTo(this.model,"change",this.queryModelChange);var e=new i;this.views.postSummary=new o({posts:e,el:this.el}),this.views.postSummary.builder=this,this.views.postSummary.posts.updateWithQuery(this.model.getQuery()),this.addSubView("form",new d({el:this.el,model:this.model})),this.addSubView("postsView",new n({el:this.el,posts:e})),this.addSubView("postsSelect",new r({el:this.el,model:this.model})),this.views.form.bind("buttonHandler",this.close,this)},changeModel:function(e){this.model=e,this.render()},render:function(){return this.$el.html(sowPostsSelectorTpl.modal),this.$el.find(".media-toolbar-primary .button").html(this.views[this.activeView].buttonText),this.$el.find(".media-frame-title h1").html(this.views[this.activeView].modalTitle),this.rendered=!0,"postsSelect"!==this.activeView&&this.views.postSummary.render(),this.views[this.activeView].render(),this},close:function(){return this.$el.hide(),this.trigger("close"),this.model.save(),this},open:function(){this.show(),this.setActiveView("form"),this.trigger("open"),this.model.fetch()},save:function(){this.close(),this.model.save(),this.trigger("save")},attach:function(){return this.rendered||this.render(),this.attached||(this.$el.appendTo("body"),this.attached=!0),this},show:function(){this.attach(),this.$el.is(":visible")||this.$el.show()},escapeHandler:function(e){e.preventDefault(),this.close()},buttonHandler:function(e){e.preventDefault(),this.views[this.activeView].buttonHandler().trigger("buttonHandler")},addSubView:function(e,t){this.views[e]=t,t.builder=this,null===this.activeView&&(this.activeView=e)},setActiveView:function(e){this.activeView=e,this.render()},queryModelChange:function(){this.views.postSummary.posts.updateWithQuery(this.model.getQuery())}}),d=self.QueryForm=Backbone.View.extend({buttonText:"Save Query",modalTitle:"Build Posts Query",form:null,initialize:function(e){},render:function(){var t=this;if(this.form=e('<div class="query-builder-form>"></div>'),this.form.append('<div class="query-builder-form-field">'+sowPostsSelectorTpl.fields.post_type+"</div>"),"undefined"!=typeof this.model.get("post_type")&&this.form.find('select[name="post_type"]').val(this.model.get("post_type")),this.form.append('<div class="query-builder-form-field">'+sowPostsSelectorTpl.fields.post__in+"</div>"),"undefined"!=typeof this.model.get("post__in")&&this.form.find('input[name="post__in"]').val(this.model.get("post__in").join(",")),this.form.append('<div class="query-builder-form-field ui-front">'+sowPostsSelectorTpl.fields.tax_query+"</div>"),"undefined"!=typeof this.model.get("tax_query")&&this.form.find('input[name="tax_query"]').val(this.model.get("tax_query")),this.form.append('<div class="query-builder-form-field">'+sowPostsSelectorTpl.fields.date_query+"</div>"),"undefined"!=typeof this.model.get("date_query")){var s=this.model.get("date_query");s.hasOwnProperty("after")&&this.form.find('input[name="after"]').val(s.after),s.hasOwnProperty("before")&&this.form.find('input[name="before"]').val(s.before)}this.form.append(e('<div class="query-builder-form-field">'+sowPostsSelectorTpl.fields.orderby+"</div>").disableSelection()),"undefined"!=typeof this.model.get("orderby")&&this.form.find('select[name="orderby"]').val(this.model.get("orderby")),"undefined"!=typeof this.model.get("order")&&this.form.find('input[name="order"]').val(this.model.get("order")),this.form.append('<div class="query-builder-form-field">'+sowPostsSelectorTpl.fields.posts_per_page+"</div>"),"undefined"!=typeof this.model.get("posts_per_page")&&this.form.find('input[name="posts_per_page"]').val(this.model.get("posts_per_page")),this.form.append('<div class="query-builder-form-field">'+sowPostsSelectorTpl.fields.sticky+"</div>"),"undefined"!=typeof this.model.get("sticky")&&this.form.find('select[name="sticky"]').val(this.model.get("sticky")),this.form.append('<div class="query-builder-form-field">'+sowPostsSelectorTpl.fields.additional+"</div>"),"undefined"!=typeof this.model.get("additional")&&this.form.find('input[name="additional"]').val(this.model.get("additional"));var i=this.form.find('input[name="order"]'),o=i.closest(".query-builder-form-field").find(".sow-order-button"),n=function(){"DESC"===i.val()?(o.removeClass("sow-order-button-asc"),o.addClass("sow-order-button-desc")):(o.addClass("sow-order-button-asc"),o.removeClass("sow-order-button-desc"))};return n(),o.click(function(e){return e.preventDefault(),"DESC"===i.val()?i.val("ASC"):i.val("DESC"),n(),t.updateModel(),!1}),this.$el.find(".query-builder-content").empty().append(this.form),this.$el.find(".query-builder-form-field select, .query-builder-form-field input").change(function(){t.updateModel()}),this.$el.find(".query-builder-form-field .sow-select-posts").click(function(e){e.preventDefault(),t.builder.setActiveView("postsSelect")}),this.form.find('input[name="tax_query"]').autocomplete({source:function(t,s){e.getJSON(sowPostsSelectorTpl.ajaxurl,{term:t.term.split(/,\s*/).pop(),action:"sow_search_terms"},s)},search:function(){var e=this.value.split(/,\s*/).pop();return e.length<1?!1:void 0},focus:function(){return!1},select:function(e,s){var i=this.value.split(/,\s*/);return i.pop(),i.push(s.item.value),i.push(""),this.value=i.join(", "),t.updateModel(),!1}}),this},updateModel:function(){if(this.model.set("post_type",this.$el.find('*[name="post_type"]').val()),""!==this.$el.find('*[name="post__in"]').val().trim()?this.model.set("post__in",this.$el.find('*[name="post__in"]').val().split(",").map(function(e){return Number(e.trim())})):this.model.set("post__in",[]),""!==this.$el.find('*[name="tax_query"]').val().trim()){var e=this.$el.find('*[name="tax_query"]').val().split(",").map(function(e){return e.trim()});this.model.set("tax_query",t.compact(e))}else this.model.set("tax_query",[]);return this.model.set("date_query",{after:this.$el.find('*[name="after"]').val(),before:this.$el.find('*[name="before"]').val()}),this.model.set("orderby",this.$el.find('*[name="orderby"]').val()),this.model.set("order",this.$el.find('*[name="order"]').val()),this.model.set("posts_per_page",this.$el.find('*[name="posts_per_page"]').val()),this.model.set("sticky",this.$el.find('*[name="sticky"]').val()),this.model.set("additional",this.$el.find('*[name="additional"]').val()),this.model.set("query",this.model.getQuery()),this},buttonHandler:function(){return this.updateModel(),this}}),o=self.PostCollectionSummaryView=Backbone.View.extend({template:t.template(sowPostsSelectorTpl.foundPosts),posts:null,initialize:function(e){this.posts=e.posts,this.posts.bind("reset",this.render,this)},render:function(){this.$el.find(".media-toolbar-secondary").html(this.template({foundPosts:this.posts.foundPosts}));var e=this;this.$el.find(".media-toolbar-secondary .preview-query-posts").click(function(t){t.preventDefault(),e.builder.setActiveView("postsView")})}}),n=self.PostCollectionView=Backbone.View.extend({buttonText:"Back",modalTitle:"Current Posts",template:t.template(sowPostsSelectorTpl.postSummary),posts:null,initialize:function(e){this.posts=e.posts},render:function(){var e=this.$el.find(".query-builder-content").empty().append('<div class="sow-current-posts"></div>').find(".sow-current-posts");e=this.$el.find(".query-builder-content");var t=this.template;return this.posts.each(function(s){e.append(t(s.attributes))}),this},buttonHandler:function(){return this.builder.setActiveView("form"),this}}),r=self.PostSelectView=Backbone.View.extend({buttonText:"Finish Selection",modalTitle:"Select Posts",sortable:null,postCache:{},postTemplate:t.template(sowPostsSelectorTpl.postSummary),initialize:function(){this.postCache={}},render:function(){var t=this.model.get("post__in"),s=this.model.get("post_type");this.$el.find(".query-builder-content").empty().html(sowPostsSelectorTpl.selector),this.sortable=this.$el.find(".query-builder-content #sow-post-selector .sow-posts-sortable").sortable({placeholder:"ui-state-highlight",forcePlaceholderSize:!0,items:"> .sow-post-selector-summary"}),this.addPosts(t);var i=this,o=this.$el.find(".query-builder-content #sow-post-selector .sow-search-field");return o.autocomplete({source:function(t,i){t.type=s,t.action="sow_search_posts",e.get(sowPostsSelectorTpl.ajaxurl,t,i)},minLength:0,select:function(t,s){return t.preventDefault(),e(this).val(""),i.addPosts([s.item.value]),!1}}),o.focusin(function(){o.autocomplete("search",o.val())}),this.$el.find(".query-builder-content").on("click",".sow-remove",function(t){t.preventDefault();var s=e(this);s.closest(".sow-post-selector-summary").fadeOut("fast",function(){e(this).remove(),i.sortable.sortable("refresh")})}),this},addPosts:function(s){if("undefined"!=typeof s&&!t.isEmpty(s)){for(var i=[],o=0;o<s.length;o++)"undefined"==typeof this.postCache[s[o]]&&i.push(s[o]);var n=this;t.isEmpty(i)||e.post(sowPostsSelectorTpl.ajaxurl,{action:"sow_get_posts",query:"post_type=_all&posts_per_page=-1&post__in="+i.join(",")},function(e){console.log(e),"undefined"!=typeof e.posts&&t.each(e.posts,function(e,t){n.postCache[e.id]={id:e.id,title:e.title,thumbnail:e.thumbnail,editUrl:e.editUrl}}),n.refreshLoading()});for(var r,o=0;o<s.length;o++)r="undefined"==typeof this.postCache[s[o]]?e(this.postTemplate({id:s[o],title:"",thumbnail:"",editUrl:"#"})).addClass("sow-post-loading"):e(this.postTemplate(this.postCache[s[o]])),r.appendTo(this.sortable);return this.sortable.sortable("refresh"),this}},refreshLoading:function(){var t=this;this.sortable.find(".sow-post-selector-summary.sow-post-loading").each(function(){var s=e(this),i=s.data("id");if("undefined"!=typeof t.postCache[i]){s.removeClass("sow-post-loading");var o=e(t.postTemplate(t.postCache[i]));s.html(o.html())}})},buttonHandler:function(){var s=[];return this.sortable.find(".sow-post-selector-summary").each(function(){s.push(Number(e(this).data("id")))}),this.model.set("post__in",s),t.isEmpty(s)||(this.model.set("post_type","_all"),this.model.set("orderby","post__in")),this.builder.setActiveView("form"),this}});var u=new a({model:new l({query:""})});jQuery(function(e){e("body").on("click",".sow-select-posts",function(t){t.preventDefault();var s=e(this);u.model.setSyncField(s.siblings(".siteorigin-widget-input")),u.model.sync("update"),u.views.postSummary.posts.on("reset",function(e){s.find(".sow-current-count").text(e.foundPosts)}),u.open()})})}(jQuery,_);
|
1 |
+
var soWidgetPostSelector=function(e,t){var s,i,o,n,r,l,d,a;s=self.Post=Backbone.Model.extend({title:null,thumbnail:null,id:null}),i=self.PostCollection=Backbone.Collection.extend({model:s,foundPosts:null,updateWithQuery:function(t){if(""!==t){var s=this;e.post(sowPostsSelectorTpl.ajaxurl,{action:"sow_get_posts",query:t,ignore_pagination:!0},function(e){s.foundPosts=e.found_posts,s.reset(e.posts)})}}}),l=self.Query=Backbone.Model.extend({query:null,syncField:null,post_type:null,terms:null,post_status:null,posts_per_page:null,post__in:null,tax_query:null,date_range:null,orderby:null,order:null,sticky:null,defaults:{post_type:"post",orderby:"post_date",order:"DESC",posts_per_page:"",post_status:"publish",sticky:""},initialize:function(e,t){this.set(this.parseQuery(e.query))},getQuery:function(){var e=[];return"undefined"!=typeof this.get("post_type")&&e.push("post_type="+this.get("post_type")),"undefined"==typeof this.get("post__in")||t.isEmpty(this.get("post__in"))||e.push("post__in="+this.get("post__in").join(",")),"undefined"==typeof this.get("tax_query")||t.isEmpty(this.get("tax_query"))||e.push("tax_query="+this.get("tax_query").join(",")),"undefined"==typeof this.get("date_query")||t.isEmpty(this.get("date_query"))||e.push("date_query="+JSON.stringify(this.get("date_query"))),"undefined"!=typeof this.get("orderby")&&e.push("orderby="+this.get("orderby")),"undefined"!=typeof this.get("order")&&e.push("order="+this.get("order")),"undefined"!=typeof this.get("posts_per_page")&&e.push("posts_per_page="+this.get("posts_per_page")),"undefined"!=typeof this.get("sticky")&&e.push("sticky="+this.get("sticky")),"undefined"!=typeof this.get("additional")&&e.push("additional="+this.get("additional")),e.join("&")},setQuery:function(e){return this.set(this.parseQuery(e)),this},parseQuery:function(e){for(var t,s=/([^&=]+)=?([^&]*)/g,i=/\+/g,o=function(e){return decodeURIComponent(e.replace(i," "))},n={};t=s.exec(e);){var r=o(t[1]),l=o(t[2]);"[]"===r.substring(r.length-2)?(r=r.substring(0,r.length-2),(n[r]||(n[r]=[])).push(l)):n[r]=l}var d={};return n.hasOwnProperty("post_type")&&(d.post_type=n.post_type),n.hasOwnProperty("post__in")&&(d.post__in=n.post__in.split(",")),n.hasOwnProperty("tax_query")&&(d.tax_query=n.tax_query.split(",")),n.hasOwnProperty("date_query")&&(d.date_query=JSON.parse(n.date_query)),n.hasOwnProperty("orderby")&&(d.orderby=n.orderby),n.hasOwnProperty("order")&&(d.order=n.order),n.hasOwnProperty("posts_per_page")&&(d.posts_per_page=n.posts_per_page),n.hasOwnProperty("sticky")&&(d.sticky=n.sticky),n.hasOwnProperty("additional")&&(d.additional=n.additional),d.query=e,d},sync:function(e,t){if("create"===e){var s=this.syncField.val(),i=this.getQuery();s!==i&&(this.syncField.val(i),this.syncField.trigger("change"))}else this.setQuery(this.syncField.val())},setSyncField:function(e){this.syncField=e}}),a=self.QueryBuilder=Backbone.View.extend({attached:!1,rendered:!1,views:{},activeView:null,events:{"click .media-modal-backdrop, .media-modal-close":"escapeHandler","click .media-toolbar-primary .button":"buttonHandler"},initialize:function(){this.listenTo(this.model,"change",this.queryModelChange);var e=new i;this.views.postSummary=new o({posts:e,el:this.el}),this.views.postSummary.builder=this,this.views.postSummary.posts.updateWithQuery(this.model.getQuery()),this.addSubView("form",new d({el:this.el,model:this.model})),this.addSubView("postsView",new n({el:this.el,posts:e})),this.addSubView("postsSelect",new r({el:this.el,model:this.model})),this.views.form.bind("buttonHandler",this.close,this)},changeModel:function(e){this.model=e,this.render()},render:function(){return this.$el.html(sowPostsSelectorTpl.modal),this.$el.find(".media-toolbar-primary .button").html(this.views[this.activeView].buttonText),this.$el.find(".media-frame-title h1").html(this.views[this.activeView].modalTitle),this.rendered=!0,"postsSelect"!==this.activeView&&this.views.postSummary.render(),this.views[this.activeView].render(),this},close:function(){return this.$el.hide(),this.trigger("close"),this.model.save(),this},open:function(){this.show(),this.setActiveView("form"),this.trigger("open"),this.model.fetch()},save:function(){this.close(),this.model.save(),this.trigger("save")},attach:function(){return this.rendered||this.render(),this.attached||(this.$el.appendTo("body"),this.attached=!0),this},show:function(){this.attach(),this.$el.is(":visible")||this.$el.show()},escapeHandler:function(e){e.preventDefault(),this.close()},buttonHandler:function(e){e.preventDefault(),this.views[this.activeView].buttonHandler().trigger("buttonHandler")},addSubView:function(e,t){this.views[e]=t,t.builder=this,null===this.activeView&&(this.activeView=e)},setActiveView:function(e){this.activeView=e,this.render()},queryModelChange:function(){this.views.postSummary.posts.updateWithQuery(this.model.getQuery())}}),d=self.QueryForm=Backbone.View.extend({buttonText:"Save Query",modalTitle:"Build Posts Query",form:null,initialize:function(e){},render:function(){var t=this;if(this.form=e('<div class="query-builder-form>"></div>'),this.form.append('<div class="query-builder-form-field">'+sowPostsSelectorTpl.fields.post_type+"</div>"),"undefined"!=typeof this.model.get("post_type")&&this.form.find('select[name="post_type"]').val(this.model.get("post_type")),this.form.append('<div class="query-builder-form-field">'+sowPostsSelectorTpl.fields.post__in+"</div>"),"undefined"!=typeof this.model.get("post__in")&&this.form.find('input[name="post__in"]').val(this.model.get("post__in").join(",")),this.form.append('<div class="query-builder-form-field ui-front">'+sowPostsSelectorTpl.fields.tax_query+"</div>"),"undefined"!=typeof this.model.get("tax_query")&&this.form.find('input[name="tax_query"]').val(this.model.get("tax_query")),this.form.append('<div class="query-builder-form-field">'+sowPostsSelectorTpl.fields.date_query+"</div>"),"undefined"!=typeof this.model.get("date_query")){var s=this.model.get("date_query");s.hasOwnProperty("after")&&this.form.find('input[name="after"]').val(s.after),s.hasOwnProperty("before")&&this.form.find('input[name="before"]').val(s.before)}this.form.append(e('<div class="query-builder-form-field">'+sowPostsSelectorTpl.fields.orderby+"</div>").disableSelection()),"undefined"!=typeof this.model.get("orderby")&&this.form.find('select[name="orderby"]').val(this.model.get("orderby")),"undefined"!=typeof this.model.get("order")&&this.form.find('input[name="order"]').val(this.model.get("order")),this.form.append('<div class="query-builder-form-field">'+sowPostsSelectorTpl.fields.posts_per_page+"</div>"),"undefined"!=typeof this.model.get("posts_per_page")&&this.form.find('input[name="posts_per_page"]').val(this.model.get("posts_per_page")),this.form.append('<div class="query-builder-form-field">'+sowPostsSelectorTpl.fields.sticky+"</div>"),"undefined"!=typeof this.model.get("sticky")&&this.form.find('select[name="sticky"]').val(this.model.get("sticky")),this.form.append('<div class="query-builder-form-field">'+sowPostsSelectorTpl.fields.additional+"</div>"),"undefined"!=typeof this.model.get("additional")&&this.form.find('input[name="additional"]').val(this.model.get("additional").split(",").join("&"));var i=this.form.find('input[name="order"]'),o=i.closest(".query-builder-form-field").find(".sow-order-button"),n=function(){"DESC"===i.val()?(o.removeClass("sow-order-button-asc"),o.addClass("sow-order-button-desc")):(o.addClass("sow-order-button-asc"),o.removeClass("sow-order-button-desc"))};return n(),o.click(function(e){return e.preventDefault(),"DESC"===i.val()?i.val("ASC"):i.val("DESC"),n(),t.updateModel(),!1}),this.$el.find(".query-builder-content").empty().append(this.form),this.$el.find(".query-builder-form-field select, .query-builder-form-field input").change(function(){t.updateModel()}),this.$el.find(".query-builder-form-field .sow-select-posts").click(function(e){e.preventDefault(),t.builder.setActiveView("postsSelect")}),this.form.find('input[name="tax_query"]').autocomplete({source:function(t,s){e.getJSON(sowPostsSelectorTpl.ajaxurl,{term:t.term.split(/,\s*/).pop(),action:"sow_search_terms"},s)},search:function(){var e=this.value.split(/,\s*/).pop();return e.length<1?!1:void 0},focus:function(){return!1},select:function(e,s){var i=this.value.split(/,\s*/);return i.pop(),i.push(s.item.value),i.push(""),this.value=i.join(", "),t.updateModel(),!1}}),this},updateModel:function(){if(this.model.set("post_type",this.$el.find('*[name="post_type"]').val()),""!==this.$el.find('*[name="post__in"]').val().trim()?this.model.set("post__in",this.$el.find('*[name="post__in"]').val().split(",").map(function(e){return Number(e.trim())})):this.model.set("post__in",[]),""!==this.$el.find('*[name="tax_query"]').val().trim()){var e=this.$el.find('*[name="tax_query"]').val().split(",").map(function(e){return e.trim()});this.model.set("tax_query",t.compact(e))}else this.model.set("tax_query",[]);return this.model.set("date_query",{after:this.$el.find('*[name="after"]').val(),before:this.$el.find('*[name="before"]').val()}),this.model.set("orderby",this.$el.find('*[name="orderby"]').val()),this.model.set("order",this.$el.find('*[name="order"]').val()),this.model.set("posts_per_page",this.$el.find('*[name="posts_per_page"]').val()),this.model.set("sticky",this.$el.find('*[name="sticky"]').val()),this.model.set("additional",this.$el.find('*[name="additional"]').val().split("&").join(",")),this.model.set("query",this.model.getQuery()),this},buttonHandler:function(){return this.updateModel(),this}}),o=self.PostCollectionSummaryView=Backbone.View.extend({template:t.template(sowPostsSelectorTpl.foundPosts),posts:null,initialize:function(e){this.posts=e.posts,this.posts.bind("reset",this.render,this)},render:function(){this.$el.find(".media-toolbar-secondary").html(this.template({foundPosts:this.posts.foundPosts}));var e=this;this.$el.find(".media-toolbar-secondary .preview-query-posts").click(function(t){t.preventDefault(),e.builder.setActiveView("postsView")})}}),n=self.PostCollectionView=Backbone.View.extend({buttonText:"Back",modalTitle:"Current Posts",template:t.template(sowPostsSelectorTpl.postSummary),posts:null,initialize:function(e){this.posts=e.posts},render:function(){var e=this.$el.find(".query-builder-content").empty().append('<div class="sow-current-posts"></div>').find(".sow-current-posts");e=this.$el.find(".query-builder-content");var t=this.template;return this.posts.each(function(s){e.append(t(s.attributes))}),this},buttonHandler:function(){return this.builder.setActiveView("form"),this}}),r=self.PostSelectView=Backbone.View.extend({buttonText:"Finish Selection",modalTitle:"Select Posts",sortable:null,postCache:{},postTemplate:t.template(sowPostsSelectorTpl.postSummary),initialize:function(){this.postCache={}},render:function(){var t=this.model.get("post__in"),s=this.model.get("post_type");this.$el.find(".query-builder-content").empty().html(sowPostsSelectorTpl.selector),this.sortable=this.$el.find(".query-builder-content #sow-post-selector .sow-posts-sortable").sortable({placeholder:"ui-state-highlight",forcePlaceholderSize:!0,items:"> .sow-post-selector-summary"}),this.addPosts(t);var i=this,o=this.$el.find(".query-builder-content #sow-post-selector .sow-search-field");return o.autocomplete({source:function(t,i){t.type=s,t.action="sow_search_posts",e.get(sowPostsSelectorTpl.ajaxurl,t,i)},minLength:0,select:function(t,s){return t.preventDefault(),e(this).val(""),i.addPosts([s.item.value]),!1}}),o.focusin(function(){o.autocomplete("search",o.val())}),this.$el.find(".query-builder-content").on("click",".sow-remove",function(t){t.preventDefault();var s=e(this);s.closest(".sow-post-selector-summary").fadeOut("fast",function(){e(this).remove(),i.sortable.sortable("refresh")})}),this},addPosts:function(s){if("undefined"!=typeof s&&!t.isEmpty(s)){for(var i=[],o=0;o<s.length;o++)"undefined"==typeof this.postCache[s[o]]&&i.push(s[o]);var n=this;t.isEmpty(i)||e.post(sowPostsSelectorTpl.ajaxurl,{action:"sow_get_posts",query:"post_type=_all&posts_per_page=-1&post__in="+i.join(",")},function(e){console.log(e),"undefined"!=typeof e.posts&&t.each(e.posts,function(e,t){n.postCache[e.id]={id:e.id,title:e.title,thumbnail:e.thumbnail,editUrl:e.editUrl}}),n.refreshLoading()});for(var r,o=0;o<s.length;o++)r="undefined"==typeof this.postCache[s[o]]?e(this.postTemplate({id:s[o],title:"",thumbnail:"",editUrl:"#"})).addClass("sow-post-loading"):e(this.postTemplate(this.postCache[s[o]])),r.appendTo(this.sortable);return this.sortable.sortable("refresh"),this}},refreshLoading:function(){var t=this;this.sortable.find(".sow-post-selector-summary.sow-post-loading").each(function(){var s=e(this),i=s.data("id");if("undefined"!=typeof t.postCache[i]){s.removeClass("sow-post-loading");var o=e(t.postTemplate(t.postCache[i]));s.html(o.html())}})},buttonHandler:function(){var s=[];return this.sortable.find(".sow-post-selector-summary").each(function(){s.push(Number(e(this).data("id")))}),this.model.set("post__in",s),t.isEmpty(s)||(this.model.set("post_type","_all"),this.model.set("orderby","post__in")),this.builder.setActiveView("form"),this}});var u=new a({model:new l({query:""})});jQuery(function(e){e("body").on("click",".sow-select-posts",function(t){t.preventDefault();var s=e(this);u.model.setSyncField(s.siblings(".siteorigin-widget-input")),u.model.sync("update"),u.views.postSummary.posts.on("reset",function(e){s.find(".sow-current-count").text(e.foundPosts)}),u.open()})})}(jQuery,_);
|
base/siteorigin-widget.class.php
CHANGED
@@ -72,6 +72,15 @@ abstract class SiteOrigin_Widget extends WP_Widget {
|
|
72 |
|
73 |
}
|
74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
/**
|
76 |
* Get the form options and allow child widgets to modify that form.
|
77 |
*
|
@@ -80,6 +89,10 @@ abstract class SiteOrigin_Widget extends WP_Widget {
|
|
80 |
* @return mixed
|
81 |
*/
|
82 |
function form_options( $parent = false ) {
|
|
|
|
|
|
|
|
|
83 |
$form_options = $this->modify_form( $this->form_options );
|
84 |
if( !empty($parent) ) {
|
85 |
$form_options = $parent->modify_child_widget_form( $form_options, $this );
|
@@ -98,6 +111,10 @@ abstract class SiteOrigin_Widget extends WP_Widget {
|
|
98 |
* @param array $instance
|
99 |
*/
|
100 |
public function widget( $args, $instance ) {
|
|
|
|
|
|
|
|
|
101 |
$instance = $this->modify_instance($instance);
|
102 |
|
103 |
// Filter the instance
|
@@ -129,7 +146,7 @@ abstract class SiteOrigin_Widget extends WP_Widget {
|
|
129 |
unset($stored_instance['panels_info']);
|
130 |
|
131 |
$storage_hash = substr( md5( serialize($stored_instance) ), 0, 8 );
|
132 |
-
if( !empty( $stored_instance ) &&
|
133 |
// Store this if we have a non empty instance and are not previewing
|
134 |
set_transient('sow_inst[' . $this->id_base . '][' . $storage_hash . ']', $stored_instance, 7*86400);
|
135 |
}
|
@@ -165,6 +182,10 @@ abstract class SiteOrigin_Widget extends WP_Widget {
|
|
165 |
* @return string The CSS name
|
166 |
*/
|
167 |
function generate_and_enqueue_instance_styles( $instance ) {
|
|
|
|
|
|
|
|
|
168 |
// We'll assume empty instances don't have styles
|
169 |
if( empty($instance) ) return;
|
170 |
|
@@ -182,9 +203,9 @@ abstract class SiteOrigin_Widget extends WP_Widget {
|
|
182 |
$css_name = $this->id_base.'-'.$style.'-'.$hash;
|
183 |
|
184 |
//Ensure styles aren't generated and enqueued more than once.
|
185 |
-
$in_preview = is_preview(
|
186 |
if ( ! in_array( $css_name, $this->generated_css ) || $in_preview ) {
|
187 |
-
if(
|
188 |
siteorigin_widget_add_inline_css( $this->get_instance_css( $instance ) );
|
189 |
}
|
190 |
else {
|
@@ -203,7 +224,12 @@ abstract class SiteOrigin_Widget extends WP_Widget {
|
|
203 |
}
|
204 |
else {
|
205 |
// Fall back to using inline CSS if we can't find the cached CSS file.
|
206 |
-
|
|
|
|
|
|
|
|
|
|
|
207 |
}
|
208 |
}
|
209 |
$this->generated_css[] = $css_name;
|
@@ -276,8 +302,8 @@ abstract class SiteOrigin_Widget extends WP_Widget {
|
|
276 |
$instance[$id] = $this->add_defaults( $field['fields'], $instance[$id], $level + 1 );
|
277 |
}
|
278 |
else {
|
279 |
-
if( !isset($instance[$id]
|
280 |
-
$instance[$id] = $field['default'];
|
281 |
}
|
282 |
}
|
283 |
}
|
@@ -435,6 +461,10 @@ abstract class SiteOrigin_Widget extends WP_Widget {
|
|
435 |
* @return bool
|
436 |
*/
|
437 |
function using_posts_selector(){
|
|
|
|
|
|
|
|
|
438 |
foreach($this->form_options as $field) {
|
439 |
if(!empty($field['type']) && $field['type'] == 'posts') return true;
|
440 |
}
|
@@ -487,33 +517,36 @@ abstract class SiteOrigin_Widget extends WP_Widget {
|
|
487 |
private function save_css( $instance ){
|
488 |
require_once ABSPATH . 'wp-admin/includes/file.php';
|
489 |
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
|
494 |
-
|
495 |
-
$wp_filesystem->mkdir( $upload_dir['basedir'] . '/siteorigin-widgets/' );
|
496 |
-
}
|
497 |
|
498 |
-
|
499 |
-
|
500 |
-
|
|
|
|
|
501 |
|
502 |
-
|
|
|
|
|
503 |
|
504 |
-
|
505 |
-
$wp_filesystem->delete($upload_dir['basedir'] . '/siteorigin-widgets/'.$name);
|
506 |
$wp_filesystem->put_contents(
|
507 |
-
$upload_dir['basedir'] . '/siteorigin-widgets/'
|
508 |
$css
|
509 |
);
|
|
|
|
|
|
|
510 |
}
|
511 |
|
512 |
return $hash;
|
513 |
}
|
514 |
-
|
515 |
-
|
516 |
-
}
|
517 |
}
|
518 |
|
519 |
/**
|
@@ -1019,4 +1052,23 @@ abstract class SiteOrigin_Widget extends WP_Widget {
|
|
1019 |
*/
|
1020 |
function enqueue_admin_scripts(){ }
|
1021 |
|
1022 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
|
73 |
}
|
74 |
|
75 |
+
/**
|
76 |
+
* Return the form array. Widgets should implement this if they don't have a form in the form array.
|
77 |
+
*
|
78 |
+
* @return array
|
79 |
+
*/
|
80 |
+
function initialize_form( ){
|
81 |
+
return array();
|
82 |
+
}
|
83 |
+
|
84 |
/**
|
85 |
* Get the form options and allow child widgets to modify that form.
|
86 |
*
|
89 |
* @return mixed
|
90 |
*/
|
91 |
function form_options( $parent = false ) {
|
92 |
+
if( empty( $this->form_options ) ) {
|
93 |
+
$this->form_options = $this->initialize_form();
|
94 |
+
}
|
95 |
+
|
96 |
$form_options = $this->modify_form( $this->form_options );
|
97 |
if( !empty($parent) ) {
|
98 |
$form_options = $parent->modify_child_widget_form( $form_options, $this );
|
111 |
* @param array $instance
|
112 |
*/
|
113 |
public function widget( $args, $instance ) {
|
114 |
+
if( empty( $this->form_options ) ) {
|
115 |
+
$this->form_options = $this->initialize_form();
|
116 |
+
}
|
117 |
+
|
118 |
$instance = $this->modify_instance($instance);
|
119 |
|
120 |
// Filter the instance
|
146 |
unset($stored_instance['panels_info']);
|
147 |
|
148 |
$storage_hash = substr( md5( serialize($stored_instance) ), 0, 8 );
|
149 |
+
if( !empty( $stored_instance ) && !$this->is_preview( $instance ) ) {
|
150 |
// Store this if we have a non empty instance and are not previewing
|
151 |
set_transient('sow_inst[' . $this->id_base . '][' . $storage_hash . ']', $stored_instance, 7*86400);
|
152 |
}
|
182 |
* @return string The CSS name
|
183 |
*/
|
184 |
function generate_and_enqueue_instance_styles( $instance ) {
|
185 |
+
if( empty( $this->form_options ) ) {
|
186 |
+
$this->form_options = $this->initialize_form();
|
187 |
+
}
|
188 |
+
|
189 |
// We'll assume empty instances don't have styles
|
190 |
if( empty($instance) ) return;
|
191 |
|
203 |
$css_name = $this->id_base.'-'.$style.'-'.$hash;
|
204 |
|
205 |
//Ensure styles aren't generated and enqueued more than once.
|
206 |
+
$in_preview = $this->is_preview( $instance );
|
207 |
if ( ! in_array( $css_name, $this->generated_css ) || $in_preview ) {
|
208 |
+
if( $in_preview ) {
|
209 |
siteorigin_widget_add_inline_css( $this->get_instance_css( $instance ) );
|
210 |
}
|
211 |
else {
|
224 |
}
|
225 |
else {
|
226 |
// Fall back to using inline CSS if we can't find the cached CSS file.
|
227 |
+
// Try get the cached value.
|
228 |
+
$css = wp_cache_get( $css_name, 'siteorigin_widgets' );
|
229 |
+
if ( empty( $css ) ) {
|
230 |
+
$css = $this->get_instance_css( $instance );
|
231 |
+
}
|
232 |
+
siteorigin_widget_add_inline_css( $css );
|
233 |
}
|
234 |
}
|
235 |
$this->generated_css[] = $css_name;
|
302 |
$instance[$id] = $this->add_defaults( $field['fields'], $instance[$id], $level + 1 );
|
303 |
}
|
304 |
else {
|
305 |
+
if( !isset( $instance[$id] ) ) {
|
306 |
+
$instance[$id] = isset( $field['default'] ) ? $field['default'] : '';
|
307 |
}
|
308 |
}
|
309 |
}
|
461 |
* @return bool
|
462 |
*/
|
463 |
function using_posts_selector(){
|
464 |
+
if( empty( $this->form_options ) ) {
|
465 |
+
$this->form_options = $this->initialize_form();
|
466 |
+
}
|
467 |
+
|
468 |
foreach($this->form_options as $field) {
|
469 |
if(!empty($field['type']) && $field['type'] == 'posts') return true;
|
470 |
}
|
517 |
private function save_css( $instance ){
|
518 |
require_once ABSPATH . 'wp-admin/includes/file.php';
|
519 |
|
520 |
+
$style = $this->get_style_name($instance);
|
521 |
+
$hash = $this->get_style_hash( $instance );
|
522 |
+
$name = $this->id_base.'-'.$style.'-'.$hash.'.css';
|
523 |
|
524 |
+
$css = $this->get_instance_css($instance);
|
|
|
|
|
525 |
|
526 |
+
if( !empty($css) ) {
|
527 |
+
|
528 |
+
if ( WP_Filesystem() ) {
|
529 |
+
global $wp_filesystem;
|
530 |
+
$upload_dir = wp_upload_dir();
|
531 |
|
532 |
+
if ( ! $wp_filesystem->is_dir( $upload_dir['basedir'] . '/siteorigin-widgets/' ) ) {
|
533 |
+
$wp_filesystem->mkdir( $upload_dir['basedir'] . '/siteorigin-widgets/' );
|
534 |
+
}
|
535 |
|
536 |
+
$wp_filesystem->delete( $upload_dir['basedir'] . '/siteorigin-widgets/' . $name );
|
|
|
537 |
$wp_filesystem->put_contents(
|
538 |
+
$upload_dir['basedir'] . '/siteorigin-widgets/' . $name,
|
539 |
$css
|
540 |
);
|
541 |
+
|
542 |
+
} else {
|
543 |
+
wp_cache_add( $name, $css, 'siteorigin_widgets' );
|
544 |
}
|
545 |
|
546 |
return $hash;
|
547 |
}
|
548 |
+
|
549 |
+
return false;
|
|
|
550 |
}
|
551 |
|
552 |
/**
|
1052 |
*/
|
1053 |
function enqueue_admin_scripts(){ }
|
1054 |
|
1055 |
+
/**
|
1056 |
+
* Check if we're currently in a preview
|
1057 |
+
*
|
1058 |
+
* @param array $instance
|
1059 |
+
*
|
1060 |
+
* @return bool
|
1061 |
+
*/
|
1062 |
+
function is_preview( $instance = array() ){
|
1063 |
+
// Check if the instance is a preview
|
1064 |
+
if( !empty( $instance[ 'is_preview' ] ) ) return true;
|
1065 |
+
|
1066 |
+
// Check if the general request is a preview
|
1067 |
+
return
|
1068 |
+
is_preview() || // is this a standard preview
|
1069 |
+
$this->is_customize_preview() || // Is this a customizer preview
|
1070 |
+
!empty( $_GET['siteorigin_panels_live_editor'] ) || // Is this a Page Builder live editor request
|
1071 |
+
( !empty( $_REQUEST['action'] ) && $_REQUEST['action'] == 'so_panels_builder_content' ); // Is this a Page Builder content ajax request
|
1072 |
+
}
|
1073 |
+
|
1074 |
+
}
|
css/slider/slider.css
CHANGED
@@ -66,7 +66,9 @@
|
|
66 |
background-repeat: repeat;
|
67 |
}
|
68 |
.sow-slider-base ul.sow-slider-images li.sow-slider-image > img,
|
69 |
-
.sow-slider-base ul.sow-slider-images li.sow-slider-image
|
|
|
|
|
70 |
display: block;
|
71 |
width: 100%;
|
72 |
height: auto;
|
66 |
background-repeat: repeat;
|
67 |
}
|
68 |
.sow-slider-base ul.sow-slider-images li.sow-slider-image > img,
|
69 |
+
.sow-slider-base ul.sow-slider-images li.sow-slider-image > a > img,
|
70 |
+
.sow-slider-base ul.sow-slider-images li.sow-slider-image .sow-slider-image-wrapper > img,
|
71 |
+
.sow-slider-base ul.sow-slider-images li.sow-slider-image .sow-slider-image-wrapper > a > img {
|
72 |
display: block;
|
73 |
width: 100%;
|
74 |
height: auto;
|
readme.txt
CHANGED
@@ -1,281 +1,292 @@
|
|
1 |
-
=== SiteOrigin Widgets Bundle ===
|
2 |
-
Tags: bundle, widget, button, slider, image, carousel, price table, google maps, tinymce, social links
|
3 |
-
Requires at least: 3.9
|
4 |
-
Tested up to: 4.4.2
|
5 |
-
Stable tag: 1.5.
|
6 |
-
Build time: 2016-
|
7 |
-
License: GPLv3 or later
|
8 |
-
Contributors: gpriday, braam-genis
|
9 |
-
|
10 |
-
== Description ==
|
11 |
-
|
12 |
-
[vimeo https://vimeo.com/102103379]
|
13 |
-
|
14 |
-
Widgets are great. No matter where you’re using them. In a [Page Builder](http://siteorigin.com/page-builder/) page or on your widgetized areas.
|
15 |
-
|
16 |
-
The SiteOrigin widget bundle gives you a collection of widgets that you can use and customize. All the widgets are built on our powerful framework, giving you advanced forms, unlimited colours and 1500+ icons.
|
17 |
-
|
18 |
-
The collection is growing, but here’s what we have so far.
|
19 |
-
|
20 |
-
* Google Maps Widget that's going places.
|
21 |
-
* Button Widget that you’ll love to click.
|
22 |
-
* Image Widget that’ll let you add images everywhere.
|
23 |
-
* Call To Action Widget that’ll get your users performing the actions you want.
|
24 |
-
* Slider Widget that slides images and HTML5 videos.
|
25 |
-
* Price Table Widget that’ll help you sell more.
|
26 |
-
* Post Carousel Widget that displays your posts as a carousel.
|
27 |
-
* Features Widget that lets you display a set of site or service features.
|
28 |
-
* Video Widget to get your videos out there.
|
29 |
-
* Headline Widget to get you noticed.
|
30 |
-
* Social Links Widget to show you're active.
|
31 |
-
|
32 |
-
Once you enable a widget, you'll be able to use it anywhere standard widgets are used. You can manage your widgets by going to Plugins > SiteOrigin Widgets in your WordPress admin.
|
33 |
-
|
34 |
-
== Documentation ==
|
35 |
-
|
36 |
-
[Documentation](https://siteorigin.com/css/getting-started/) is available on SiteOrigin.
|
37 |
-
|
38 |
-
== Support ==
|
39 |
-
|
40 |
-
We offer free support on the [SiteOrigin support forums](https://siteorigin.com/thread/).
|
41 |
-
|
42 |
-
= Create Custom Widgets =
|
43 |
-
|
44 |
-
The SiteOrigin Widgets Bundle is the perfect platform to build widgets for your theme or plugin. Read more on our [developer docs](https://siteorigin.com/docs/widgets-bundle/).
|
45 |
-
|
46 |
-
== Screenshots ==
|
47 |
-
|
48 |
-
1. Manage which widgets you want enabled or disabled.
|
49 |
-
2. The button widget shows the clean, standard interface all the widgets use.
|
50 |
-
3. An example of the button widget.
|
51 |
-
|
52 |
-
== Changelog ==
|
53 |
-
|
54 |
-
= 1.5.
|
55 |
-
*
|
56 |
-
*
|
57 |
-
|
58 |
-
|
59 |
-
*
|
60 |
-
*
|
61 |
-
*
|
62 |
-
*
|
63 |
-
*
|
64 |
-
|
65 |
-
|
66 |
-
*
|
67 |
-
*
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
*
|
73 |
-
|
74 |
-
|
75 |
-
*
|
76 |
-
*
|
77 |
-
*
|
78 |
-
|
79 |
-
|
80 |
-
*
|
81 |
-
|
82 |
-
|
83 |
-
*
|
84 |
-
|
85 |
-
|
86 |
-
*
|
87 |
-
*
|
88 |
-
*
|
89 |
-
|
90 |
-
|
91 |
-
*
|
92 |
-
*
|
93 |
-
*
|
94 |
-
*
|
95 |
-
*
|
96 |
-
*
|
97 |
-
*
|
98 |
-
*
|
99 |
-
*
|
100 |
-
*
|
101 |
-
*
|
102 |
-
*
|
103 |
-
*
|
104 |
-
*
|
105 |
-
*
|
106 |
-
*
|
107 |
-
|
108 |
-
|
109 |
-
*
|
110 |
-
|
111 |
-
|
112 |
-
*
|
113 |
-
*
|
114 |
-
*
|
115 |
-
*
|
116 |
-
*
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
* Fixed
|
121 |
-
|
122 |
-
|
123 |
-
*
|
124 |
-
* Fixed
|
125 |
-
*
|
126 |
-
*
|
127 |
-
*
|
128 |
-
|
129 |
-
|
130 |
-
*
|
131 |
-
|
132 |
-
|
133 |
-
*
|
134 |
-
|
135 |
-
|
136 |
-
*
|
137 |
-
*
|
138 |
-
*
|
139 |
-
* Added
|
140 |
-
*
|
141 |
-
*
|
142 |
-
|
143 |
-
|
144 |
-
*
|
145 |
-
|
146 |
-
|
147 |
-
*
|
148 |
-
*
|
149 |
-
*
|
150 |
-
*
|
151 |
-
*
|
152 |
-
*
|
153 |
-
*
|
154 |
-
|
155 |
-
|
156 |
-
*
|
157 |
-
|
158 |
-
|
159 |
-
*
|
160 |
-
*
|
161 |
-
*
|
162 |
-
*
|
163 |
-
*
|
164 |
-
*
|
165 |
-
|
166 |
-
|
167 |
-
* Fixed
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
*
|
172 |
-
|
173 |
-
|
174 |
-
*
|
175 |
-
*
|
176 |
-
*
|
177 |
-
*
|
178 |
-
* Fixed
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
*
|
183 |
-
|
184 |
-
|
185 |
-
*
|
186 |
-
*
|
187 |
-
|
188 |
-
|
189 |
-
*
|
190 |
-
|
191 |
-
|
192 |
-
*
|
193 |
-
|
194 |
-
|
195 |
-
* Added
|
196 |
-
*
|
197 |
-
*
|
198 |
-
|
199 |
-
|
200 |
-
*
|
201 |
-
*
|
202 |
-
*
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
*
|
207 |
-
|
208 |
-
|
209 |
-
*
|
210 |
-
*
|
211 |
-
*
|
212 |
-
*
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
*
|
217 |
-
*
|
218 |
-
|
219 |
-
|
220 |
-
*
|
221 |
-
|
222 |
-
|
223 |
-
*
|
224 |
-
|
225 |
-
= 1.2 =
|
226 |
-
* Added
|
227 |
-
*
|
228 |
-
*
|
229 |
-
*
|
230 |
-
*
|
231 |
-
*
|
232 |
-
|
233 |
-
|
234 |
-
*
|
235 |
-
|
236 |
-
|
237 |
-
*
|
238 |
-
*
|
239 |
-
|
240 |
-
|
241 |
-
*
|
242 |
-
*
|
243 |
-
|
244 |
-
|
245 |
-
*
|
246 |
-
|
247 |
-
|
248 |
-
*
|
249 |
-
*
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
*
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
*
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
*
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
*
|
270 |
-
*
|
271 |
-
|
272 |
-
|
273 |
-
*
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== SiteOrigin Widgets Bundle ===
|
2 |
+
Tags: bundle, widget, button, slider, image, carousel, price table, google maps, tinymce, social links
|
3 |
+
Requires at least: 3.9
|
4 |
+
Tested up to: 4.4.2
|
5 |
+
Stable tag: 1.5.9
|
6 |
+
Build time: 2016-04-06T08:37:03+02:00
|
7 |
+
License: GPLv3 or later
|
8 |
+
Contributors: gpriday, braam-genis
|
9 |
+
|
10 |
+
== Description ==
|
11 |
+
|
12 |
+
[vimeo https://vimeo.com/102103379]
|
13 |
+
|
14 |
+
Widgets are great. No matter where you’re using them. In a [Page Builder](http://siteorigin.com/page-builder/) page or on your widgetized areas.
|
15 |
+
|
16 |
+
The SiteOrigin widget bundle gives you a collection of widgets that you can use and customize. All the widgets are built on our powerful framework, giving you advanced forms, unlimited colours and 1500+ icons.
|
17 |
+
|
18 |
+
The collection is growing, but here’s what we have so far.
|
19 |
+
|
20 |
+
* Google Maps Widget that's going places.
|
21 |
+
* Button Widget that you’ll love to click.
|
22 |
+
* Image Widget that’ll let you add images everywhere.
|
23 |
+
* Call To Action Widget that’ll get your users performing the actions you want.
|
24 |
+
* Slider Widget that slides images and HTML5 videos.
|
25 |
+
* Price Table Widget that’ll help you sell more.
|
26 |
+
* Post Carousel Widget that displays your posts as a carousel.
|
27 |
+
* Features Widget that lets you display a set of site or service features.
|
28 |
+
* Video Widget to get your videos out there.
|
29 |
+
* Headline Widget to get you noticed.
|
30 |
+
* Social Links Widget to show you're active.
|
31 |
+
|
32 |
+
Once you enable a widget, you'll be able to use it anywhere standard widgets are used. You can manage your widgets by going to Plugins > SiteOrigin Widgets in your WordPress admin.
|
33 |
+
|
34 |
+
== Documentation ==
|
35 |
+
|
36 |
+
[Documentation](https://siteorigin.com/css/getting-started/) is available on SiteOrigin.
|
37 |
+
|
38 |
+
== Support ==
|
39 |
+
|
40 |
+
We offer free support on the [SiteOrigin support forums](https://siteorigin.com/thread/).
|
41 |
+
|
42 |
+
= Create Custom Widgets =
|
43 |
+
|
44 |
+
The SiteOrigin Widgets Bundle is the perfect platform to build widgets for your theme or plugin. Read more on our [developer docs](https://siteorigin.com/docs/widgets-bundle/).
|
45 |
+
|
46 |
+
== Screenshots ==
|
47 |
+
|
48 |
+
1. Manage which widgets you want enabled or disabled.
|
49 |
+
2. The button widget shows the clean, standard interface all the widgets use.
|
50 |
+
3. An example of the button widget.
|
51 |
+
|
52 |
+
== Changelog ==
|
53 |
+
|
54 |
+
= 1.5.10 - April 5 2016 =
|
55 |
+
* Added Icon widget.
|
56 |
+
* Moved widget form arrays into separate functions to improve performance.
|
57 |
+
* Cache widget style CSS if it can't be saved to filesystem.
|
58 |
+
* Improved preview checking so preview style CSS isn't stored.
|
59 |
+
* Contact Form: Improved instance hashing for compatibility with Yoast SEO.
|
60 |
+
* Contact Form: Added description field and customisation.
|
61 |
+
* Slider: Ensure correct styles are applied to slider images when a link is defined.
|
62 |
+
* Features: Allow user to select size for uploaded icon image.
|
63 |
+
* Price Table: Ensure feature icons always vertically centered, alongside feature text.
|
64 |
+
|
65 |
+
= 1.5.9 - February 26 2016 =
|
66 |
+
* Contact Form: Fixed hash checking for duplicate emails.
|
67 |
+
* Contact Form: Replace default emails with admin_email.
|
68 |
+
|
69 |
+
= 1.5.8 - February 26 2016 =
|
70 |
+
* Skip empty sidebars when loading widget scripts.
|
71 |
+
* Changes to cache clearing.
|
72 |
+
* Typo corrections.
|
73 |
+
* Fixed conflict with Child Theme Configurator.
|
74 |
+
* Image Grid widget: Using correct field and image size names to determine image sizes.
|
75 |
+
* Editor widget: Added shortcode unautop to Editor widget.
|
76 |
+
* Contact Form widget: Added check to prevent email resends in contact form widget.
|
77 |
+
* Masonry widget: properly handles full width rows in Page Builder.
|
78 |
+
* Hero Image widget: Fix backgrounds URL.
|
79 |
+
* Price Table widget: Skip empty buttons.
|
80 |
+
* Maps Widget: Allow clicking markers to reopen info windows if closed.
|
81 |
+
|
82 |
+
= 1.5.7 - February 4 2016 =
|
83 |
+
* Restored old class name for Image Grid Widget.
|
84 |
+
|
85 |
+
= 1.5.6 - January 23 2016 =
|
86 |
+
* Fixed widget name migration
|
87 |
+
* Fixed hero image height issue.
|
88 |
+
* Fixed admin page layout.
|
89 |
+
|
90 |
+
= 1.5.5 - January 21 2016 =
|
91 |
+
* Changed widget folder names to make them less verbose.
|
92 |
+
* Properly handle LESS compile errors.
|
93 |
+
* Fixed regex causing only the first 10 TinyMCE fields to be initialized.
|
94 |
+
* Fixed sanitization in the contact form.
|
95 |
+
* Fixed Google webfont function.
|
96 |
+
* Fixed image output for slider base.
|
97 |
+
* Image Widget: Added alignment options.
|
98 |
+
* Contact Form: Use anchor to return to form after submit
|
99 |
+
* Change default caps to manage options.
|
100 |
+
* Contact form widget: fixed - form in customizer doesn't resize.
|
101 |
+
* Price Table: Added image alt tags.
|
102 |
+
* Editor Widget: Fixed issue where only admins can view unfiltered content.
|
103 |
+
* Editor Widget: Fixed issue where Editor Widget was removing new lines in code.
|
104 |
+
* Post Selector Field: Support for date fields.
|
105 |
+
* Maps Widget: Fixed Lat/Long coordinate handling.
|
106 |
+
* Masonry widget: fixed layout and sizing.
|
107 |
+
* Image Widget: Allow display of image title above or below image.
|
108 |
+
* Added more relative measurement units to base.
|
109 |
+
* Hero Image Widget: Added height setting.
|
110 |
+
* Testimonial widget: Prevent outputting related image HTML if no image is set.
|
111 |
+
* Testimonial Widget: Use testimonial URLs to link location and optionally link names and images.
|
112 |
+
* Contact Form: Prevent multiple submit button clicks.
|
113 |
+
* Image Widget: Add support for srcset to Image widget
|
114 |
+
* Contact Form: Allow user to set field label position.
|
115 |
+
* Contact Form: Allow user to set field label font styles.
|
116 |
+
* Contact Form: Allow user setting focussed field outline styles.
|
117 |
+
* Contact Form: Don't do recaptcha validation in admin preview.
|
118 |
+
|
119 |
+
= 1.5.4 - November 18 2015 =
|
120 |
+
* Fixed compatibility with PHP 5.2
|
121 |
+
|
122 |
+
= 1.5.3 - November 17 2015 =
|
123 |
+
* Fixed defaults for Features widget and Hero Image widget.
|
124 |
+
* Fixed previewing for Editor widget.
|
125 |
+
* Change measurement field to work as single string.
|
126 |
+
* Use new measurement field for existing widgets.
|
127 |
+
* Carousel widget supports RTL.
|
128 |
+
|
129 |
+
= 1.5.2 - November 10 2015 =
|
130 |
+
* Removed word break style from headline widget.
|
131 |
+
* Fixed image grid URL field.
|
132 |
+
* Added more text styling options to features widget.
|
133 |
+
* Added measurement field to use in various widgets.
|
134 |
+
* Prefix function name in Google Map widget to prevent conflicts.
|
135 |
+
* Fixed styling for contact form widget.
|
136 |
+
* Fix to allow multiple duplicated contact forms on a single page.
|
137 |
+
* Fixed Hero Image widget button shortcode in text mode.
|
138 |
+
* TinyMCE fields maintain editor state.
|
139 |
+
* Added support for WP Canvas Shortcodes in TinyMCE field.
|
140 |
+
* Don't initialize TinyMCE outside the admin.
|
141 |
+
* Added more styling to contact form submit button.
|
142 |
+
|
143 |
+
= 1.5.1 - October 7 2015 =
|
144 |
+
* Fixed: Issue with Call To Action widget being missing.
|
145 |
+
|
146 |
+
= 1.5 - October 5 2015 =
|
147 |
+
* Fixed: Conflict between WPML and repeaters.
|
148 |
+
* Added Simple Masonry Layout widget.
|
149 |
+
* Added Contact Form widget.
|
150 |
+
* Added Image Grid widget.
|
151 |
+
* Added Testimonial widget.
|
152 |
+
* Changed layout of widgets activation page.
|
153 |
+
* Added Trianglify to generate placeholder widget icons.
|
154 |
+
* Added mechanism to use state emitters in repeaters.
|
155 |
+
* Section expanded/collapsed states now stored across form loads.
|
156 |
+
* Display once off admin notice when new widgets are available.
|
157 |
+
* Fixed translation domain.
|
158 |
+
* Editor Widget: Allow more HTML in Editor widget for trusted users.
|
159 |
+
* Hero Image Widget: Added top padding setting.
|
160 |
+
* Hero Image Widget: Can now set background click URL.
|
161 |
+
* Hero Image Widget: Improved handling of buttons shortcode.
|
162 |
+
* Slider Widget : Fixed open in new window setting.
|
163 |
+
* Headline Widget: Added word-break CSS.
|
164 |
+
* Headline Widget: Added option to set type of heading tags used.
|
165 |
+
|
166 |
+
= 1.4.4 - September 6 2015 =
|
167 |
+
* Fixed issue with slider image widths.
|
168 |
+
|
169 |
+
= 1.4.3 - September 5 2015 =
|
170 |
+
* Added support for WooCommerce Shortcodes plugin to TinyMCE field.
|
171 |
+
* New streamlined icon selector field.
|
172 |
+
* Added info window functionality to maps widget.
|
173 |
+
* Added a button to duplicate repeater items.
|
174 |
+
* Added more design settings to hero image widget.
|
175 |
+
* Removed full screen mode from TinyMCE field.
|
176 |
+
* Option to keep map centered when container is resized.
|
177 |
+
* Fixed: CSS bug for Google font imports on generated CSS.
|
178 |
+
* Fixed: Post selector for URL fields properly handles empty titles.
|
179 |
+
* Added option to skip auto paragraphs in Editor widget.
|
180 |
+
|
181 |
+
= 1.4.2 - August 18 2015 =
|
182 |
+
* Urgent fix in preparation for WordPress 4.3 release
|
183 |
+
|
184 |
+
= 1.4.1 - August 17 2015 =
|
185 |
+
* Updated to latest Font Awesome.
|
186 |
+
* Added TripAdvisor to social links widget.
|
187 |
+
* Allow unfiltered HTML in SiteOrigin Editor Widget if user has rights.
|
188 |
+
* Properly set URL scheme.
|
189 |
+
* Fixed state emitter issue for Google Maps Widget.
|
190 |
+
|
191 |
+
= 1.4 - July 20 2015 =
|
192 |
+
* Created a base slider widget class.
|
193 |
+
* Converted current slider widget to use base slider.
|
194 |
+
* Fixed image sizing in slider widget.
|
195 |
+
* Added plain background color option to slider widget.
|
196 |
+
* Added new Hero Image widget.
|
197 |
+
* Fixed repeaters in sub items.
|
198 |
+
|
199 |
+
= 1.3.1 =
|
200 |
+
* Fix to TinyMCE field when moved in Customizer and Widgets interface.
|
201 |
+
* Small developer level improvements.
|
202 |
+
* Fixed autoplay in video widget.
|
203 |
+
* Fixed behaviour of slides in slider widget.
|
204 |
+
|
205 |
+
= 1.3 =
|
206 |
+
* Added TinyMCE field type.
|
207 |
+
* All fields now use classes to make them easier to extend.
|
208 |
+
* Added SiteOrigin Editor widget.
|
209 |
+
* Made it possible for other plugins to filter default widgets.
|
210 |
+
* Fixed WordPress CLI compatibility.
|
211 |
+
* Added unit tests.
|
212 |
+
* Added networks to social networks widget.
|
213 |
+
* Changed how repeater HTML is stored.
|
214 |
+
|
215 |
+
= 1.2.4 =
|
216 |
+
* Fixed reference to siteorigin_widgets_is_google_webfont.
|
217 |
+
* Fixed CSS URL.
|
218 |
+
|
219 |
+
= 1.2.3 =
|
220 |
+
* Fixed Javascript issue with Map widget in customizer.
|
221 |
+
* Added meta box manager.
|
222 |
+
* Small style change to flat button style.
|
223 |
+
* Video widget fixes.
|
224 |
+
|
225 |
+
= 1.2.2 =
|
226 |
+
* Added video widget with support for self/external videos.
|
227 |
+
* New activate/deactivate widgets interface.
|
228 |
+
* Headline widget CSS fixes.
|
229 |
+
* Dev Feature: Error checking for widget field type.
|
230 |
+
* Dev Feature: Added state emitters.
|
231 |
+
* Dev Feature: Additional hooks and filters.
|
232 |
+
|
233 |
+
= 1.2.1 =
|
234 |
+
* Removed is_customizer_preview - only available in newer versions of WordPress.
|
235 |
+
|
236 |
+
= 1.2 =
|
237 |
+
* Added headline widget.
|
238 |
+
* All scripts and styles loaded in header instead of lazy loading.
|
239 |
+
* Added email to social links widget.
|
240 |
+
* Made carousel touch friendly.
|
241 |
+
* Improved input sanitization for HTML input.
|
242 |
+
* Added nonce request checking in carousel widget.
|
243 |
+
* Added sticky field to post selector.
|
244 |
+
* Added function to allow Page Builder to use post selector.
|
245 |
+
* Added a few developer friendly filters.
|
246 |
+
* Fixed: Various customizer related issues.
|
247 |
+
* Fixed: Issue limiting maps widget to 10 markers.
|
248 |
+
* Fixed: Call to action alignment issues.
|
249 |
+
* Fixed: Carousel preview.
|
250 |
+
|
251 |
+
= 1.1.2 =
|
252 |
+
* Added social links widget.
|
253 |
+
* Framework updates.
|
254 |
+
|
255 |
+
= 1.1.1 =
|
256 |
+
* Fixed Google Map preview.
|
257 |
+
|
258 |
+
= 1.1 =
|
259 |
+
* Added powerful Google Maps widget.
|
260 |
+
* Improved data sanitization.
|
261 |
+
* Various UI improvements.
|
262 |
+
|
263 |
+
= 1.0.6 =
|
264 |
+
* Fixed issues with adding extra widget folders.
|
265 |
+
* Added compatibility with WordPress Customizer.
|
266 |
+
* Added more fields to be used with future widgets.
|
267 |
+
|
268 |
+
= 1.0.5 =
|
269 |
+
* Removed legacy widget deactivation functions.
|
270 |
+
* Improved how widgets are loaded.
|
271 |
+
|
272 |
+
= 1.0.4 =
|
273 |
+
* Changed how widget list is loaded to fix issue with widgets list not displaying.
|
274 |
+
|
275 |
+
= 1.0.3 =
|
276 |
+
* Features widget icons can now be made clickable.
|
277 |
+
|
278 |
+
= 1.0.2 =
|
279 |
+
* Manage widgets page now does live updates.
|
280 |
+
* Added widget previews.
|
281 |
+
* Fixed wire button widget hover issue.
|
282 |
+
* Old stand alone widget plugins are now deactivated in favor of bundled versions.
|
283 |
+
* Fixed centering of CTA widget.
|
284 |
+
* Fixed color settings in CTA widget.
|
285 |
+
* Fixed button icon color setting.
|
286 |
+
* Small UI improvements.
|
287 |
+
|
288 |
+
= 1.0.1 =
|
289 |
+
* Clean up of code and bundled widgets.
|
290 |
+
|
291 |
+
= 1.0 =
|
292 |
+
* Initial release.
|
so-widgets-bundle.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
Plugin Name: SiteOrigin Widgets Bundle
|
4 |
Description: A collection of all widgets, neatly bundled into a single plugin. It's also a framework to code your own widgets on top of.
|
5 |
-
Version: 1.5.
|
6 |
Text Domain: so-widgets-bundle
|
7 |
Domain Path: /languages
|
8 |
Author: SiteOrigin
|
@@ -12,7 +12,7 @@ License: GPL3
|
|
12 |
License URI: https://www.gnu.org/licenses/gpl-3.0.txt
|
13 |
*/
|
14 |
|
15 |
-
define('SOW_BUNDLE_VERSION', '1.5.
|
16 |
define('SOW_BUNDLE_JS_SUFFIX', '.min');
|
17 |
define('SOW_BUNDLE_BASE_FILE', __FILE__);
|
18 |
|
@@ -596,8 +596,9 @@ class SiteOrigin_Widgets_Bundle {
|
|
596 |
* Add action links.
|
597 |
*/
|
598 |
function plugin_action_links($links){
|
599 |
-
$links[
|
600 |
-
$links[] = '<a href="
|
|
|
601 |
return $links;
|
602 |
}
|
603 |
|
2 |
/*
|
3 |
Plugin Name: SiteOrigin Widgets Bundle
|
4 |
Description: A collection of all widgets, neatly bundled into a single plugin. It's also a framework to code your own widgets on top of.
|
5 |
+
Version: 1.5.10
|
6 |
Text Domain: so-widgets-bundle
|
7 |
Domain Path: /languages
|
8 |
Author: SiteOrigin
|
12 |
License URI: https://www.gnu.org/licenses/gpl-3.0.txt
|
13 |
*/
|
14 |
|
15 |
+
define('SOW_BUNDLE_VERSION', '1.5.10');
|
16 |
define('SOW_BUNDLE_JS_SUFFIX', '.min');
|
17 |
define('SOW_BUNDLE_BASE_FILE', __FILE__);
|
18 |
|
596 |
* Add action links.
|
597 |
*/
|
598 |
function plugin_action_links($links){
|
599 |
+
unset( $links['edit'] );
|
600 |
+
$links['manage'] = '<a href="' . admin_url('plugins.php?page=so-widgets-plugins') . '">'.__('Manage Widgets', 'so-widgets-bundle').'</a>';
|
601 |
+
$links['support'] = '<a href="https://siteorigin.com/thread/" target="_blank">'.__('Support', 'so-widgets-bundle').'</a>';
|
602 |
return $links;
|
603 |
}
|
604 |
|
widgets/button/button.php
CHANGED
@@ -19,168 +19,172 @@ class SiteOrigin_Widget_Button_Widget extends SiteOrigin_Widget {
|
|
19 |
array(
|
20 |
|
21 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
array(
|
23 |
-
|
24 |
-
'
|
25 |
-
|
|
|
|
|
26 |
),
|
|
|
|
|
|
|
27 |
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
|
|
|
|
32 |
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
),
|
38 |
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
'type' => 'icon',
|
45 |
-
'label' => __('Icon', 'so-widgets-bundle'),
|
46 |
-
),
|
47 |
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
|
|
|
|
|
|
|
|
52 |
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
'description' => __('Replaces the icon with your own image icon.', 'so-widgets-bundle'),
|
57 |
-
),
|
58 |
),
|
59 |
-
),
|
60 |
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
'label' => __('Align', 'so-widgets-bundle'),
|
69 |
-
'default' => 'center',
|
70 |
-
'options' => array(
|
71 |
-
'left' => __('Left', 'so-widgets-bundle'),
|
72 |
-
'right' => __('Right', 'so-widgets-bundle'),
|
73 |
-
'center' => __('Center', 'so-widgets-bundle'),
|
74 |
-
'justify' => __('Justify', 'so-widgets-bundle'),
|
75 |
-
),
|
76 |
-
),
|
77 |
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
|
|
|
|
|
|
|
|
|
|
87 |
),
|
|
|
88 |
|
89 |
-
|
90 |
-
'
|
91 |
-
|
92 |
-
|
|
|
|
|
|
|
|
|
93 |
),
|
|
|
94 |
|
95 |
-
'text_color' => array(
|
96 |
-
'type' => 'color',
|
97 |
-
'label' => __('Text color', 'so-widgets-bundle'),
|
98 |
-
),
|
99 |
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
),
|
105 |
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
'1' => __('Normal', 'so-widgets-bundle'),
|
111 |
-
'1.15' => __('Medium', 'so-widgets-bundle'),
|
112 |
-
'1.3' => __('Large', 'so-widgets-bundle'),
|
113 |
-
'1.45' => __('Extra large', 'so-widgets-bundle'),
|
114 |
-
),
|
115 |
-
),
|
116 |
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
'0' => __('None', 'so-widgets-bundle'),
|
123 |
-
'0.25' => __('Slightly rounded', 'so-widgets-bundle'),
|
124 |
-
'0.5' => __('Very rounded', 'so-widgets-bundle'),
|
125 |
-
'1.5' => __('Completely rounded', 'so-widgets-bundle'),
|
126 |
-
),
|
127 |
-
),
|
128 |
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
'
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
'1.8' => __('Very high', 'so-widgets-bundle'),
|
138 |
-
),
|
139 |
),
|
140 |
-
|
141 |
),
|
142 |
-
),
|
143 |
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
'
|
151 |
-
'
|
152 |
-
'
|
153 |
),
|
|
|
154 |
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
|
|
|
|
|
|
|
|
|
|
159 |
),
|
|
|
160 |
|
161 |
-
'onclick' => array(
|
162 |
-
'type' => 'text',
|
163 |
-
'label' => __('Onclick', 'so-widgets-bundle'),
|
164 |
-
'description' => __('Run this Javascript when the button is clicked. Ideal for tracking.', 'so-widgets-bundle'),
|
165 |
-
),
|
166 |
-
)
|
167 |
),
|
168 |
),
|
169 |
-
plugin_dir_path(__FILE__)
|
170 |
-
);
|
171 |
|
172 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
173 |
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
array(
|
181 |
-
|
182 |
-
|
183 |
-
|
|
|
|
|
|
|
184 |
);
|
185 |
}
|
186 |
|
@@ -267,4 +271,4 @@ class SiteOrigin_Widget_Button_Widget extends SiteOrigin_Widget {
|
|
267 |
}
|
268 |
}
|
269 |
|
270 |
-
siteorigin_widget_register('sow-button', __FILE__, 'SiteOrigin_Widget_Button_Widget');
|
19 |
array(
|
20 |
|
21 |
),
|
22 |
+
false,
|
23 |
+
plugin_dir_path(__FILE__)
|
24 |
+
);
|
25 |
+
|
26 |
+
}
|
27 |
+
|
28 |
+
function initialize() {
|
29 |
+
$this->register_frontend_styles(
|
30 |
array(
|
31 |
+
array(
|
32 |
+
'sow-button-base',
|
33 |
+
plugin_dir_url(__FILE__) . 'css/style.css',
|
34 |
+
array(),
|
35 |
+
SOW_BUNDLE_VERSION
|
36 |
),
|
37 |
+
)
|
38 |
+
);
|
39 |
+
}
|
40 |
|
41 |
+
function initialize_form() {
|
42 |
+
return array(
|
43 |
+
'text' => array(
|
44 |
+
'type' => 'text',
|
45 |
+
'label' => __('Button text', 'so-widgets-bundle'),
|
46 |
+
),
|
47 |
|
48 |
+
'url' => array(
|
49 |
+
'type' => 'link',
|
50 |
+
'label' => __('Destination URL', 'so-widgets-bundle'),
|
51 |
+
),
|
|
|
52 |
|
53 |
+
'new_window' => array(
|
54 |
+
'type' => 'checkbox',
|
55 |
+
'default' => false,
|
56 |
+
'label' => __('Open in a new window', 'so-widgets-bundle'),
|
57 |
+
),
|
|
|
|
|
|
|
58 |
|
59 |
+
'button_icon' => array(
|
60 |
+
'type' => 'section',
|
61 |
+
'label' => __('Icon', 'so-widgets-bundle'),
|
62 |
+
'fields' => array(
|
63 |
+
'icon_selected' => array(
|
64 |
+
'type' => 'icon',
|
65 |
+
'label' => __('Icon', 'so-widgets-bundle'),
|
66 |
+
),
|
67 |
|
68 |
+
'icon_color' => array(
|
69 |
+
'type' => 'color',
|
70 |
+
'label' => __('Icon color', 'so-widgets-bundle'),
|
|
|
|
|
71 |
),
|
|
|
72 |
|
73 |
+
'icon' => array(
|
74 |
+
'type' => 'media',
|
75 |
+
'label' => __('Image icon', 'so-widgets-bundle'),
|
76 |
+
'description' => __('Replaces the icon with your own image icon.', 'so-widgets-bundle'),
|
77 |
+
),
|
78 |
+
),
|
79 |
+
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
|
81 |
+
'design' => array(
|
82 |
+
'type' => 'section',
|
83 |
+
'label' => __('Design and layout', 'so-widgets-bundle'),
|
84 |
+
'hide' => true,
|
85 |
+
'fields' => array(
|
86 |
+
'align' => array(
|
87 |
+
'type' => 'select',
|
88 |
+
'label' => __('Align', 'so-widgets-bundle'),
|
89 |
+
'default' => 'center',
|
90 |
+
'options' => array(
|
91 |
+
'left' => __('Left', 'so-widgets-bundle'),
|
92 |
+
'right' => __('Right', 'so-widgets-bundle'),
|
93 |
+
'center' => __('Center', 'so-widgets-bundle'),
|
94 |
+
'justify' => __('Justify', 'so-widgets-bundle'),
|
95 |
),
|
96 |
+
),
|
97 |
|
98 |
+
'theme' => array(
|
99 |
+
'type' => 'select',
|
100 |
+
'label' => __('Button theme', 'so-widgets-bundle'),
|
101 |
+
'default' => 'atom',
|
102 |
+
'options' => array(
|
103 |
+
'atom' => __('Atom', 'so-widgets-bundle'),
|
104 |
+
'flat' => __('Flat', 'so-widgets-bundle'),
|
105 |
+
'wire' => __('Wire', 'so-widgets-bundle'),
|
106 |
),
|
107 |
+
),
|
108 |
|
|
|
|
|
|
|
|
|
109 |
|
110 |
+
'button_color' => array(
|
111 |
+
'type' => 'color',
|
112 |
+
'label' => __('Button color', 'so-widgets-bundle'),
|
113 |
+
),
|
|
|
114 |
|
115 |
+
'text_color' => array(
|
116 |
+
'type' => 'color',
|
117 |
+
'label' => __('Text color', 'so-widgets-bundle'),
|
118 |
+
),
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
|
120 |
+
'hover' => array(
|
121 |
+
'type' => 'checkbox',
|
122 |
+
'default' => true,
|
123 |
+
'label' => __('Use hover effects', 'so-widgets-bundle'),
|
124 |
+
),
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
|
126 |
+
'font_size' => array(
|
127 |
+
'type' => 'select',
|
128 |
+
'label' => __('Font size', 'so-widgets-bundle'),
|
129 |
+
'options' => array(
|
130 |
+
'1' => __('Normal', 'so-widgets-bundle'),
|
131 |
+
'1.15' => __('Medium', 'so-widgets-bundle'),
|
132 |
+
'1.3' => __('Large', 'so-widgets-bundle'),
|
133 |
+
'1.45' => __('Extra large', 'so-widgets-bundle'),
|
|
|
|
|
134 |
),
|
|
|
135 |
),
|
|
|
136 |
|
137 |
+
'rounding' => array(
|
138 |
+
'type' => 'select',
|
139 |
+
'label' => __('Rounding', 'so-widgets-bundle'),
|
140 |
+
'default' => '0.25',
|
141 |
+
'options' => array(
|
142 |
+
'0' => __('None', 'so-widgets-bundle'),
|
143 |
+
'0.25' => __('Slightly rounded', 'so-widgets-bundle'),
|
144 |
+
'0.5' => __('Very rounded', 'so-widgets-bundle'),
|
145 |
+
'1.5' => __('Completely rounded', 'so-widgets-bundle'),
|
146 |
),
|
147 |
+
),
|
148 |
|
149 |
+
'padding' => array(
|
150 |
+
'type' => 'select',
|
151 |
+
'label' => __('Padding', 'so-widgets-bundle'),
|
152 |
+
'default' => '1',
|
153 |
+
'options' => array(
|
154 |
+
'0.5' => __('Low', 'so-widgets-bundle'),
|
155 |
+
'1' => __('Medium', 'so-widgets-bundle'),
|
156 |
+
'1.4' => __('High', 'so-widgets-bundle'),
|
157 |
+
'1.8' => __('Very high', 'so-widgets-bundle'),
|
158 |
),
|
159 |
+
),
|
160 |
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
),
|
162 |
),
|
|
|
|
|
163 |
|
164 |
+
'attributes' => array(
|
165 |
+
'type' => 'section',
|
166 |
+
'label' => __('Other attributes and SEO', 'so-widgets-bundle'),
|
167 |
+
'hide' => true,
|
168 |
+
'fields' => array(
|
169 |
+
'id' => array(
|
170 |
+
'type' => 'text',
|
171 |
+
'label' => __('Button ID', 'so-widgets-bundle'),
|
172 |
+
'description' => __('An ID attribute allows you to target this button in Javascript.', 'so-widgets-bundle'),
|
173 |
+
),
|
174 |
|
175 |
+
'title' => array(
|
176 |
+
'type' => 'text',
|
177 |
+
'label' => __('Title attribute', 'so-widgets-bundle'),
|
178 |
+
'description' => __('Adds a title attribute to the button link.', 'so-widgets-bundle'),
|
179 |
+
),
|
180 |
+
|
181 |
+
'onclick' => array(
|
182 |
+
'type' => 'text',
|
183 |
+
'label' => __('Onclick', 'so-widgets-bundle'),
|
184 |
+
'description' => __('Run this Javascript when the button is clicked. Ideal for tracking.', 'so-widgets-bundle'),
|
185 |
+
),
|
186 |
+
)
|
187 |
+
),
|
188 |
);
|
189 |
}
|
190 |
|
271 |
}
|
272 |
}
|
273 |
|
274 |
+
siteorigin_widget_register('sow-button', __FILE__, 'SiteOrigin_Widget_Button_Widget');
|
widgets/contact/contact.php
CHANGED
@@ -17,473 +17,510 @@ class SiteOrigin_Widgets_ContactForm_Widget extends SiteOrigin_Widget {
|
|
17 |
'description' => __( 'Create a simple contact form for your users to get hold of you.', 'so-widgets-bundle' ),
|
18 |
),
|
19 |
array(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
array(
|
21 |
-
|
22 |
-
'
|
23 |
-
|
24 |
-
|
25 |
-
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
|
|
|
|
|
|
31 |
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
'
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
'
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
|
|
|
|
|
|
|
|
64 |
)
|
65 |
-
)
|
|
|
|
|
|
|
66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
'fields' => array(
|
68 |
|
69 |
-
'type' =>
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
'
|
79 |
-
'
|
80 |
-
'options' => array(
|
81 |
-
'name' => __( 'Name', 'so-widgets-bundle' ),
|
82 |
-
'email' => __( 'Email', 'so-widgets-bundle' ),
|
83 |
-
'subject' => __( 'Subject', 'so-widgets-bundle' ),
|
84 |
-
'text' => __( 'Text', 'so-widgets-bundle' ),
|
85 |
-
'textarea' => __( 'Text Area', 'so-widgets-bundle' ),
|
86 |
-
'select' => __( 'Dropdown Select', 'so-widgets-bundle' ),
|
87 |
-
'checkboxes' => __( 'Checkboxes', 'so-widgets-bundle' ),
|
88 |
-
),
|
89 |
-
'state_emitter' => array(
|
90 |
-
'callback' => 'select',
|
91 |
-
'args' => array( 'field_type_{$repeater}' ),
|
92 |
-
)
|
93 |
),
|
|
|
|
|
|
|
|
|
|
|
94 |
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
'type' => 'checkbox',
|
106 |
-
'label' => __('Required field', 'so-widgets-bundle'),
|
107 |
-
'description' => __('Is this field required?', 'so-widgets-bundle'),
|
108 |
-
),
|
109 |
-
'missing_message' => array(
|
110 |
-
'type' => 'text',
|
111 |
-
'label' => __('Missing message', 'so-widgets-bundle'),
|
112 |
-
'description' => __('Error message to display if this field is missing.', 'so-widgets-bundle'),
|
113 |
-
)
|
114 |
-
)
|
115 |
-
),
|
116 |
|
117 |
-
|
118 |
-
'
|
119 |
-
|
120 |
-
|
121 |
-
'
|
122 |
-
|
123 |
-
|
124 |
-
'
|
125 |
-
'type' => 'text',
|
126 |
-
'label' => __( 'Value', 'so-widgets-bundle' ),
|
127 |
-
),
|
128 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
),
|
135 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
),
|
137 |
),
|
|
|
138 |
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
),
|
170 |
),
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
),
|
179 |
),
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
),
|
188 |
),
|
189 |
-
)
|
190 |
-
)
|
|
|
191 |
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
),
|
208 |
-
'description' => __('How to handle submissions that are identified as spam.', 'so-widgets-bundle'),
|
209 |
-
'default' => 'error',
|
210 |
),
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
|
|
|
|
|
|
215 |
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
'container' => array(
|
223 |
-
'type' => 'section',
|
224 |
-
'label' => __('Container', 'so-widgets-bundle'),
|
225 |
-
'fields' => array(
|
226 |
-
'background' => array(
|
227 |
-
'type' => 'color',
|
228 |
-
'label' => __('Background color', 'so-widgets-bundle'),
|
229 |
-
'default' => '#f2f2f2',
|
230 |
-
),
|
231 |
-
'padding' => array(
|
232 |
-
'type' => 'measurement',
|
233 |
-
'label' => __('Padding', 'so-widgets-bundle'),
|
234 |
-
'default' => '10px',
|
235 |
-
),
|
236 |
-
'border_color' => array(
|
237 |
-
'type' => 'color',
|
238 |
-
'label' => __('Border color', 'so-widgets-bundle'),
|
239 |
-
'default' => '#c0c0c0',
|
240 |
-
),
|
241 |
-
'border_width' => array(
|
242 |
-
'type' => 'measurement',
|
243 |
-
'label' => __('Border width', 'so-widgets-bundle'),
|
244 |
-
'default' => '1px',
|
245 |
-
),
|
246 |
-
'border_style' => array(
|
247 |
-
'type' => 'select',
|
248 |
-
'label' => __('Border style', 'so-widgets-bundle'),
|
249 |
-
'default' => 'solid',
|
250 |
-
'options' => array(
|
251 |
-
'none' => __( 'None', 'so-widgets-bundle' ),
|
252 |
-
'hidden' => __( 'Hidden', 'so-widgets-bundle' ),
|
253 |
-
'dotted' => __( 'Dotted', 'so-widgets-bundle' ),
|
254 |
-
'dashed' => __( 'Dashed', 'so-widgets-bundle' ),
|
255 |
-
'solid' => __( 'Solid', 'so-widgets-bundle' ),
|
256 |
-
'double' => __( 'Double', 'so-widgets-bundle' ),
|
257 |
-
'groove' => __( 'Groove', 'so-widgets-bundle' ),
|
258 |
-
'ridge' => __( 'Ridge', 'so-widgets-bundle' ),
|
259 |
-
'inset' => __( 'Inset', 'so-widgets-bundle' ),
|
260 |
-
'outset' => __( 'Outset', 'so-widgets-bundle' ),
|
261 |
-
)
|
262 |
-
),
|
263 |
-
)
|
264 |
-
),
|
265 |
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
),
|
275 |
-
'size' => array(
|
276 |
-
'type' => 'measurement',
|
277 |
-
'label' => __( 'Font size', 'so-widgets-bundle' ),
|
278 |
-
'default' => 'default',
|
279 |
-
),
|
280 |
-
'color' => array(
|
281 |
-
'type' => 'color',
|
282 |
-
'label' => __( 'Color', 'so-widgets-bundle' ),
|
283 |
-
'default' => 'default',
|
284 |
-
),
|
285 |
-
'position' => array(
|
286 |
-
'type' => 'select',
|
287 |
-
'label' => __( 'Position', 'so-widgets-bundle' ),
|
288 |
-
'default' => 'above',
|
289 |
-
'options' => array(
|
290 |
-
'above' => __( 'Above', 'so-widgets-bundle' ),
|
291 |
-
'below' => __( 'Below', 'so-widgets-bundle' ),
|
292 |
-
'left' => __( 'Left', 'so-widgets-bundle' ),
|
293 |
-
'right' => __( 'Right', 'so-widgets-bundle' ),
|
294 |
-
'inside' => __( 'Inside', 'so-widgets-bundle' ),
|
295 |
-
),
|
296 |
-
),
|
297 |
-
'width' => array(
|
298 |
-
'type' => 'measurement',
|
299 |
-
'label' => __( 'Width', 'so-widgets-bundle' ),
|
300 |
-
'default' => '',
|
301 |
-
),
|
302 |
-
'align' => array(
|
303 |
-
'type' => 'select',
|
304 |
-
'label' => __( 'Align', 'so-widgets-bundle' ),
|
305 |
-
'default' => 'left',
|
306 |
-
'options' => array(
|
307 |
-
'left' => __( 'Left', 'so-widgets-bundle' ),
|
308 |
-
'right' => __( 'Right', 'so-widgets-bundle' ),
|
309 |
-
'center' => __( 'Center', 'so-widgets-bundle' ),
|
310 |
-
'justify' => __( 'Justify', 'so-widgets-bundle' ),
|
311 |
-
)
|
312 |
-
),
|
313 |
),
|
314 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
315 |
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
'
|
342 |
-
'
|
343 |
-
'
|
|
|
344 |
),
|
345 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
346 |
),
|
|
|
347 |
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
358 |
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
'
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
'
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
'
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
'
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
'border_radius' => array(
|
391 |
-
'type' => 'slider',
|
392 |
-
'label' => __('Border rounding', 'so-widgets-bundle'),
|
393 |
-
'default' => 3,
|
394 |
-
'max' => 50,
|
395 |
-
'min' => 0
|
396 |
-
),
|
397 |
-
'text_color' => array(
|
398 |
-
'type' => 'color',
|
399 |
-
'label' => __('Text color', 'so-widgets-bundle'),
|
400 |
-
'default' => '#5a5a5a',
|
401 |
-
),
|
402 |
-
'font_size' => array(
|
403 |
-
'type' => 'measurement',
|
404 |
-
'label' => __('Font size', 'so-widgets-bundle'),
|
405 |
-
'default' => 'default',
|
406 |
-
),
|
407 |
-
'weight' => array(
|
408 |
-
'type' => 'select',
|
409 |
-
'label' => __('Font weight', 'so-widgets-bundle'),
|
410 |
-
'default' => '500',
|
411 |
-
'options' => array(
|
412 |
-
'normal' => __('Normal', 'so-widgets-bundle'),
|
413 |
-
'500' => __('Semi-bold', 'so-widgets-bundle'),
|
414 |
-
'bold' => __('Bold', 'so-widgets-bundle'),
|
415 |
-
)
|
416 |
-
),
|
417 |
-
'padding' => array(
|
418 |
-
'type' => 'measurement',
|
419 |
-
'label' => __('Padding', 'so-widgets-bundle'),
|
420 |
-
'default' => '10px',
|
421 |
-
),
|
422 |
-
'inset_highlight' => array(
|
423 |
-
'type' => 'slider',
|
424 |
-
'label' => __('Inset highlight', 'so-widgets-bundle'),
|
425 |
-
'description' => __('The white highlight at the bottom of the button', 'so-widgets-bundle'),
|
426 |
-
'default' => 50,
|
427 |
-
'max' => 100,
|
428 |
-
'min' => 0
|
429 |
-
),
|
430 |
-
)
|
431 |
-
),
|
432 |
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
464 |
),
|
465 |
),
|
466 |
),
|
467 |
),
|
468 |
-
)
|
469 |
-
);
|
470 |
-
}
|
471 |
-
|
472 |
-
/**
|
473 |
-
* Initialize the contact form widget
|
474 |
-
*/
|
475 |
-
function initialize(){
|
476 |
-
$this->register_frontend_scripts(
|
477 |
-
array(
|
478 |
-
array(
|
479 |
-
'sow-contact',
|
480 |
-
plugin_dir_url(__FILE__) . 'js/contact' . SOW_BUNDLE_JS_SUFFIX . '.js',
|
481 |
-
array( 'jquery' ),
|
482 |
-
SOW_BUNDLE_VERSION
|
483 |
-
)
|
484 |
-
)
|
485 |
);
|
486 |
-
add_filter( 'siteorigin_widgets_sanitize_field_multiple_emails', array( $this, 'sanitize_multiple_emails' ) );
|
487 |
}
|
488 |
|
489 |
function sanitize_multiple_emails( $value ) {
|
@@ -546,7 +583,8 @@ class SiteOrigin_Widgets_ContactForm_Widget extends SiteOrigin_Widget {
|
|
546 |
unset($instance['title']);
|
547 |
unset($instance['display_title']);
|
548 |
unset($instance['design']);
|
549 |
-
unset($instance['
|
|
|
550 |
|
551 |
$vars['instance_hash'] = md5( serialize( $instance) );
|
552 |
return $vars;
|
@@ -580,6 +618,11 @@ class SiteOrigin_Widgets_ContactForm_Widget extends SiteOrigin_Widget {
|
|
580 |
'label_width' => $instance['design']['labels']['width'],
|
581 |
'label_align' => $instance['design']['labels']['align'],
|
582 |
|
|
|
|
|
|
|
|
|
|
|
583 |
// The error message styles
|
584 |
'error_background' => $instance['design']['errors']['background'],
|
585 |
'error_border' => $instance['design']['errors']['border_color'],
|
@@ -723,6 +766,14 @@ class SiteOrigin_Widgets_ContactForm_Widget extends SiteOrigin_Widget {
|
|
723 |
$this->render_form_label( $field_id, $field['label'], $instance );
|
724 |
}
|
725 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
726 |
?></div><?php
|
727 |
}
|
728 |
}
|
@@ -749,6 +800,13 @@ class SiteOrigin_Widgets_ContactForm_Widget extends SiteOrigin_Widget {
|
|
749 |
);
|
750 |
}
|
751 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
752 |
$errors = array();
|
753 |
$email_fields = array();
|
754 |
$post_vars = stripslashes_deep( $_POST );
|
@@ -840,10 +898,12 @@ class SiteOrigin_Widgets_ContactForm_Widget extends SiteOrigin_Widget {
|
|
840 |
}
|
841 |
}
|
842 |
|
843 |
-
|
844 |
'status' => empty($errors) ? 'success' : 'fail',
|
845 |
'errors' => $errors
|
846 |
);
|
|
|
|
|
847 |
}
|
848 |
|
849 |
/**
|
@@ -972,8 +1032,8 @@ class SiteOrigin_Widgets_ContactForm_Widget extends SiteOrigin_Widget {
|
|
972 |
// Store the version with the expired hashes removed
|
973 |
update_option( 'so_contact_hashes', $hash_check, true );
|
974 |
|
975 |
-
// This
|
976 |
-
return
|
977 |
}
|
978 |
|
979 |
$mail_success = wp_mail( $instance['settings']['to'], $email_fields['subject'], $body, $headers );
|
17 |
'description' => __( 'Create a simple contact form for your users to get hold of you.', 'so-widgets-bundle' ),
|
18 |
),
|
19 |
array(),
|
20 |
+
false,
|
21 |
+
plugin_dir_path(__FILE__)
|
22 |
+
);
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Initialize the contact form widget
|
27 |
+
*/
|
28 |
+
function initialize(){
|
29 |
+
$this->register_frontend_scripts(
|
30 |
array(
|
31 |
+
array(
|
32 |
+
'sow-contact',
|
33 |
+
plugin_dir_url(__FILE__) . 'js/contact' . SOW_BUNDLE_JS_SUFFIX . '.js',
|
34 |
+
array( 'jquery' ),
|
35 |
+
SOW_BUNDLE_VERSION
|
36 |
+
)
|
37 |
+
)
|
38 |
+
);
|
39 |
+
add_filter( 'siteorigin_widgets_sanitize_field_multiple_emails', array( $this, 'sanitize_multiple_emails' ) );
|
40 |
+
}
|
41 |
|
42 |
+
function initialize_form(){
|
43 |
+
return array(
|
44 |
+
'title' => array(
|
45 |
+
'type' => 'text',
|
46 |
+
'label' => __('Title', 'so-widgets-bundle'),
|
47 |
+
'default' => __('Contact Us', 'so-widgets-bundle'),
|
48 |
+
),
|
49 |
|
50 |
+
'display_title' => array(
|
51 |
+
'type' => 'checkbox',
|
52 |
+
'label' => __('Display title', 'so-widgets-bundle'),
|
53 |
+
),
|
54 |
+
|
55 |
+
'settings' => array(
|
56 |
+
'type' => 'section',
|
57 |
+
'label' => __('Settings', 'so-widgets-bundle'),
|
58 |
+
'hide' => true,
|
59 |
+
'fields' => array(
|
60 |
+
'to' => array(
|
61 |
+
'type' => 'text',
|
62 |
+
'label' => __('To email address', 'so-widgets-bundle'),
|
63 |
+
'description' => __('Where contact emails will be delivered to.', 'so-widgets-bundle'),
|
64 |
+
'sanitize' => 'multiple_emails',
|
65 |
+
),
|
66 |
+
'default_subject' => array(
|
67 |
+
'type' => 'text',
|
68 |
+
'label' => __('Default subject', 'so-widgets-bundle'),
|
69 |
+
'description' => __("Subject to use when there isn't one available.", 'so-widgets-bundle'),
|
70 |
+
),
|
71 |
+
'subject_prefix' => array(
|
72 |
+
'type' => 'text',
|
73 |
+
'label' => __('Subject prefix', 'so-widgets-bundle'),
|
74 |
+
'description' => __('Prefix added to all incoming email subjects.', 'so-widgets-bundle'),
|
75 |
+
),
|
76 |
+
'success_message' => array(
|
77 |
+
'type' => 'tinymce',
|
78 |
+
'label' => __('Success message', 'so-widgets-bundle'),
|
79 |
+
'description' => __('Message to display after message successfully sent.', 'so-widgets-bundle'),
|
80 |
+
'default' => __("Thanks for contacting us. We'll get back to you shortly.", 'so-widgets-bundle')
|
81 |
+
),
|
82 |
+
'submit_text' => array(
|
83 |
+
'type' => 'text',
|
84 |
+
'label' => __('Submit button text', 'so-widgets-bundle'),
|
85 |
+
'default' => __("Contact Us", 'so-widgets-bundle')
|
86 |
)
|
87 |
+
)
|
88 |
+
),
|
89 |
+
|
90 |
+
'fields' => array(
|
91 |
|
92 |
+
'type' => 'repeater',
|
93 |
+
'label' => __('Fields', 'so-widgets-bundle'),
|
94 |
+
'item_name' => __('Field', 'so-widgets-bundle'),
|
95 |
+
'item_label' => array(
|
96 |
+
'selector' => "[id*='label']",
|
97 |
+
),
|
98 |
'fields' => array(
|
99 |
|
100 |
+
'type' => array(
|
101 |
+
'type' => 'select',
|
102 |
+
'label' => __( 'Field Type', 'so-widgets-bundle' ),
|
103 |
+
'options' => array(
|
104 |
+
'name' => __( 'Name', 'so-widgets-bundle' ),
|
105 |
+
'email' => __( 'Email', 'so-widgets-bundle' ),
|
106 |
+
'subject' => __( 'Subject', 'so-widgets-bundle' ),
|
107 |
+
'text' => __( 'Text', 'so-widgets-bundle' ),
|
108 |
+
'textarea' => __( 'Text Area', 'so-widgets-bundle' ),
|
109 |
+
'select' => __( 'Dropdown Select', 'so-widgets-bundle' ),
|
110 |
+
'checkboxes' => __( 'Checkboxes', 'so-widgets-bundle' ),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
),
|
112 |
+
'state_emitter' => array(
|
113 |
+
'callback' => 'select',
|
114 |
+
'args' => array( 'field_type_{$repeater}' ),
|
115 |
+
)
|
116 |
+
),
|
117 |
|
118 |
+
'label' => array(
|
119 |
+
'type' => 'text',
|
120 |
+
'label' => __('Label', 'so-widgets-bundle'),
|
121 |
+
),
|
122 |
|
123 |
+
'description' => array(
|
124 |
+
'type' => 'text',
|
125 |
+
'label' => __('Description', 'so-widgets-bundle'),
|
126 |
+
'description' => __('This text will appear small beneath the input field.', 'so-widgets-bundle'),
|
127 |
+
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
|
129 |
+
'required' => array(
|
130 |
+
'type' => 'section',
|
131 |
+
'label' => __('Required Field', 'so-widgets-bundle'),
|
132 |
+
'fields' => array(
|
133 |
+
'required' => array(
|
134 |
+
'type' => 'checkbox',
|
135 |
+
'label' => __('Required field', 'so-widgets-bundle'),
|
136 |
+
'description' => __('Is this field required?', 'so-widgets-bundle'),
|
|
|
|
|
|
|
137 |
),
|
138 |
+
'missing_message' => array(
|
139 |
+
'type' => 'text',
|
140 |
+
'label' => __('Missing message', 'so-widgets-bundle'),
|
141 |
+
'description' => __('Error message to display if this field is missing.', 'so-widgets-bundle'),
|
142 |
+
)
|
143 |
+
)
|
144 |
+
),
|
145 |
|
146 |
+
// This are for select and checkboxes
|
147 |
+
'options' => array(
|
148 |
+
'type' => 'repeater',
|
149 |
+
'label' => __( 'Options', 'so-widgets-bundle' ),
|
150 |
+
'item_name' => __( 'Option', 'so-widgets-bundle' ),
|
151 |
+
'item_label' => array( 'selector' => "[id*='value']" ),
|
152 |
+
'fields' => array(
|
153 |
+
'value' => array(
|
154 |
+
'type' => 'text',
|
155 |
+
'label' => __( 'Value', 'so-widgets-bundle' ),
|
156 |
),
|
157 |
),
|
158 |
+
|
159 |
+
// These are only required for a few states
|
160 |
+
'state_handler' => array(
|
161 |
+
'field_type_{$repeater}[select,checkboxes]' => array('show'),
|
162 |
+
'_else[field_type_{$repeater}]' => array( 'hide' ),
|
163 |
+
),
|
164 |
),
|
165 |
),
|
166 |
+
),
|
167 |
|
168 |
+
'spam' => array(
|
169 |
+
'type' => 'section',
|
170 |
+
'label' => __( 'Spam Protection', 'so-widgets-bundle' ),
|
171 |
+
'hide' => true,
|
172 |
+
'fields' => array(
|
173 |
+
|
174 |
+
'recaptcha' => array(
|
175 |
+
'type' => 'section',
|
176 |
+
'label' => __('Recaptcha', 'so-widgets-bundle'),
|
177 |
+
'fields' => array(
|
178 |
+
'use_captcha' => array(
|
179 |
+
'type' => 'checkbox',
|
180 |
+
'label' => __( 'Use Captcha', 'so-widgets-bundle' ),
|
181 |
+
'default' => false,
|
182 |
+
),
|
183 |
+
'site_key' => array(
|
184 |
+
'type' => 'text',
|
185 |
+
'label' => __( 'ReCaptcha Site Key', 'so-widgets-bundle' ),
|
186 |
+
),
|
187 |
+
'secret_key' => array(
|
188 |
+
'type' => 'text',
|
189 |
+
'label' => __( 'ReCaptcha Secret Key', 'so-widgets-bundle' ),
|
190 |
+
),
|
191 |
+
'theme' => array(
|
192 |
+
'type' => 'select',
|
193 |
+
'label' => __( 'Theme', 'so-widgets-bundle' ),
|
194 |
+
'default' => 'light',
|
195 |
+
'options' => array(
|
196 |
+
'light' => __( 'Light', 'so-widgets-bundle' ),
|
197 |
+
'dark' => __( 'Dark', 'so-widgets-bundle' ),
|
|
|
198 |
),
|
199 |
+
),
|
200 |
+
'type' => array(
|
201 |
+
'type' => 'select',
|
202 |
+
'label' => __( 'Challenge type', 'so-widgets-bundle' ),
|
203 |
+
'default' => 'image',
|
204 |
+
'options' => array(
|
205 |
+
'image' => __( 'Image', 'so-widgets-bundle' ),
|
206 |
+
'audio' => __( 'Audio', 'so-widgets-bundle' ),
|
207 |
),
|
208 |
+
),
|
209 |
+
'size' => array(
|
210 |
+
'type' => 'select',
|
211 |
+
'label' => __( 'Size', 'so-widgets-bundle' ),
|
212 |
+
'default' => 'normal',
|
213 |
+
'options' => array(
|
214 |
+
'normal' => __( 'Normal', 'so-widgets-bundle' ),
|
215 |
+
'compact' => __( 'Compact', 'so-widgets-bundle' ),
|
216 |
),
|
217 |
+
),
|
218 |
+
)
|
219 |
+
),
|
220 |
|
221 |
+
'akismet' => array(
|
222 |
+
'type' => 'section',
|
223 |
+
'label' => __('Akismet', 'so-widgets-bundle'),
|
224 |
+
'fields' => array(
|
225 |
+
'use_akismet'=> array(
|
226 |
+
'type' => 'checkbox',
|
227 |
+
'label' => __( 'Use Akismet filtering', 'so-widgets-bundle' ),
|
228 |
+
'default' => true,
|
229 |
+
),
|
230 |
+
'spam_action'=> array(
|
231 |
+
'type' => 'select',
|
232 |
+
'label' => __( 'Spam action', 'so-widgets-bundle' ),
|
233 |
+
'options' => array(
|
234 |
+
'error' => __('Show error message', 'so-widgets-bundle'),
|
235 |
+
'tag' => __('Tag as spam in subject', 'so-widgets-bundle'),
|
|
|
|
|
|
|
236 |
),
|
237 |
+
'description' => __('How to handle submissions that are identified as spam.', 'so-widgets-bundle'),
|
238 |
+
'default' => 'error',
|
239 |
+
),
|
240 |
+
)
|
241 |
+
),
|
242 |
+
)
|
243 |
+
),
|
244 |
|
245 |
+
'design' => array(
|
246 |
+
'type' => 'section',
|
247 |
+
'label' => __('Design', 'so-widgets-bundle'),
|
248 |
+
'hide' => true,
|
249 |
+
'fields' => array(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
250 |
|
251 |
+
'container' => array(
|
252 |
+
'type' => 'section',
|
253 |
+
'label' => __('Container', 'so-widgets-bundle'),
|
254 |
+
'fields' => array(
|
255 |
+
'background' => array(
|
256 |
+
'type' => 'color',
|
257 |
+
'label' => __('Background color', 'so-widgets-bundle'),
|
258 |
+
'default' => '#f2f2f2',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
259 |
),
|
260 |
+
'padding' => array(
|
261 |
+
'type' => 'measurement',
|
262 |
+
'label' => __('Padding', 'so-widgets-bundle'),
|
263 |
+
'default' => '10px',
|
264 |
+
),
|
265 |
+
'border_color' => array(
|
266 |
+
'type' => 'color',
|
267 |
+
'label' => __('Border color', 'so-widgets-bundle'),
|
268 |
+
'default' => '#c0c0c0',
|
269 |
+
),
|
270 |
+
'border_width' => array(
|
271 |
+
'type' => 'measurement',
|
272 |
+
'label' => __('Border width', 'so-widgets-bundle'),
|
273 |
+
'default' => '1px',
|
274 |
+
),
|
275 |
+
'border_style' => array(
|
276 |
+
'type' => 'select',
|
277 |
+
'label' => __('Border style', 'so-widgets-bundle'),
|
278 |
+
'default' => 'solid',
|
279 |
+
'options' => array(
|
280 |
+
'none' => __( 'None', 'so-widgets-bundle' ),
|
281 |
+
'hidden' => __( 'Hidden', 'so-widgets-bundle' ),
|
282 |
+
'dotted' => __( 'Dotted', 'so-widgets-bundle' ),
|
283 |
+
'dashed' => __( 'Dashed', 'so-widgets-bundle' ),
|
284 |
+
'solid' => __( 'Solid', 'so-widgets-bundle' ),
|
285 |
+
'double' => __( 'Double', 'so-widgets-bundle' ),
|
286 |
+
'groove' => __( 'Groove', 'so-widgets-bundle' ),
|
287 |
+
'ridge' => __( 'Ridge', 'so-widgets-bundle' ),
|
288 |
+
'inset' => __( 'Inset', 'so-widgets-bundle' ),
|
289 |
+
'outset' => __( 'Outset', 'so-widgets-bundle' ),
|
290 |
+
)
|
291 |
+
),
|
292 |
+
)
|
293 |
+
),
|
294 |
|
295 |
+
'labels' => array(
|
296 |
+
'type' => 'section',
|
297 |
+
'label' => __( 'Field labels', 'so-widgets-bundle' ),
|
298 |
+
'fields' => array(
|
299 |
+
'font' => array(
|
300 |
+
'type' => 'font',
|
301 |
+
'label' => __( 'Font', 'so-widgets-bundle' ),
|
302 |
+
'default' => 'default',
|
303 |
+
),
|
304 |
+
'size' => array(
|
305 |
+
'type' => 'measurement',
|
306 |
+
'label' => __( 'Font size', 'so-widgets-bundle' ),
|
307 |
+
'default' => 'default',
|
308 |
+
),
|
309 |
+
'color' => array(
|
310 |
+
'type' => 'color',
|
311 |
+
'label' => __( 'Color', 'so-widgets-bundle' ),
|
312 |
+
'default' => 'default',
|
313 |
+
),
|
314 |
+
'position' => array(
|
315 |
+
'type' => 'select',
|
316 |
+
'label' => __( 'Position', 'so-widgets-bundle' ),
|
317 |
+
'default' => 'above',
|
318 |
+
'options' => array(
|
319 |
+
'above' => __( 'Above', 'so-widgets-bundle' ),
|
320 |
+
'below' => __( 'Below', 'so-widgets-bundle' ),
|
321 |
+
'left' => __( 'Left', 'so-widgets-bundle' ),
|
322 |
+
'right' => __( 'Right', 'so-widgets-bundle' ),
|
323 |
+
'inside' => __( 'Inside', 'so-widgets-bundle' ),
|
324 |
),
|
325 |
+
),
|
326 |
+
'width' => array(
|
327 |
+
'type' => 'measurement',
|
328 |
+
'label' => __( 'Width', 'so-widgets-bundle' ),
|
329 |
+
'default' => '',
|
330 |
+
),
|
331 |
+
'align' => array(
|
332 |
+
'type' => 'select',
|
333 |
+
'label' => __( 'Align', 'so-widgets-bundle' ),
|
334 |
+
'default' => 'left',
|
335 |
+
'options' => array(
|
336 |
+
'left' => __( 'Left', 'so-widgets-bundle' ),
|
337 |
+
'right' => __( 'Right', 'so-widgets-bundle' ),
|
338 |
+
'center' => __( 'Center', 'so-widgets-bundle' ),
|
339 |
+
'justify' => __( 'Justify', 'so-widgets-bundle' ),
|
340 |
+
)
|
341 |
+
),
|
342 |
),
|
343 |
+
),
|
344 |
|
345 |
+
'descriptions' => array(
|
346 |
+
'type' => 'section',
|
347 |
+
'label' => __( 'Field descriptions', 'so-widgets-bundle' ),
|
348 |
+
'fields' => array(
|
349 |
+
'size' => array(
|
350 |
+
'type' => 'measurement',
|
351 |
+
'label' => __( 'Size', 'so-widgets-bundle' ),
|
352 |
+
'default' => '0.9em',
|
353 |
+
),
|
354 |
+
'color' => array(
|
355 |
+
'type' => 'color',
|
356 |
+
'label' => __( 'Color', 'so-widgets-bundle' ),
|
357 |
+
'default' => '#999999',
|
358 |
+
),
|
359 |
+
'style' => array(
|
360 |
+
'type' => 'select',
|
361 |
+
'label' => __( 'Style', 'so-widgets-bundle' ),
|
362 |
+
'default' => 'italic',
|
363 |
+
'options' => array(
|
364 |
+
'italic' => __( 'Italic', 'so-widgets-bundle' ),
|
365 |
+
'normal' => __( 'Normal', 'so-widgets-bundle' ),
|
366 |
+
)
|
367 |
+
),
|
368 |
+
)
|
369 |
+
),
|
370 |
|
371 |
+
'errors' => array(
|
372 |
+
'type' => 'section',
|
373 |
+
'label' => __('Error messages', 'so-widgets-bundle'),
|
374 |
+
'fields' => array(
|
375 |
+
'background' => array(
|
376 |
+
'type' => 'color',
|
377 |
+
'label' => __('Error background color', 'so-widgets-bundle'),
|
378 |
+
'default' => '#fce4e5',
|
379 |
+
),
|
380 |
+
'border_color' => array(
|
381 |
+
'type' => 'color',
|
382 |
+
'label' => __('Error border color', 'so-widgets-bundle'),
|
383 |
+
'default' => '#ec666a',
|
384 |
+
),
|
385 |
+
'text_color' => array(
|
386 |
+
'type' => 'color',
|
387 |
+
'label' => __('Error text color', 'so-widgets-bundle'),
|
388 |
+
'default' => '#ec666a',
|
389 |
+
),
|
390 |
+
'padding' => array(
|
391 |
+
'type' => 'measurement',
|
392 |
+
'label' => __('Error padding', 'so-widgets-bundle'),
|
393 |
+
'default' => '5px',
|
394 |
+
),
|
395 |
+
'margin' => array(
|
396 |
+
'type' => 'measurement',
|
397 |
+
'label' => __('Error margin', 'so-widgets-bundle'),
|
398 |
+
'default' => '10px',
|
399 |
+
),
|
400 |
+
)
|
401 |
+
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
402 |
|
403 |
+
'submit' => array(
|
404 |
+
'type' => 'section',
|
405 |
+
'label' => __('Submit button', 'so-widgets-bundle'),
|
406 |
+
'fields' => array(
|
407 |
+
'styled' => array(
|
408 |
+
'type' => 'checkbox',
|
409 |
+
'label' => __('Style submit button', 'so-widgets-bundle'),
|
410 |
+
'description' => __('Style the button or leave it with default theme styling.', 'so-widgets-bundle'),
|
411 |
+
'default' => true,
|
412 |
+
),
|
413 |
+
|
414 |
+
'background_color' => array(
|
415 |
+
'type' => 'color',
|
416 |
+
'label' => __('Background color', 'so-widgets-bundle'),
|
417 |
+
'default' => '#eeeeee',
|
418 |
+
),
|
419 |
+
'background_gradient' => array(
|
420 |
+
'type' => 'slider',
|
421 |
+
'label' => __('Gradient intensity', 'so-widgets-bundle'),
|
422 |
+
'default' => 10,
|
423 |
+
),
|
424 |
+
'border_color' => array(
|
425 |
+
'type' => 'color',
|
426 |
+
'label' => __('Border color', 'so-widgets-bundle'),
|
427 |
+
'default' => '#989a9c',
|
428 |
+
),
|
429 |
+
'border_style' => array(
|
430 |
+
'type' => 'select',
|
431 |
+
'label' => __('Border style', 'so-widgets-bundle'),
|
432 |
+
'default' => 'solid',
|
433 |
+
'options' => array(
|
434 |
+
'none' => __('None', 'so-widgets-bundle'),
|
435 |
+
'solid' => __('Solid', 'so-widgets-bundle'),
|
436 |
+
'dotted' => __('Dotted', 'so-widgets-bundle'),
|
437 |
+
'dashed' => __('Dashed', 'so-widgets-bundle'),
|
438 |
+
)
|
439 |
+
),
|
440 |
+
'border_width' => array(
|
441 |
+
'type' => 'measurement',
|
442 |
+
'label' => __('Border width', 'so-widgets-bundle'),
|
443 |
+
'default' => '1px',
|
444 |
+
),
|
445 |
+
'border_radius' => array(
|
446 |
+
'type' => 'slider',
|
447 |
+
'label' => __('Border rounding', 'so-widgets-bundle'),
|
448 |
+
'default' => 3,
|
449 |
+
'max' => 50,
|
450 |
+
'min' => 0
|
451 |
+
),
|
452 |
+
'text_color' => array(
|
453 |
+
'type' => 'color',
|
454 |
+
'label' => __('Text color', 'so-widgets-bundle'),
|
455 |
+
'default' => '#5a5a5a',
|
456 |
+
),
|
457 |
+
'font_size' => array(
|
458 |
+
'type' => 'measurement',
|
459 |
+
'label' => __('Font size', 'so-widgets-bundle'),
|
460 |
+
'default' => 'default',
|
461 |
+
),
|
462 |
+
'weight' => array(
|
463 |
+
'type' => 'select',
|
464 |
+
'label' => __('Font weight', 'so-widgets-bundle'),
|
465 |
+
'default' => '500',
|
466 |
+
'options' => array(
|
467 |
+
'normal' => __('Normal', 'so-widgets-bundle'),
|
468 |
+
'500' => __('Semi-bold', 'so-widgets-bundle'),
|
469 |
+
'bold' => __('Bold', 'so-widgets-bundle'),
|
470 |
+
)
|
471 |
+
),
|
472 |
+
'padding' => array(
|
473 |
+
'type' => 'measurement',
|
474 |
+
'label' => __('Padding', 'so-widgets-bundle'),
|
475 |
+
'default' => '10px',
|
476 |
+
),
|
477 |
+
'inset_highlight' => array(
|
478 |
+
'type' => 'slider',
|
479 |
+
'label' => __('Inset highlight', 'so-widgets-bundle'),
|
480 |
+
'description' => __('The white highlight at the bottom of the button', 'so-widgets-bundle'),
|
481 |
+
'default' => 50,
|
482 |
+
'max' => 100,
|
483 |
+
'min' => 0
|
484 |
+
),
|
485 |
+
)
|
486 |
+
),
|
487 |
+
|
488 |
+
'focus' => array(
|
489 |
+
'type' => 'section',
|
490 |
+
'label' => __('Input focus', 'so-widgets-bundle'),
|
491 |
+
'fields' => array(
|
492 |
+
'style' => array(
|
493 |
+
'type' => 'select',
|
494 |
+
'label' => __( 'Style', 'so-widgets-bundle' ),
|
495 |
+
'default' => 'solid',
|
496 |
+
'options' => array(
|
497 |
+
'dotted' => __( 'Dotted', 'so-widgets-bundle' ),
|
498 |
+
'dashed' => __( 'Dashed', 'so-widgets-bundle' ),
|
499 |
+
'solid' => __( 'Solid', 'so-widgets-bundle' ),
|
500 |
+
'double' => __( 'Double', 'so-widgets-bundle' ),
|
501 |
+
'groove' => __( 'Groove', 'so-widgets-bundle' ),
|
502 |
+
'ridge' => __( 'Ridge', 'so-widgets-bundle' ),
|
503 |
+
'inset' => __( 'Inset', 'so-widgets-bundle' ),
|
504 |
+
'outset' => __( 'Outset', 'so-widgets-bundle' ),
|
505 |
+
'none' => __( 'None', 'so-widgets-bundle' ),
|
506 |
+
'hidden' => __( 'Hidden', 'so-widgets-bundle' ),
|
507 |
+
)
|
508 |
+
),
|
509 |
+
'color' => array(
|
510 |
+
'type' => 'color',
|
511 |
+
'label' => __( 'Color', 'so-widgets-bundle' ),
|
512 |
+
'default' => 'default',
|
513 |
+
),
|
514 |
+
'width' => array(
|
515 |
+
'type' => 'measurement',
|
516 |
+
'label' => __( 'Width', 'so-widgets-bundle' ),
|
517 |
+
'default' => '1px',
|
518 |
),
|
519 |
),
|
520 |
),
|
521 |
),
|
522 |
+
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
523 |
);
|
|
|
524 |
}
|
525 |
|
526 |
function sanitize_multiple_emails( $value ) {
|
583 |
unset($instance['title']);
|
584 |
unset($instance['display_title']);
|
585 |
unset($instance['design']);
|
586 |
+
unset($instance['panels_info']);
|
587 |
+
unset($instance['_sow_form_id']);
|
588 |
|
589 |
$vars['instance_hash'] = md5( serialize( $instance) );
|
590 |
return $vars;
|
618 |
'label_width' => $instance['design']['labels']['width'],
|
619 |
'label_align' => $instance['design']['labels']['align'],
|
620 |
|
621 |
+
// Field descriptions
|
622 |
+
'description_font_size' => $instance['design']['descriptions']['size'],
|
623 |
+
'description_font_color' => $instance['design']['descriptions']['color'],
|
624 |
+
'description_font_style' => $instance['design']['descriptions']['style'],
|
625 |
+
|
626 |
// The error message styles
|
627 |
'error_background' => $instance['design']['errors']['background'],
|
628 |
'error_border' => $instance['design']['errors']['border_color'],
|
766 |
$this->render_form_label( $field_id, $field['label'], $instance );
|
767 |
}
|
768 |
|
769 |
+
if ( ! empty( $field['description'] ) ) {
|
770 |
+
?>
|
771 |
+
<div class="sow-form-field-description">
|
772 |
+
<?php echo wp_kses_post( $field['description'] ) ?>
|
773 |
+
</div>
|
774 |
+
<?php
|
775 |
+
}
|
776 |
+
|
777 |
?></div><?php
|
778 |
}
|
779 |
}
|
800 |
);
|
801 |
}
|
802 |
|
803 |
+
// Make sure that this action only runs once per instance
|
804 |
+
static $send_cache = array();
|
805 |
+
$send_cache_hash = md5( serialize( $instance ) . '::' . $storage_hash );
|
806 |
+
if( isset( $send_cache[$send_cache_hash] ) ) {
|
807 |
+
return $send_cache[$send_cache_hash];
|
808 |
+
}
|
809 |
+
|
810 |
$errors = array();
|
811 |
$email_fields = array();
|
812 |
$post_vars = stripslashes_deep( $_POST );
|
898 |
}
|
899 |
}
|
900 |
|
901 |
+
$send_cache[$send_cache_hash] = array(
|
902 |
'status' => empty($errors) ? 'success' : 'fail',
|
903 |
'errors' => $errors
|
904 |
);
|
905 |
+
|
906 |
+
return $send_cache[$send_cache_hash];
|
907 |
}
|
908 |
|
909 |
/**
|
1032 |
// Store the version with the expired hashes removed
|
1033 |
update_option( 'so_contact_hashes', $hash_check, true );
|
1034 |
|
1035 |
+
// This message has already been sent successfully
|
1036 |
+
return true;
|
1037 |
}
|
1038 |
|
1039 |
$mail_success = wp_mail( $instance['settings']['to'], $email_fields['subject'], $body, $headers );
|
widgets/contact/styles/default.less
CHANGED
@@ -41,6 +41,19 @@
|
|
41 |
.sow-field-container {
|
42 |
overflow: hidden;
|
43 |
display: block;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
}
|
45 |
|
46 |
textarea,
|
@@ -72,15 +85,16 @@
|
|
72 |
}
|
73 |
}
|
74 |
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
@outline_width: 1px;
|
79 |
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
|
|
|
|
84 |
}
|
85 |
}
|
86 |
|
41 |
.sow-field-container {
|
42 |
overflow: hidden;
|
43 |
display: block;
|
44 |
+
|
45 |
+
textarea:focus,
|
46 |
+
input:focus,
|
47 |
+
> :focus {
|
48 |
+
@outline_style: solid;
|
49 |
+
@outline_color: default;
|
50 |
+
@outline_width: 1px;
|
51 |
+
|
52 |
+
// NB: Do not optimize this into a single line, otherwise the removal of 'default' values won't work.
|
53 |
+
outline-style: @outline_style;
|
54 |
+
outline-color: @outline_color;
|
55 |
+
outline-width: @outline_width;
|
56 |
+
}
|
57 |
}
|
58 |
|
59 |
textarea,
|
85 |
}
|
86 |
}
|
87 |
|
88 |
+
@description_font_size: 0.9em;
|
89 |
+
@description_font_color: #999999;
|
90 |
+
@description_font_style: italic;
|
|
|
91 |
|
92 |
+
.sow-form-field-description {
|
93 |
+
font-size: @description_font_size;
|
94 |
+
margin-top: 0.2em;
|
95 |
+
margin-left: 0.2em;
|
96 |
+
color: @description_font_color;
|
97 |
+
font-style: @description_font_style;
|
98 |
}
|
99 |
}
|
100 |
|
widgets/cta/cta.php
CHANGED
@@ -20,49 +20,7 @@ class SiteOrigin_Widget_Cta_Widget extends SiteOrigin_Widget {
|
|
20 |
array(
|
21 |
|
22 |
),
|
23 |
-
|
24 |
-
|
25 |
-
'title' => array(
|
26 |
-
'type' => 'text',
|
27 |
-
'label' => __('Title', 'so-widgets-bundle'),
|
28 |
-
),
|
29 |
-
|
30 |
-
'sub_title' => array(
|
31 |
-
'type' => 'text',
|
32 |
-
'label' => __('Subtitle', 'so-widgets-bundle')
|
33 |
-
),
|
34 |
-
|
35 |
-
'design' => array(
|
36 |
-
'type' => 'section',
|
37 |
-
'label' => __('Design', 'so-widgets-bundle'),
|
38 |
-
'fields' => array(
|
39 |
-
'background_color' => array(
|
40 |
-
'type' => 'color',
|
41 |
-
'label' => __('Background color', 'so-widgets-bundle'),
|
42 |
-
),
|
43 |
-
'border_color' => array(
|
44 |
-
'type' => 'color',
|
45 |
-
'label' => __('Border color', 'so-widgets-bundle'),
|
46 |
-
),
|
47 |
-
'button_align' => array(
|
48 |
-
'type' => 'select',
|
49 |
-
'label' => __( 'Button align', 'so-widgets-bundle' ),
|
50 |
-
'default' => 'right',
|
51 |
-
'options' => array(
|
52 |
-
'left' => __( 'Left', 'so-widgets-bundle'),
|
53 |
-
'right' => __( 'Right', 'so-widgets-bundle'),
|
54 |
-
)
|
55 |
-
)
|
56 |
-
)
|
57 |
-
),
|
58 |
-
|
59 |
-
'button' => array(
|
60 |
-
'type' => 'widget',
|
61 |
-
'class' => 'SiteOrigin_Widget_Button_Widget',
|
62 |
-
'label' => __('Button', 'so-widgets-bundle'),
|
63 |
-
),
|
64 |
-
|
65 |
-
),
|
66 |
plugin_dir_path(__FILE__)
|
67 |
);
|
68 |
}
|
@@ -97,6 +55,52 @@ class SiteOrigin_Widget_Cta_Widget extends SiteOrigin_Widget {
|
|
97 |
);
|
98 |
}
|
99 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
function get_template_name($instance) {
|
101 |
return 'base';
|
102 |
}
|
@@ -122,4 +126,4 @@ class SiteOrigin_Widget_Cta_Widget extends SiteOrigin_Widget {
|
|
122 |
|
123 |
}
|
124 |
|
125 |
-
siteorigin_widget_register('sow-cta', __FILE__, 'SiteOrigin_Widget_Cta_Widget');
|
20 |
array(
|
21 |
|
22 |
),
|
23 |
+
false ,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
plugin_dir_path(__FILE__)
|
25 |
);
|
26 |
}
|
55 |
);
|
56 |
}
|
57 |
|
58 |
+
function initialize_form(){
|
59 |
+
return array(
|
60 |
+
|
61 |
+
'title' => array(
|
62 |
+
'type' => 'text',
|
63 |
+
'label' => __('Title', 'so-widgets-bundle'),
|
64 |
+
),
|
65 |
+
|
66 |
+
'sub_title' => array(
|
67 |
+
'type' => 'text',
|
68 |
+
'label' => __('Subtitle', 'so-widgets-bundle')
|
69 |
+
),
|
70 |
+
|
71 |
+
'design' => array(
|
72 |
+
'type' => 'section',
|
73 |
+
'label' => __('Design', 'so-widgets-bundle'),
|
74 |
+
'fields' => array(
|
75 |
+
'background_color' => array(
|
76 |
+
'type' => 'color',
|
77 |
+
'label' => __('Background color', 'so-widgets-bundle'),
|
78 |
+
),
|
79 |
+
'border_color' => array(
|
80 |
+
'type' => 'color',
|
81 |
+
'label' => __('Border color', 'so-widgets-bundle'),
|
82 |
+
),
|
83 |
+
'button_align' => array(
|
84 |
+
'type' => 'select',
|
85 |
+
'label' => __( 'Button align', 'so-widgets-bundle' ),
|
86 |
+
'default' => 'right',
|
87 |
+
'options' => array(
|
88 |
+
'left' => __( 'Left', 'so-widgets-bundle'),
|
89 |
+
'right' => __( 'Right', 'so-widgets-bundle'),
|
90 |
+
)
|
91 |
+
)
|
92 |
+
)
|
93 |
+
),
|
94 |
+
|
95 |
+
'button' => array(
|
96 |
+
'type' => 'widget',
|
97 |
+
'class' => 'SiteOrigin_Widget_Button_Widget',
|
98 |
+
'label' => __('Button', 'so-widgets-bundle'),
|
99 |
+
),
|
100 |
+
|
101 |
+
);
|
102 |
+
}
|
103 |
+
|
104 |
function get_template_name($instance) {
|
105 |
return 'base';
|
106 |
}
|
126 |
|
127 |
}
|
128 |
|
129 |
+
siteorigin_widget_register('sow-cta', __FILE__, 'SiteOrigin_Widget_Cta_Widget');
|
widgets/editor/editor.php
CHANGED
@@ -19,25 +19,29 @@ class SiteOrigin_Widget_Editor_Widget extends SiteOrigin_Widget {
|
|
19 |
'help' => 'https://siteorigin.com/widgets-bundle/editor-widget/'
|
20 |
),
|
21 |
array(),
|
22 |
-
|
23 |
-
'title' => array(
|
24 |
-
'type' => 'text',
|
25 |
-
'label' => __('Title', 'so-widgets-bundle'),
|
26 |
-
),
|
27 |
-
'text' => array(
|
28 |
-
'type' => 'tinymce',
|
29 |
-
'rows' => 20
|
30 |
-
),
|
31 |
-
'autop' => array(
|
32 |
-
'type' => 'checkbox',
|
33 |
-
'default' => true,
|
34 |
-
'label' => __('Automatically add paragraphs', 'so-widgets-bundle'),
|
35 |
-
),
|
36 |
-
),
|
37 |
plugin_dir_path(__FILE__)
|
38 |
);
|
39 |
}
|
40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
function unwpautop($string) {
|
42 |
$string = str_replace("<p>", "", $string);
|
43 |
$string = str_replace(array("<br />", "<br>", "<br/>"), "\n", $string);
|
19 |
'help' => 'https://siteorigin.com/widgets-bundle/editor-widget/'
|
20 |
),
|
21 |
array(),
|
22 |
+
false,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
plugin_dir_path(__FILE__)
|
24 |
);
|
25 |
}
|
26 |
|
27 |
+
function initialize_form(){
|
28 |
+
return array(
|
29 |
+
'title' => array(
|
30 |
+
'type' => 'text',
|
31 |
+
'label' => __('Title', 'so-widgets-bundle'),
|
32 |
+
),
|
33 |
+
'text' => array(
|
34 |
+
'type' => 'tinymce',
|
35 |
+
'rows' => 20
|
36 |
+
),
|
37 |
+
'autop' => array(
|
38 |
+
'type' => 'checkbox',
|
39 |
+
'default' => true,
|
40 |
+
'label' => __('Automatically add paragraphs', 'so-widgets-bundle'),
|
41 |
+
),
|
42 |
+
);
|
43 |
+
}
|
44 |
+
|
45 |
function unwpautop($string) {
|
46 |
$string = str_replace("<p>", "", $string);
|
47 |
$string = str_replace(array("<br />", "<br>", "<br/>"), "\n", $string);
|
widgets/features/features.php
CHANGED
@@ -16,206 +16,253 @@ class SiteOrigin_Widget_Features_Widget extends SiteOrigin_Widget {
|
|
16 |
'help' => 'https://siteorigin.com/widgets-bundle/features-widget-documentation/'
|
17 |
),
|
18 |
array(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
array(
|
20 |
-
|
21 |
-
'
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
),
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
'
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
),
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
'description' => __('Use your own icon image.', 'so-widgets-bundle'),
|
57 |
-
),
|
58 |
-
|
59 |
-
// The text under the icon
|
60 |
-
|
61 |
-
'title' => array(
|
62 |
-
'type' => 'text',
|
63 |
-
'label' => __('Title text', 'so-widgets-bundle'),
|
64 |
-
),
|
65 |
-
|
66 |
-
'text' => array(
|
67 |
-
'type' => 'text',
|
68 |
-
'label' => __('Text', 'so-widgets-bundle')
|
69 |
-
),
|
70 |
-
|
71 |
-
'more_text' => array(
|
72 |
-
'type' => 'text',
|
73 |
-
'label' => __('More link text', 'so-widgets-bundle'),
|
74 |
-
),
|
75 |
-
|
76 |
-
'more_url' => array(
|
77 |
-
'type' => 'link',
|
78 |
-
'label' => __('More link URL', 'so-widgets-bundle'),
|
79 |
-
),
|
80 |
),
|
81 |
),
|
|
|
82 |
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
)
|
106 |
-
)
|
107 |
-
),
|
108 |
-
|
109 |
-
'text_options' => array(
|
110 |
-
'type' => 'section',
|
111 |
-
'label' => __( 'Text', 'so-widgets-bundle' ),
|
112 |
-
'hide' => true,
|
113 |
-
'fields' => array(
|
114 |
-
'font' => array(
|
115 |
-
'type' => 'font',
|
116 |
-
'label' => __( 'Font', 'so-widgets-bundle' ),
|
117 |
-
'default' => 'default'
|
118 |
-
),
|
119 |
-
'size' => array(
|
120 |
-
'type' => 'measurement',
|
121 |
-
'label' => __( 'Size', 'so-widgets-bundle' ),
|
122 |
-
),
|
123 |
-
'color' => array(
|
124 |
-
'type' => 'color',
|
125 |
-
'label' => __( 'Color', 'so-widgets-bundle' ),
|
126 |
-
)
|
127 |
)
|
128 |
-
)
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
),
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
)
|
148 |
)
|
149 |
-
)
|
150 |
),
|
151 |
-
),
|
152 |
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
),
|
159 |
),
|
|
|
160 |
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
),
|
|
|
166 |
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
|
|
|
|
|
|
|
|
|
203 |
),
|
204 |
-
|
205 |
);
|
206 |
}
|
207 |
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
219 |
}
|
220 |
|
221 |
function get_style_name($instance){
|
@@ -262,14 +309,9 @@ class SiteOrigin_Widget_Features_Widget extends SiteOrigin_Widget {
|
|
262 |
);
|
263 |
}
|
264 |
|
265 |
-
function get_template_name($instance){
|
266 |
return 'base';
|
267 |
}
|
268 |
-
|
269 |
-
function modify_form( $form ){
|
270 |
-
$form['container_shape']['options'] = include dirname( __FILE__ ) . '/inc/containers.php';
|
271 |
-
return $form;
|
272 |
-
}
|
273 |
}
|
274 |
|
275 |
-
siteorigin_widget_register('sow-features', __FILE__, 'SiteOrigin_Widget_Features_Widget');
|
16 |
'help' => 'https://siteorigin.com/widgets-bundle/features-widget-documentation/'
|
17 |
),
|
18 |
array(),
|
19 |
+
false,
|
20 |
+
plugin_dir_path(__FILE__)
|
21 |
+
);
|
22 |
+
}
|
23 |
+
|
24 |
+
function initialize() {
|
25 |
+
$this->register_frontend_styles(
|
26 |
array(
|
27 |
+
array(
|
28 |
+
'siteorigin-widgets',
|
29 |
+
plugin_dir_url(__FILE__) . 'css/style.css',
|
30 |
+
array(),
|
31 |
+
SOW_BUNDLE_VERSION
|
32 |
+
)
|
33 |
+
)
|
34 |
+
);
|
35 |
+
}
|
36 |
+
|
37 |
+
function initialize_form(){
|
38 |
+
$form['container_shape']['options'] = include dirname( __FILE__ ) . '/inc/containers.php';
|
39 |
+
|
40 |
+
$image_size_configs = $this->get_image_sizes();
|
41 |
+
$sizes = array();
|
42 |
+
foreach( $image_size_configs as $name => $size_config) {
|
43 |
+
$sizes[$name] = ucwords(preg_replace('/[-_]/', ' ', $name)) . ' (' . $size_config['width'] . 'x' . $size_config['height'] . ')';
|
44 |
+
}
|
45 |
+
|
46 |
+
return array(
|
47 |
+
'features' => array(
|
48 |
+
'type' => 'repeater',
|
49 |
+
'label' => __('Features', 'so-widgets-bundle'),
|
50 |
+
'item_name' => __('Feature', 'so-widgets-bundle'),
|
51 |
+
'item_label' => array(
|
52 |
+
'selector' => "[id*='features-title']",
|
53 |
+
'update_event' => 'change',
|
54 |
+
'value_method' => 'val'
|
55 |
+
),
|
56 |
+
'fields' => array(
|
57 |
+
|
58 |
+
// The container shape
|
59 |
+
|
60 |
+
'container_color' => array(
|
61 |
+
'type' => 'color',
|
62 |
+
'label' => __('Container color', 'so-widgets-bundle'),
|
63 |
+
'default' => '#404040',
|
64 |
+
),
|
65 |
+
|
66 |
+
// The Icon
|
67 |
+
|
68 |
+
'icon' => array(
|
69 |
+
'type' => 'icon',
|
70 |
+
'label' => __('Icon', 'so-widgets-bundle'),
|
71 |
+
),
|
72 |
+
|
73 |
+
'icon_color' => array(
|
74 |
+
'type' => 'color',
|
75 |
+
'label' => __('Icon color', 'so-widgets-bundle'),
|
76 |
+
'default' => '#FFFFFF',
|
77 |
+
),
|
78 |
+
|
79 |
+
'icon_image' => array(
|
80 |
+
'type' => 'media',
|
81 |
+
'library' => 'image',
|
82 |
+
'label' => __('Icon image', 'so-widgets-bundle'),
|
83 |
+
'description' => __('Use your own icon image.', 'so-widgets-bundle'),
|
84 |
),
|
85 |
+
|
86 |
+
'icon_image_size' => array(
|
87 |
+
'type' => 'select',
|
88 |
+
'label' => __('Icon image size', 'so-widgets-bundle'),
|
89 |
+
'options' => $sizes,
|
90 |
+
),
|
91 |
+
|
92 |
+
// The text under the icon
|
93 |
+
|
94 |
+
'title' => array(
|
95 |
+
'type' => 'text',
|
96 |
+
'label' => __('Title text', 'so-widgets-bundle'),
|
97 |
+
),
|
98 |
+
|
99 |
+
'text' => array(
|
100 |
+
'type' => 'text',
|
101 |
+
'label' => __('Text', 'so-widgets-bundle')
|
102 |
+
),
|
103 |
+
|
104 |
+
'more_text' => array(
|
105 |
+
'type' => 'text',
|
106 |
+
'label' => __('More link text', 'so-widgets-bundle'),
|
107 |
+
),
|
108 |
+
|
109 |
+
'more_url' => array(
|
110 |
+
'type' => 'link',
|
111 |
+
'label' => __('More link URL', 'so-widgets-bundle'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
),
|
113 |
),
|
114 |
+
),
|
115 |
|
116 |
+
'fonts' => array(
|
117 |
+
'type' => 'section',
|
118 |
+
'label' => __( 'Fonts', 'so-widgets-bundle' ),
|
119 |
+
'hide' => true,
|
120 |
+
'fields' => array(
|
121 |
+
'title_options' => array(
|
122 |
+
'type' => 'section',
|
123 |
+
'label' => __( 'Title', 'so-widgets-bundle' ),
|
124 |
+
'hide' => true,
|
125 |
+
'fields' => array(
|
126 |
+
'font' => array(
|
127 |
+
'type' => 'font',
|
128 |
+
'label' => __( 'Font', 'so-widgets-bundle' ),
|
129 |
+
'default' => 'default'
|
130 |
+
),
|
131 |
+
'size' => array(
|
132 |
+
'type' => 'measurement',
|
133 |
+
'label' => __( 'Size', 'so-widgets-bundle' ),
|
134 |
+
),
|
135 |
+
'color' => array(
|
136 |
+
'type' => 'color',
|
137 |
+
'label' => __( 'Color', 'so-widgets-bundle' ),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
)
|
139 |
+
)
|
140 |
+
),
|
141 |
+
|
142 |
+
'text_options' => array(
|
143 |
+
'type' => 'section',
|
144 |
+
'label' => __( 'Text', 'so-widgets-bundle' ),
|
145 |
+
'hide' => true,
|
146 |
+
'fields' => array(
|
147 |
+
'font' => array(
|
148 |
+
'type' => 'font',
|
149 |
+
'label' => __( 'Font', 'so-widgets-bundle' ),
|
150 |
+
'default' => 'default'
|
151 |
+
),
|
152 |
+
'size' => array(
|
153 |
+
'type' => 'measurement',
|
154 |
+
'label' => __( 'Size', 'so-widgets-bundle' ),
|
155 |
+
),
|
156 |
+
'color' => array(
|
157 |
+
'type' => 'color',
|
158 |
+
'label' => __( 'Color', 'so-widgets-bundle' ),
|
159 |
)
|
160 |
+
)
|
161 |
),
|
|
|
162 |
|
163 |
+
'more_text_options' => array(
|
164 |
+
'type' => 'section',
|
165 |
+
'label' => __( 'More Link', 'so-widgets-bundle' ),
|
166 |
+
'hide' => true,
|
167 |
+
'fields' => array(
|
168 |
+
'font' => array(
|
169 |
+
'type' => 'font',
|
170 |
+
'label' => __( 'Font', 'so-widgets-bundle' ),
|
171 |
+
'default' => 'default'
|
172 |
+
),
|
173 |
+
'size' => array(
|
174 |
+
'type' => 'measurement',
|
175 |
+
'label' => __( 'Size', 'so-widgets-bundle' ),
|
176 |
+
),
|
177 |
+
'color' => array(
|
178 |
+
'type' => 'color',
|
179 |
+
'label' => __( 'Color', 'so-widgets-bundle' ),
|
180 |
+
)
|
181 |
+
)
|
182 |
),
|
183 |
),
|
184 |
+
),
|
185 |
|
186 |
+
'container_shape' => array(
|
187 |
+
'type' => 'select',
|
188 |
+
'label' => __('Container shape', 'so-widgets-bundle'),
|
189 |
+
'default' => 'round',
|
190 |
+
'options' => array(),
|
191 |
+
),
|
192 |
|
193 |
+
'container_size' => array(
|
194 |
+
'type' => 'measurement',
|
195 |
+
'label' => __('Container size', 'so-widgets-bundle'),
|
196 |
+
'default' => '84px',
|
197 |
+
),
|
198 |
|
199 |
+
'icon_size' => array(
|
200 |
+
'type' => 'measurement',
|
201 |
+
'label' => __('Icon size', 'so-widgets-bundle'),
|
202 |
+
'default' => '24px',
|
203 |
+
),
|
204 |
|
205 |
+
'per_row' => array(
|
206 |
+
'type' => 'number',
|
207 |
+
'label' => __('Features per row', 'so-widgets-bundle'),
|
208 |
+
'default' => 3,
|
209 |
+
),
|
210 |
|
211 |
+
'responsive' => array(
|
212 |
+
'type' => 'checkbox',
|
213 |
+
'label' => __('Responsive layout', 'so-widgets-bundle'),
|
214 |
+
'default' => true,
|
215 |
+
),
|
216 |
|
217 |
+
'title_link' => array(
|
218 |
+
'type' => 'checkbox',
|
219 |
+
'label' => __('Link feature title to more URL', 'so-widgets-bundle'),
|
220 |
+
'default' => false,
|
221 |
+
),
|
222 |
|
223 |
+
'icon_link' => array(
|
224 |
+
'type' => 'checkbox',
|
225 |
+
'label' => __('Link icon to more URL', 'so-widgets-bundle'),
|
226 |
+
'default' => false,
|
227 |
+
),
|
228 |
|
229 |
+
'new_window' => array(
|
230 |
+
'type' => 'checkbox',
|
231 |
+
'label' => __('Open more URL in a new window', 'so-widgets-bundle'),
|
232 |
+
'default' => false,
|
233 |
),
|
234 |
+
|
235 |
);
|
236 |
}
|
237 |
|
238 |
+
/**
|
239 |
+
* Get size information for all currently-registered image sizes.
|
240 |
+
* From codex example here: https://codex.wordpress.org/Function_Reference/get_intermediate_image_sizes
|
241 |
+
*
|
242 |
+
* @global $_wp_additional_image_sizes
|
243 |
+
* @uses get_intermediate_image_sizes()
|
244 |
+
* @return array $sizes Data for all currently-registered image sizes.
|
245 |
+
*/
|
246 |
+
function get_image_sizes() {
|
247 |
+
global $_wp_additional_image_sizes;
|
248 |
+
|
249 |
+
$sizes = array();
|
250 |
+
|
251 |
+
foreach ( get_intermediate_image_sizes() as $_size ) {
|
252 |
+
if ( in_array( $_size, array('thumbnail', 'medium', 'medium_large', 'large') ) ) {
|
253 |
+
$sizes[ $_size ]['width'] = get_option( "{$_size}_size_w" );
|
254 |
+
$sizes[ $_size ]['height'] = get_option( "{$_size}_size_h" );
|
255 |
+
$sizes[ $_size ]['crop'] = (bool) get_option( "{$_size}_crop" );
|
256 |
+
} elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) {
|
257 |
+
$sizes[ $_size ] = array(
|
258 |
+
'width' => $_wp_additional_image_sizes[ $_size ]['width'],
|
259 |
+
'height' => $_wp_additional_image_sizes[ $_size ]['height'],
|
260 |
+
'crop' => $_wp_additional_image_sizes[ $_size ]['crop'],
|
261 |
+
);
|
262 |
+
}
|
263 |
+
}
|
264 |
+
|
265 |
+
return $sizes;
|
266 |
}
|
267 |
|
268 |
function get_style_name($instance){
|
309 |
);
|
310 |
}
|
311 |
|
312 |
+
function get_template_name($instance) {
|
313 |
return 'base';
|
314 |
}
|
|
|
|
|
|
|
|
|
|
|
315 |
}
|
316 |
|
317 |
+
siteorigin_widget_register('sow-features', __FILE__, 'SiteOrigin_Widget_Features_Widget');
|
widgets/features/tpl/base.php
CHANGED
@@ -17,8 +17,10 @@ $last_row = floor( ( count($instance['features']) - 1 ) / $instance['per_row'] )
|
|
17 |
class="sow-icon-container <?php echo !empty($instance['container_shape']) ? 'sow-container-' . esc_attr($instance['container_shape']) : 'sow-container-none'?>"
|
18 |
style="font-size: <?php echo intval($instance['container_size']) ?>px; color: <?php echo esc_attr($feature['container_color']) ?>; width: <?php echo intval($instance['container_size']) ?>px; height: <?php echo intval($instance['container_size']) ?>px;">
|
19 |
<?php
|
|
|
20 |
if( !empty($feature['icon_image']) ) {
|
21 |
-
$
|
|
|
22 |
if(!empty($attachment)) {
|
23 |
$icon_styles[] = 'background-image: url(' . sow_esc_url($attachment[0]) . ')';
|
24 |
if(!empty($instance['icon_size'])) $icon_styles[] = 'font-size: '.intval($instance['icon_size']).'px';
|
@@ -27,7 +29,6 @@ $last_row = floor( ( count($instance['features']) - 1 ) / $instance['per_row'] )
|
|
27 |
}
|
28 |
}
|
29 |
else {
|
30 |
-
$icon_styles = array();
|
31 |
if(!empty($instance['icon_size'])) $icon_styles[] = 'font-size: '.intval($instance['icon_size']).'px';
|
32 |
if(!empty($feature['icon_color'])) $icon_styles[] = 'color: '.$feature['icon_color'];
|
33 |
|
@@ -62,4 +63,4 @@ $last_row = floor( ( count($instance['features']) - 1 ) / $instance['per_row'] )
|
|
62 |
|
63 |
<?php endforeach; ?>
|
64 |
|
65 |
-
</div>
|
17 |
class="sow-icon-container <?php echo !empty($instance['container_shape']) ? 'sow-container-' . esc_attr($instance['container_shape']) : 'sow-container-none'?>"
|
18 |
style="font-size: <?php echo intval($instance['container_size']) ?>px; color: <?php echo esc_attr($feature['container_color']) ?>; width: <?php echo intval($instance['container_size']) ?>px; height: <?php echo intval($instance['container_size']) ?>px;">
|
19 |
<?php
|
20 |
+
$icon_styles = array();
|
21 |
if( !empty($feature['icon_image']) ) {
|
22 |
+
$size = empty( $feature['icon_image_size'] ) ? 'thumbnail' : $feature['icon_image_size'];
|
23 |
+
$attachment = wp_get_attachment_image_src( $feature['icon_image'], $size );
|
24 |
if(!empty($attachment)) {
|
25 |
$icon_styles[] = 'background-image: url(' . sow_esc_url($attachment[0]) . ')';
|
26 |
if(!empty($instance['icon_size'])) $icon_styles[] = 'font-size: '.intval($instance['icon_size']).'px';
|
29 |
}
|
30 |
}
|
31 |
else {
|
|
|
32 |
if(!empty($instance['icon_size'])) $icon_styles[] = 'font-size: '.intval($instance['icon_size']).'px';
|
33 |
if(!empty($feature['icon_color'])) $icon_styles[] = 'color: '.$feature['icon_color'];
|
34 |
|
63 |
|
64 |
<?php endforeach; ?>
|
65 |
|
66 |
+
</div>
|
widgets/google-map/google-map.php
CHANGED
@@ -19,366 +19,371 @@ class SiteOrigin_Widget_GoogleMap_Widget extends SiteOrigin_Widget {
|
|
19 |
'help' => 'https://siteorigin.com/widgets-bundle/google-maps-widget/'
|
20 |
),
|
21 |
array(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
array(
|
23 |
-
|
24 |
-
'
|
25 |
-
'
|
26 |
-
|
27 |
-
|
28 |
-
)
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
'
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
),
|
43 |
-
'options' => array(
|
44 |
-
'interactive' => __( 'Interactive', 'so-widgets-bundle' ),
|
45 |
-
'static' => __( 'Static image', 'so-widgets-bundle' ),
|
46 |
-
)
|
47 |
-
),
|
48 |
-
'width' => array(
|
49 |
-
'type' => 'text',
|
50 |
-
'default' => 640,
|
51 |
-
'hidden' => true,
|
52 |
-
'state_handler' => array(
|
53 |
-
'map_type[static]' => array('show'),
|
54 |
-
'_else[map_type]' => array('hide'),
|
55 |
-
),
|
56 |
-
'label' => __( 'Width', 'so-widgets-bundle' )
|
57 |
-
),
|
58 |
-
'height' => array(
|
59 |
-
'type' => 'text',
|
60 |
-
'default' => 480,
|
61 |
-
'label' => __( 'Height', 'so-widgets-bundle' )
|
62 |
-
),
|
63 |
-
'zoom' => array(
|
64 |
-
'type' => 'slider',
|
65 |
-
'label' => __( 'Zoom level', 'so-widgets-bundle' ),
|
66 |
-
'description' => __( 'A value from 0 (the world) to 21 (street level).', 'so-widgets-bundle' ),
|
67 |
-
'min' => 0,
|
68 |
-
'max' => 21,
|
69 |
-
'default' => 12,
|
70 |
-
'integer' => true,
|
71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
),
|
73 |
-
'
|
74 |
-
'
|
75 |
-
'
|
76 |
-
'state_handler' => array(
|
77 |
-
'map_type[interactive]' => array('show'),
|
78 |
-
'_else[map_type]' => array('hide'),
|
79 |
-
),
|
80 |
-
'label' => __( 'Scroll to zoom', 'so-widgets-bundle' ),
|
81 |
-
'description' => __( 'Allow scrolling over the map to zoom in or out.', 'so-widgets-bundle' )
|
82 |
-
),
|
83 |
-
'draggable' => array(
|
84 |
-
'type' => 'checkbox',
|
85 |
-
'default' => true,
|
86 |
-
'state_handler' => array(
|
87 |
-
'map_type[interactive]' => array('show'),
|
88 |
-
'_else[map_type]' => array('hide'),
|
89 |
-
),
|
90 |
-
'label' => __( 'Draggable', 'so-widgets-bundle' ),
|
91 |
-
'description' => __( 'Allow dragging the map to move it around.', 'so-widgets-bundle' )
|
92 |
-
),
|
93 |
-
'disable_default_ui' => array(
|
94 |
-
'type' => 'checkbox',
|
95 |
-
'default' => false,
|
96 |
-
'state_handler' => array(
|
97 |
-
'map_type[interactive]' => array('show'),
|
98 |
-
'_else[map_type]' => array('hide'),
|
99 |
-
),
|
100 |
-
'label' => __( 'Disable default UI', 'so-widgets-bundle' ),
|
101 |
-
'description' => __( 'Hides the default Google Maps controls.', 'so-widgets-bundle' )
|
102 |
-
),
|
103 |
-
'keep_centered' => array(
|
104 |
-
'type' => 'checkbox',
|
105 |
-
'default' => false,
|
106 |
-
'state_handler' => array(
|
107 |
-
'map_type[interactive]' => array('show'),
|
108 |
-
'_else[map_type]' => array('hide'),
|
109 |
-
),
|
110 |
-
'label' => __( 'Keep map centered', 'so-widgets-bundle' ),
|
111 |
-
'description' => __( 'Keeps the map centered when it\'s container is resized.', 'so-widgets-bundle' )
|
112 |
)
|
113 |
-
)
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
'marker_at_center' => array(
|
122 |
-
'type' => 'checkbox',
|
123 |
-
'default' => true,
|
124 |
-
'label' => __( 'Show marker at map center', 'so-widgets-bundle' )
|
125 |
),
|
126 |
-
'
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
),
|
132 |
-
'
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
'
|
|
|
140 |
),
|
141 |
-
'
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
),
|
151 |
-
'fields' => array(
|
152 |
-
'place' => array(
|
153 |
-
'type' => 'textarea',
|
154 |
-
'rows' => 2,
|
155 |
-
'label' => __( 'Place', 'so-widgets-bundle' )
|
156 |
-
),
|
157 |
-
'info' => array(
|
158 |
-
'type' => 'tinymce',
|
159 |
-
'rows' => 10,
|
160 |
-
'label' => __( 'Info Window Content', 'so-widgets-bundle' )
|
161 |
-
),
|
162 |
-
'info_max_width' => array(
|
163 |
-
'type' => 'text',
|
164 |
-
'label' => __( 'Info Window max width', 'so-widgets-bundle' )
|
165 |
-
),
|
166 |
-
)
|
167 |
),
|
168 |
-
'
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
)
|
177 |
),
|
|
|
|
|
178 |
)
|
179 |
-
)
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
|
|
|
|
|
|
|
|
|
|
199 |
),
|
200 |
-
'
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
|
|
|
|
|
|
|
|
207 |
),
|
208 |
-
'
|
209 |
-
'
|
210 |
-
|
211 |
-
'
|
212 |
-
'
|
213 |
),
|
214 |
-
'
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
),
|
219 |
-
'custom_map_styles' => array(
|
220 |
-
'type' => 'repeater',
|
221 |
-
'state_handler' => array(
|
222 |
-
'style_method[custom]' => array('show'),
|
223 |
-
'_else[style_method]' => array('hide'),
|
224 |
),
|
225 |
-
'
|
226 |
-
|
227 |
-
|
228 |
-
'selector' => "[id*='custom_map_styles-map_feature'] :selected",
|
229 |
-
'update_event' => 'change',
|
230 |
-
'value_method' => 'text'
|
231 |
),
|
232 |
-
'fields' => array(
|
233 |
-
'map_feature' => array(
|
234 |
-
'type' => 'select',
|
235 |
-
'label' => '',
|
236 |
-
'prompt' => __( 'Select map feature to style', 'so-widgets-bundle' ),
|
237 |
-
'options' => array(
|
238 |
-
'water' => __( 'Water', 'so-widgets-bundle' ),
|
239 |
-
'road_highway' => __( 'Highways', 'so-widgets-bundle' ),
|
240 |
-
'road_arterial' => __( 'Arterial roads', 'so-widgets-bundle' ),
|
241 |
-
'road_local' => __( 'Local roads', 'so-widgets-bundle' ),
|
242 |
-
'transit_line' => __( 'Transit lines', 'so-widgets-bundle' ),
|
243 |
-
'transit_station' => __( 'Transit stations', 'so-widgets-bundle' ),
|
244 |
-
'landscape_man-made' => __( 'Man-made landscape', 'so-widgets-bundle' ),
|
245 |
-
'landscape_natural_landcover' => __( 'Natural landscape landcover', 'so-widgets-bundle' ),
|
246 |
-
'landscape_natural_terrain' => __( 'Natural landscape terrain', 'so-widgets-bundle' ),
|
247 |
-
'poi_attraction' => __( 'Point of interest - Attractions', 'so-widgets-bundle' ),
|
248 |
-
'poi_business' => __( 'Point of interest - Business', 'so-widgets-bundle' ),
|
249 |
-
'poi_government' => __( 'Point of interest - Government', 'so-widgets-bundle' ),
|
250 |
-
'poi_medical' => __( 'Point of interest - Medical', 'so-widgets-bundle' ),
|
251 |
-
'poi_park' => __( 'Point of interest - Parks', 'so-widgets-bundle' ),
|
252 |
-
'poi_place-of-worship' => __( 'Point of interest - Places of worship', 'so-widgets-bundle' ),
|
253 |
-
'poi_school' => __( 'Point of interest - Schools', 'so-widgets-bundle' ),
|
254 |
-
'poi_sports-complex' => __( 'Point of interest - Sports complexes', 'so-widgets-bundle' ),
|
255 |
-
)
|
256 |
-
),
|
257 |
-
'element_type' => array(
|
258 |
-
'type' => 'select',
|
259 |
-
'label' => __( 'Select element type to style', 'so-widgets-bundle' ),
|
260 |
-
'options' => array(
|
261 |
-
'geometry' => __( 'Geometry', 'so-widgets-bundle' ),
|
262 |
-
'labels' => __( 'Labels', 'so-widgets-bundle' ),
|
263 |
-
'all' => __( 'All', 'so-widgets-bundle' ),
|
264 |
-
)
|
265 |
-
),
|
266 |
-
'visibility' => array(
|
267 |
-
'type' => 'checkbox',
|
268 |
-
'default' => true,
|
269 |
-
'label' => __( 'Visible', 'so-widgets-bundle' )
|
270 |
-
),
|
271 |
-
'color' => array(
|
272 |
-
'type' => 'color',
|
273 |
-
'label' => __( 'Color', 'so-widgets-bundle' )
|
274 |
-
)
|
275 |
-
)
|
276 |
)
|
277 |
-
)
|
278 |
-
),
|
279 |
-
'directions' => array(
|
280 |
-
'type' => 'section',
|
281 |
-
'label' => __( 'Directions', 'so-widgets-bundle' ),
|
282 |
-
'state_handler' => array(
|
283 |
-
'map_type[interactive]' => array('show'),
|
284 |
-
'_else[map_type]' => array('hide'),
|
285 |
),
|
286 |
-
'
|
287 |
-
|
288 |
-
|
289 |
-
'
|
290 |
-
|
291 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
292 |
),
|
293 |
-
'
|
294 |
-
'
|
295 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
296 |
),
|
297 |
-
'
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
'bicycling' => __( 'Bicycling', 'so-widgets-bundle' ),
|
305 |
-
'transit' => __( 'Transit', 'so-widgets-bundle' )
|
306 |
-
)
|
307 |
),
|
308 |
-
'
|
309 |
-
|
310 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
311 |
),
|
312 |
-
'
|
313 |
-
|
314 |
-
|
|
|
|
|
|
|
315 |
),
|
316 |
-
'
|
317 |
-
'
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
'
|
322 |
-
|
323 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
324 |
),
|
325 |
-
'
|
326 |
-
'
|
327 |
-
|
328 |
-
|
329 |
-
'
|
330 |
-
|
331 |
-
|
332 |
-
'type' => 'checkbox',
|
333 |
-
'default' => true,
|
334 |
-
'label' => __( 'Stopover', 'so-widgets-bundle' ),
|
335 |
-
'description' => __( 'Whether or not this is a stop on the route or just a route preference.', 'so-widgets-bundle' )
|
336 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
337 |
)
|
338 |
-
),
|
339 |
-
'optimize_waypoints' => array(
|
340 |
-
'type' => 'checkbox',
|
341 |
-
'label' => __( 'Optimize waypoints', 'so-widgets-bundle' ),
|
342 |
-
'default' => false,
|
343 |
-
'description' => __( 'Allow the Google Maps service to reorder waypoints for the shortest travelling distance.', 'so-widgets-bundle' )
|
344 |
)
|
345 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
346 |
),
|
347 |
-
'
|
348 |
-
|
349 |
-
|
350 |
-
'
|
351 |
-
|
352 |
-
'
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
357 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
358 |
)
|
359 |
)
|
360 |
-
)
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
)
|
373 |
-
)
|
374 |
-
);
|
375 |
-
$this->register_frontend_styles(
|
376 |
-
array(
|
377 |
-
array(
|
378 |
-
'sow-google-map',
|
379 |
-
plugin_dir_url(__FILE__) . 'css/style.css',
|
380 |
-
array(),
|
381 |
-
SOW_BUNDLE_VERSION
|
382 |
)
|
383 |
)
|
384 |
);
|
19 |
'help' => 'https://siteorigin.com/widgets-bundle/google-maps-widget/'
|
20 |
),
|
21 |
array(),
|
22 |
+
false,
|
23 |
+
plugin_dir_path(__FILE__)
|
24 |
+
);
|
25 |
+
}
|
26 |
+
|
27 |
+
function initialize() {
|
28 |
+
$this->register_frontend_scripts(
|
29 |
array(
|
30 |
+
array(
|
31 |
+
'sow-google-map',
|
32 |
+
plugin_dir_url(__FILE__) . 'js/js-map' . SOW_BUNDLE_JS_SUFFIX . '.js',
|
33 |
+
array( 'jquery' ),
|
34 |
+
SOW_BUNDLE_VERSION
|
35 |
+
)
|
36 |
+
)
|
37 |
+
);
|
38 |
+
$this->register_frontend_styles(
|
39 |
+
array(
|
40 |
+
array(
|
41 |
+
'sow-google-map',
|
42 |
+
plugin_dir_url(__FILE__) . 'css/style.css',
|
43 |
+
array(),
|
44 |
+
SOW_BUNDLE_VERSION
|
45 |
+
)
|
46 |
+
)
|
47 |
+
);
|
48 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
|
50 |
+
function initialize_form(){
|
51 |
+
return array(
|
52 |
+
'map_center' => array(
|
53 |
+
'type' => 'textarea',
|
54 |
+
'rows' => 2,
|
55 |
+
'label' => __( 'Map center', 'so-widgets-bundle' ),
|
56 |
+
'description' => __( 'The name of a place, town, city, or even a country. Can be an exact address too.', 'so-widgets-bundle' )
|
57 |
+
),
|
58 |
+
'settings' => array(
|
59 |
+
'type' => 'section',
|
60 |
+
'label' => __( 'Settings', 'so-widgets-bundle' ),
|
61 |
+
'hide' => false,
|
62 |
+
'description' => __( 'Set map display options.', 'so-widgets-bundle' ),
|
63 |
+
'fields' => array(
|
64 |
+
'map_type' => array(
|
65 |
+
'type' => 'radio',
|
66 |
+
'default' => 'interactive',
|
67 |
+
'label' => __( 'Map type', 'so-widgets-bundle' ),
|
68 |
+
'state_emitter' => array(
|
69 |
+
'callback' => 'select',
|
70 |
+
'args' => array( 'map_type' )
|
71 |
),
|
72 |
+
'options' => array(
|
73 |
+
'interactive' => __( 'Interactive', 'so-widgets-bundle' ),
|
74 |
+
'static' => __( 'Static image', 'so-widgets-bundle' ),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
)
|
76 |
+
),
|
77 |
+
'width' => array(
|
78 |
+
'type' => 'text',
|
79 |
+
'default' => 640,
|
80 |
+
'hidden' => true,
|
81 |
+
'state_handler' => array(
|
82 |
+
'map_type[static]' => array('show'),
|
83 |
+
'_else[map_type]' => array('hide'),
|
|
|
|
|
|
|
|
|
84 |
),
|
85 |
+
'label' => __( 'Width', 'so-widgets-bundle' )
|
86 |
+
),
|
87 |
+
'height' => array(
|
88 |
+
'type' => 'text',
|
89 |
+
'default' => 480,
|
90 |
+
'label' => __( 'Height', 'so-widgets-bundle' )
|
91 |
+
),
|
92 |
+
'zoom' => array(
|
93 |
+
'type' => 'slider',
|
94 |
+
'label' => __( 'Zoom level', 'so-widgets-bundle' ),
|
95 |
+
'description' => __( 'A value from 0 (the world) to 21 (street level).', 'so-widgets-bundle' ),
|
96 |
+
'min' => 0,
|
97 |
+
'max' => 21,
|
98 |
+
'default' => 12,
|
99 |
+
'integer' => true,
|
100 |
+
|
101 |
+
),
|
102 |
+
'scroll_zoom' => array(
|
103 |
+
'type' => 'checkbox',
|
104 |
+
'default' => true,
|
105 |
+
'state_handler' => array(
|
106 |
+
'map_type[interactive]' => array('show'),
|
107 |
+
'_else[map_type]' => array('hide'),
|
108 |
),
|
109 |
+
'label' => __( 'Scroll to zoom', 'so-widgets-bundle' ),
|
110 |
+
'description' => __( 'Allow scrolling over the map to zoom in or out.', 'so-widgets-bundle' )
|
111 |
+
),
|
112 |
+
'draggable' => array(
|
113 |
+
'type' => 'checkbox',
|
114 |
+
'default' => true,
|
115 |
+
'state_handler' => array(
|
116 |
+
'map_type[interactive]' => array('show'),
|
117 |
+
'_else[map_type]' => array('hide'),
|
118 |
),
|
119 |
+
'label' => __( 'Draggable', 'so-widgets-bundle' ),
|
120 |
+
'description' => __( 'Allow dragging the map to move it around.', 'so-widgets-bundle' )
|
121 |
+
),
|
122 |
+
'disable_default_ui' => array(
|
123 |
+
'type' => 'checkbox',
|
124 |
+
'default' => false,
|
125 |
+
'state_handler' => array(
|
126 |
+
'map_type[interactive]' => array('show'),
|
127 |
+
'_else[map_type]' => array('hide'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
),
|
129 |
+
'label' => __( 'Disable default UI', 'so-widgets-bundle' ),
|
130 |
+
'description' => __( 'Hides the default Google Maps controls.', 'so-widgets-bundle' )
|
131 |
+
),
|
132 |
+
'keep_centered' => array(
|
133 |
+
'type' => 'checkbox',
|
134 |
+
'default' => false,
|
135 |
+
'state_handler' => array(
|
136 |
+
'map_type[interactive]' => array('show'),
|
137 |
+
'_else[map_type]' => array('hide'),
|
138 |
),
|
139 |
+
'label' => __( 'Keep map centered', 'so-widgets-bundle' ),
|
140 |
+
'description' => __( 'Keeps the map centered when it\'s container is resized.', 'so-widgets-bundle' )
|
141 |
)
|
142 |
+
)
|
143 |
+
),
|
144 |
+
'markers' => array(
|
145 |
+
'type' => 'section',
|
146 |
+
'label' => __( 'Markers', 'so-widgets-bundle' ),
|
147 |
+
'hide' => true,
|
148 |
+
'description' => __( 'Use markers to identify points of interest on the map.', 'so-widgets-bundle' ),
|
149 |
+
'fields' => array(
|
150 |
+
'marker_at_center' => array(
|
151 |
+
'type' => 'checkbox',
|
152 |
+
'default' => true,
|
153 |
+
'label' => __( 'Show marker at map center', 'so-widgets-bundle' )
|
154 |
+
),
|
155 |
+
'marker_icon' => array(
|
156 |
+
'type' => 'media',
|
157 |
+
'default' => '',
|
158 |
+
'label' => __( 'Marker icon', 'so-widgets-bundle' ),
|
159 |
+
'description' => __( 'Replaces the default map marker with your own image.', 'so-widgets-bundle' )
|
160 |
+
),
|
161 |
+
'markers_draggable' => array(
|
162 |
+
'type' => 'checkbox',
|
163 |
+
'default' => false,
|
164 |
+
'state_handler' => array(
|
165 |
+
'map_type[interactive]' => array('show'),
|
166 |
+
'_else[map_type]' => array('hide'),
|
167 |
),
|
168 |
+
'label' => __( 'Draggable markers', 'so-widgets-bundle' )
|
169 |
+
),
|
170 |
+
'marker_positions' => array(
|
171 |
+
'type' => 'repeater',
|
172 |
+
'label' => __( 'Marker positions', 'so-widgets-bundle' ),
|
173 |
+
'description' => __( 'Please be aware that adding more than 10 markers may cause a slight delay before they appear, due to Google Geocoding API rate limits.', 'so-widgets-bundle' ),
|
174 |
+
'item_name' => __( 'Marker', 'so-widgets-bundle' ),
|
175 |
+
'item_label' => array(
|
176 |
+
'selector' => "[id*='marker_positions-place']",
|
177 |
+
'update_event' => 'change',
|
178 |
+
'value_method' => 'val'
|
179 |
),
|
180 |
+
'fields' => array(
|
181 |
+
'place' => array(
|
182 |
+
'type' => 'textarea',
|
183 |
+
'rows' => 2,
|
184 |
+
'label' => __( 'Place', 'so-widgets-bundle' )
|
185 |
),
|
186 |
+
'info' => array(
|
187 |
+
'type' => 'tinymce',
|
188 |
+
'rows' => 10,
|
189 |
+
'label' => __( 'Info Window Content', 'so-widgets-bundle' )
|
|
|
|
|
|
|
|
|
|
|
|
|
190 |
),
|
191 |
+
'info_max_width' => array(
|
192 |
+
'type' => 'text',
|
193 |
+
'label' => __( 'Info Window max width', 'so-widgets-bundle' )
|
|
|
|
|
|
|
194 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
),
|
197 |
+
'info_display' => array(
|
198 |
+
'type' => 'radio',
|
199 |
+
'label' => __( 'When should Info Windows be displayed?', 'so-widgets-bundle' ),
|
200 |
+
'default' => 'click',
|
201 |
+
'options' => array(
|
202 |
+
'click' => __( 'Click', 'so-widgets-bundle' ),
|
203 |
+
'mouseover' => __( 'Mouse over', 'so-widgets-bundle' ),
|
204 |
+
'always' => __( 'Always', 'so-widgets-bundle' ),
|
205 |
+
)
|
206 |
+
),
|
207 |
+
)
|
208 |
+
),
|
209 |
+
'styles' => array(
|
210 |
+
'type' => 'section',
|
211 |
+
'label' => __( 'Styles', 'so-widgets-bundle' ),
|
212 |
+
'hide' => true,
|
213 |
+
'description' => __( 'Apply custom colors to map features, or hide them completely.', 'so-widgets-bundle' ),
|
214 |
+
'fields' => array(
|
215 |
+
'style_method' => array(
|
216 |
+
'type' => 'radio',
|
217 |
+
'default' => 'normal',
|
218 |
+
'label' => __( 'Map styles', 'so-widgets-bundle' ),
|
219 |
+
'state_emitter' => array(
|
220 |
+
'callback' => 'select',
|
221 |
+
'args' => array( 'style_method' )
|
222 |
),
|
223 |
+
'options' => array(
|
224 |
+
'normal' => __( 'Default', 'so-widgets-bundle' ),
|
225 |
+
'custom' => __( 'Custom', 'so-widgets-bundle' ),
|
226 |
+
'raw_json' => __( 'Predefined Styles', 'so-widgets-bundle' ),
|
227 |
+
)
|
228 |
+
),
|
229 |
+
'styled_map_name' => array(
|
230 |
+
'type' => 'text',
|
231 |
+
'state_handler' => array(
|
232 |
+
'style_method[default]' => array('hide'),
|
233 |
+
'_else[style_method]' => array('show'),
|
234 |
),
|
235 |
+
'label' => __( 'Styled map name', 'so-widgets-bundle' )
|
236 |
+
),
|
237 |
+
'raw_json_map_styles' => array(
|
238 |
+
'type' => 'textarea',
|
239 |
+
'state_handler' => array(
|
240 |
+
'style_method[raw_json]' => array('show'),
|
241 |
+
'_else[style_method]' => array('hide'),
|
|
|
|
|
|
|
242 |
),
|
243 |
+
'rows' => 5,
|
244 |
+
'hidden' => true,
|
245 |
+
'label' => __( 'Raw JSON styles', 'so-widgets-bundle' ),
|
246 |
+
'description' => __( 'Copy and paste predefined styles here from <a href="http://snazzymaps.com/" target="_blank">Snazzy Maps</a>.', 'so-widgets-bundle' )
|
247 |
+
),
|
248 |
+
'custom_map_styles' => array(
|
249 |
+
'type' => 'repeater',
|
250 |
+
'state_handler' => array(
|
251 |
+
'style_method[custom]' => array('show'),
|
252 |
+
'_else[style_method]' => array('hide'),
|
253 |
),
|
254 |
+
'label' => __( 'Custom map styles', 'so-widgets-bundle' ),
|
255 |
+
'item_name' => __( 'Style', 'so-widgets-bundle' ),
|
256 |
+
'item_label' => array(
|
257 |
+
'selector' => "[id*='custom_map_styles-map_feature'] :selected",
|
258 |
+
'update_event' => 'change',
|
259 |
+
'value_method' => 'text'
|
260 |
),
|
261 |
+
'fields' => array(
|
262 |
+
'map_feature' => array(
|
263 |
+
'type' => 'select',
|
264 |
+
'label' => '',
|
265 |
+
'prompt' => __( 'Select map feature to style', 'so-widgets-bundle' ),
|
266 |
+
'options' => array(
|
267 |
+
'water' => __( 'Water', 'so-widgets-bundle' ),
|
268 |
+
'road_highway' => __( 'Highways', 'so-widgets-bundle' ),
|
269 |
+
'road_arterial' => __( 'Arterial roads', 'so-widgets-bundle' ),
|
270 |
+
'road_local' => __( 'Local roads', 'so-widgets-bundle' ),
|
271 |
+
'transit_line' => __( 'Transit lines', 'so-widgets-bundle' ),
|
272 |
+
'transit_station' => __( 'Transit stations', 'so-widgets-bundle' ),
|
273 |
+
'landscape_man-made' => __( 'Man-made landscape', 'so-widgets-bundle' ),
|
274 |
+
'landscape_natural_landcover' => __( 'Natural landscape landcover', 'so-widgets-bundle' ),
|
275 |
+
'landscape_natural_terrain' => __( 'Natural landscape terrain', 'so-widgets-bundle' ),
|
276 |
+
'poi_attraction' => __( 'Point of interest - Attractions', 'so-widgets-bundle' ),
|
277 |
+
'poi_business' => __( 'Point of interest - Business', 'so-widgets-bundle' ),
|
278 |
+
'poi_government' => __( 'Point of interest - Government', 'so-widgets-bundle' ),
|
279 |
+
'poi_medical' => __( 'Point of interest - Medical', 'so-widgets-bundle' ),
|
280 |
+
'poi_park' => __( 'Point of interest - Parks', 'so-widgets-bundle' ),
|
281 |
+
'poi_place-of-worship' => __( 'Point of interest - Places of worship', 'so-widgets-bundle' ),
|
282 |
+
'poi_school' => __( 'Point of interest - Schools', 'so-widgets-bundle' ),
|
283 |
+
'poi_sports-complex' => __( 'Point of interest - Sports complexes', 'so-widgets-bundle' ),
|
284 |
+
)
|
285 |
),
|
286 |
+
'element_type' => array(
|
287 |
+
'type' => 'select',
|
288 |
+
'label' => __( 'Select element type to style', 'so-widgets-bundle' ),
|
289 |
+
'options' => array(
|
290 |
+
'geometry' => __( 'Geometry', 'so-widgets-bundle' ),
|
291 |
+
'labels' => __( 'Labels', 'so-widgets-bundle' ),
|
292 |
+
'all' => __( 'All', 'so-widgets-bundle' ),
|
|
|
|
|
|
|
|
|
293 |
)
|
294 |
+
),
|
295 |
+
'visibility' => array(
|
296 |
+
'type' => 'checkbox',
|
297 |
+
'default' => true,
|
298 |
+
'label' => __( 'Visible', 'so-widgets-bundle' )
|
299 |
+
),
|
300 |
+
'color' => array(
|
301 |
+
'type' => 'color',
|
302 |
+
'label' => __( 'Color', 'so-widgets-bundle' )
|
303 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
304 |
)
|
305 |
)
|
306 |
+
)
|
307 |
+
),
|
308 |
+
'directions' => array(
|
309 |
+
'type' => 'section',
|
310 |
+
'label' => __( 'Directions', 'so-widgets-bundle' ),
|
311 |
+
'state_handler' => array(
|
312 |
+
'map_type[interactive]' => array('show'),
|
313 |
+
'_else[map_type]' => array('hide'),
|
314 |
),
|
315 |
+
'hide' => true,
|
316 |
+
'description' => __( 'Display a route on your map, with waypoints between your starting point and destination.', 'so-widgets-bundle' ),
|
317 |
+
'fields' => array(
|
318 |
+
'origin' => array(
|
319 |
+
'type' => 'text',
|
320 |
+
'label' => __( 'Starting point', 'so-widgets-bundle' )
|
321 |
+
),
|
322 |
+
'destination' => array(
|
323 |
+
'type' => 'text',
|
324 |
+
'label' => __( 'Destination', 'so-widgets-bundle' )
|
325 |
+
),
|
326 |
+
'travel_mode' => array(
|
327 |
+
'type' => 'select',
|
328 |
+
'label' => __( 'Travel mode', 'so-widgets-bundle' ),
|
329 |
+
'default' => 'driving',
|
330 |
+
'options' => array(
|
331 |
+
'driving' => __( 'Driving', 'so-widgets-bundle' ),
|
332 |
+
'walking' => __( 'Walking', 'so-widgets-bundle' ),
|
333 |
+
'bicycling' => __( 'Bicycling', 'so-widgets-bundle' ),
|
334 |
+
'transit' => __( 'Transit', 'so-widgets-bundle' )
|
335 |
+
)
|
336 |
+
),
|
337 |
+
'avoid_highways' => array(
|
338 |
+
'type' => 'checkbox',
|
339 |
+
'label' => __( 'Avoid highways', 'so-widgets-bundle' ),
|
340 |
+
),
|
341 |
+
'avoid_tolls' => array(
|
342 |
+
'type' => 'checkbox',
|
343 |
+
'label' => __( 'Avoid tolls', 'so-widgets-bundle' ),
|
344 |
+
),
|
345 |
+
'waypoints' => array(
|
346 |
+
'type' => 'repeater',
|
347 |
+
'label' => __( 'Waypoints', 'so-widgets-bundle' ),
|
348 |
+
'item_name' => __( 'Waypoint', 'so-widgets-bundle' ),
|
349 |
+
'item_label' => array(
|
350 |
+
'selector' => "[id*='waypoints-location']",
|
351 |
+
'update_event' => 'change',
|
352 |
+
'value_method' => 'val'
|
353 |
+
),
|
354 |
+
'fields' => array(
|
355 |
+
'location' => array(
|
356 |
+
'type' => 'textarea',
|
357 |
+
'rows' => 2,
|
358 |
+
'label' => __( 'Location', 'so-widgets-bundle' )
|
359 |
+
),
|
360 |
+
'stopover' => array(
|
361 |
+
'type' => 'checkbox',
|
362 |
+
'default' => true,
|
363 |
+
'label' => __( 'Stopover', 'so-widgets-bundle' ),
|
364 |
+
'description' => __( 'Whether or not this is a stop on the route or just a route preference.', 'so-widgets-bundle' )
|
365 |
+
)
|
366 |
)
|
367 |
+
),
|
368 |
+
'optimize_waypoints' => array(
|
369 |
+
'type' => 'checkbox',
|
370 |
+
'label' => __( 'Optimize waypoints', 'so-widgets-bundle' ),
|
371 |
+
'default' => false,
|
372 |
+
'description' => __( 'Allow the Google Maps service to reorder waypoints for the shortest travelling distance.', 'so-widgets-bundle' )
|
373 |
)
|
374 |
)
|
375 |
+
),
|
376 |
+
'api_key_section' => array(
|
377 |
+
'type' => 'section',
|
378 |
+
'label' => __( 'API key', 'so-widgets-bundle' ),
|
379 |
+
'hide' => true,
|
380 |
+
'fields' => array(
|
381 |
+
'api_key' => array(
|
382 |
+
'type' => 'text',
|
383 |
+
'label' => __( 'API key', 'so-widgets-bundle' ),
|
384 |
+
'description' => __( 'Enter your API key if you have one. This enables you to monitor your Google Maps API usage in the Google APIs Console.', 'so-widgets-bundle' ),
|
385 |
+
'optional' => true
|
386 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
387 |
)
|
388 |
)
|
389 |
);
|
widgets/headline/headline.php
CHANGED
@@ -18,141 +18,146 @@ class SiteOrigin_Widget_Headline_Widget extends SiteOrigin_Widget {
|
|
18 |
'description' => __( 'A headline widget.', 'so-widgets-bundle' )
|
19 |
),
|
20 |
array(),
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
)
|
43 |
-
|
44 |
-
|
45 |
-
'
|
46 |
-
'
|
47 |
-
'
|
48 |
-
)
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
),
|
53 |
-
'
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
|
|
|
|
|
|
|
|
|
|
63 |
)
|
64 |
)
|
65 |
-
)
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
)
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
)
|
87 |
-
)
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
),
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
)
|
107 |
)
|
108 |
)
|
109 |
-
)
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
)
|
130 |
-
)
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
)
|
140 |
-
),
|
141 |
-
'color' => array(
|
142 |
-
'type' => 'color',
|
143 |
-
'label' => __('Color', 'so-widgets-bundle'),
|
144 |
-
'default' => '#EEEEEE'
|
145 |
-
),
|
146 |
-
'side_margin' => array(
|
147 |
-
'type' => 'measurement',
|
148 |
-
'label' => __('Side Margin', 'so-widgets-bundle'),
|
149 |
-
'default' => '60px',
|
150 |
-
),
|
151 |
-
'top_margin' => array(
|
152 |
-
'type' => 'measurement',
|
153 |
-
'label' => __('Top/Bottom Margin', 'so-widgets-bundle'),
|
154 |
-
'default' => '20px',
|
155 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
)
|
157 |
)
|
158 |
)
|
18 |
'description' => __( 'A headline widget.', 'so-widgets-bundle' )
|
19 |
),
|
20 |
array(),
|
21 |
+
false,
|
22 |
+
plugin_dir_path(__FILE__)
|
23 |
+
);
|
24 |
+
}
|
25 |
+
|
26 |
+
function initialize_form(){
|
27 |
+
return array(
|
28 |
+
'headline' => array(
|
29 |
+
'type' => 'section',
|
30 |
+
'label' => __( 'Headline', 'so-widgets-bundle' ),
|
31 |
+
'hide' => false,
|
32 |
+
'fields' => array(
|
33 |
+
'text' => array(
|
34 |
+
'type' => 'text',
|
35 |
+
'label' => __( 'Text', 'so-widgets-bundle' ),
|
36 |
+
),
|
37 |
+
'tag' => array(
|
38 |
+
'type' => 'select',
|
39 |
+
'label' => __( 'H Tag', 'so-widgets-bundle' ),
|
40 |
+
'default' => 'h1',
|
41 |
+
'options' => array(
|
42 |
+
'h1' => __( 'H1', 'so-widgets-bundle' ),
|
43 |
+
'h2' => __( 'H2', 'so-widgets-bundle' ),
|
44 |
+
'h3' => __( 'H3', 'so-widgets-bundle' ),
|
45 |
+
'h4' => __( 'H4', 'so-widgets-bundle' ),
|
46 |
+
'h5' => __( 'H5', 'so-widgets-bundle' ),
|
47 |
+
'h6' => __( 'H6', 'so-widgets-bundle' ),
|
48 |
+
)
|
49 |
+
),
|
50 |
+
'font' => array(
|
51 |
+
'type' => 'font',
|
52 |
+
'label' => __( 'Font', 'so-widgets-bundle' ),
|
53 |
+
'default' => 'default'
|
54 |
+
),
|
55 |
+
'color' => array(
|
56 |
+
'type' => 'color',
|
57 |
+
'label' => __('Color', 'so-widgets-bundle'),
|
58 |
+
),
|
59 |
+
'align' => array(
|
60 |
+
'type' => 'select',
|
61 |
+
'label' => __( 'Align', 'so-widgets-bundle' ),
|
62 |
+
'default' => 'center',
|
63 |
+
'options' => array(
|
64 |
+
'center' => __( 'Center', 'so-widgets-bundle' ),
|
65 |
+
'left' => __( 'Left', 'so-widgets-bundle' ),
|
66 |
+
'right' => __( 'Right', 'so-widgets-bundle' ),
|
67 |
+
'justify' => __( 'Justify', 'so-widgets-bundle' )
|
68 |
)
|
69 |
)
|
70 |
+
)
|
71 |
+
),
|
72 |
+
'sub_headline' => array(
|
73 |
+
'type' => 'section',
|
74 |
+
'label' => __( 'Sub headline', 'so-widgets-bundle' ),
|
75 |
+
'hide' => true,
|
76 |
+
'fields' => array(
|
77 |
+
'text' => array(
|
78 |
+
'type' => 'text',
|
79 |
+
'label' => __('Text', 'so-widgets-bundle')
|
80 |
+
),
|
81 |
+
'tag' => array(
|
82 |
+
'type' => 'select',
|
83 |
+
'label' => __( 'H Tag', 'so-widgets-bundle' ),
|
84 |
+
'default' => 'h3',
|
85 |
+
'options' => array(
|
86 |
+
'h1' => __( 'H1', 'so-widgets-bundle' ),
|
87 |
+
'h2' => __( 'H2', 'so-widgets-bundle' ),
|
88 |
+
'h3' => __( 'H3', 'so-widgets-bundle' ),
|
89 |
+
'h4' => __( 'H4', 'so-widgets-bundle' ),
|
90 |
+
'h5' => __( 'H5', 'so-widgets-bundle' ),
|
91 |
+
'h6' => __( 'H6', 'so-widgets-bundle' ),
|
92 |
+
)
|
93 |
+
),
|
94 |
+
'font' => array(
|
95 |
+
'type' => 'font',
|
96 |
+
'label' => __( 'Font', 'so-widgets-bundle' ),
|
97 |
+
'default' => 'default'
|
98 |
+
),
|
99 |
+
'color' => array(
|
100 |
+
'type' => 'color',
|
101 |
+
'label' => __('Color', 'so-widgets-bundle'),
|
102 |
+
),
|
103 |
+
'align' => array(
|
104 |
+
'type' => 'select',
|
105 |
+
'label' => __( 'Align', 'so-widgets-bundle' ),
|
106 |
+
'default' => 'center',
|
107 |
+
'options' => array(
|
108 |
+
'center' => __( 'Center', 'so-widgets-bundle' ),
|
109 |
+
'left' => __( 'Left', 'so-widgets-bundle' ),
|
110 |
+
'right' => __( 'Right', 'so-widgets-bundle' ),
|
111 |
+
'justify' => __( 'Justify', 'so-widgets-bundle' )
|
112 |
)
|
113 |
)
|
114 |
+
)
|
115 |
+
),
|
116 |
+
'divider' => array(
|
117 |
+
'type' => 'section',
|
118 |
+
'label' => __( 'Divider', 'so-widgets-bundle' ),
|
119 |
+
'hide' => true,
|
120 |
+
'fields' => array(
|
121 |
+
'style' => array(
|
122 |
+
'type' => 'select',
|
123 |
+
'label' => __( 'Style', 'so-widgets-bundle' ),
|
124 |
+
'default' => 'solid',
|
125 |
+
'options' => array(
|
126 |
+
'none' => __('None', 'so-widgets-bundle'),
|
127 |
+
'solid' => __('Solid', 'so-widgets-bundle'),
|
128 |
+
'dotted' => __('Dotted', 'so-widgets-bundle'),
|
129 |
+
'dashed' => __('Dashed', 'so-widgets-bundle'),
|
130 |
+
'double' => __('Double', 'so-widgets-bundle'),
|
131 |
+
'groove' => __('Groove', 'so-widgets-bundle'),
|
132 |
+
'ridge' => __('Ridge', 'so-widgets-bundle'),
|
133 |
+
'inset' => __('Inset', 'so-widgets-bundle'),
|
134 |
+
'outset' => __('Outset', 'so-widgets-bundle'),
|
135 |
+
)
|
136 |
+
),
|
137 |
+
'weight' => array(
|
138 |
+
'type' => 'select',
|
139 |
+
'label' => __( 'Weight', 'so-widgets-bundle' ),
|
140 |
+
'default' => 'thin',
|
141 |
+
'options' => array(
|
142 |
+
'thin' => __( 'Thin', 'so-widgets-bundle' ),
|
143 |
+
'medium' => __( 'Medium', 'so-widgets-bundle' ),
|
144 |
+
'thick' => __( 'Thick', 'so-widgets-bundle' ),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
)
|
146 |
+
),
|
147 |
+
'color' => array(
|
148 |
+
'type' => 'color',
|
149 |
+
'label' => __('Color', 'so-widgets-bundle'),
|
150 |
+
'default' => '#EEEEEE'
|
151 |
+
),
|
152 |
+
'side_margin' => array(
|
153 |
+
'type' => 'measurement',
|
154 |
+
'label' => __('Side Margin', 'so-widgets-bundle'),
|
155 |
+
'default' => '60px',
|
156 |
+
),
|
157 |
+
'top_margin' => array(
|
158 |
+
'type' => 'measurement',
|
159 |
+
'label' => __('Top/Bottom Margin', 'so-widgets-bundle'),
|
160 |
+
'default' => '20px',
|
161 |
)
|
162 |
)
|
163 |
)
|
widgets/hero/hero.php
CHANGED
@@ -22,178 +22,195 @@ class SiteOrigin_Widget_Hero_Widget extends SiteOrigin_Widget_Base_Slider {
|
|
22 |
'panels_title' => false,
|
23 |
),
|
24 |
array( ),
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
|
36 |
-
|
|
|
|
|
37 |
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
-
|
44 |
-
'type' => 'repeater',
|
45 |
-
'label' => __('Buttons', 'so-widgets-bundle'),
|
46 |
-
'item_name' => __('Button', 'so-widgets-bundle'),
|
47 |
-
'description' => __('Add [buttons] shortcode to the content to insert these buttons.', 'so-widgets-bundle'),
|
48 |
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
|
|
|
|
62 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
),
|
108 |
-
'fields' => $this->video_form_fields(),
|
109 |
),
|
110 |
-
|
111 |
-
|
|
|
112 |
),
|
113 |
),
|
|
|
114 |
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
'default' => 50,
|
175 |
-
),
|
176 |
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
|
|
|
|
182 |
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
|
195 |
-
|
196 |
-
|
|
|
197 |
}
|
198 |
|
199 |
/**
|
@@ -292,6 +309,9 @@ class SiteOrigin_Widget_Hero_Widget extends SiteOrigin_Widget_Base_Slider {
|
|
292 |
|
293 |
$less['heading_shadow'] = intval( $instance['design']['heading_shadow'] );
|
294 |
|
|
|
|
|
|
|
295 |
$font = siteorigin_widget_get_font( $instance['design']['heading_font'] );
|
296 |
$less['heading_font'] = $font['family'];
|
297 |
if ( ! empty( $font['weight'] ) ) {
|
22 |
'panels_title' => false,
|
23 |
),
|
24 |
array( ),
|
25 |
+
false,
|
26 |
+
plugin_dir_path(__FILE__)
|
27 |
+
);
|
28 |
+
}
|
29 |
+
|
30 |
+
function initialize(){
|
31 |
+
// This widget requires the button widget
|
32 |
+
if( !class_exists('SiteOrigin_Widget_Button_Widget') ) {
|
33 |
+
SiteOrigin_Widgets_Bundle::single()->include_widget( 'button' );
|
34 |
+
}
|
35 |
|
36 |
+
// Let the slider base class do its initialization
|
37 |
+
parent::initialize();
|
38 |
+
}
|
39 |
|
40 |
+
function initialize_form(){
|
41 |
+
return array(
|
42 |
+
'frames' => array(
|
43 |
+
'type' => 'repeater',
|
44 |
+
'label' => __('Hero frames', 'so-widgets-bundle'),
|
45 |
+
'item_name' => __('Frame', 'so-widgets-bundle'),
|
46 |
+
'item_label' => array(
|
47 |
+
'selector' => "[id*='frames-title']",
|
48 |
+
'update_event' => 'change',
|
49 |
+
'value_method' => 'val'
|
50 |
+
),
|
51 |
|
52 |
+
'fields' => array(
|
|
|
|
|
|
|
|
|
53 |
|
54 |
+
'content' => array(
|
55 |
+
'type' => 'tinymce',
|
56 |
+
'label' => __( 'Content', 'so-widgets-bundle' ),
|
57 |
+
),
|
58 |
+
|
59 |
+
'buttons' => array(
|
60 |
+
'type' => 'repeater',
|
61 |
+
'label' => __('Buttons', 'so-widgets-bundle'),
|
62 |
+
'item_name' => __('Button', 'so-widgets-bundle'),
|
63 |
+
'description' => __('Add [buttons] shortcode to the content to insert these buttons.', 'so-widgets-bundle'),
|
64 |
+
|
65 |
+
'item_label' => array(
|
66 |
+
'selector' => "[id*='buttons-button-text']",
|
67 |
+
'update_event' => 'change',
|
68 |
+
'value_method' => 'val'
|
69 |
),
|
70 |
+
'fields' => array(
|
71 |
+
'button' => array(
|
72 |
+
'type' => 'widget',
|
73 |
+
'class' => 'SiteOrigin_Widget_Button_Widget',
|
74 |
+
'label' => __('Button', 'so-widgets-bundle'),
|
75 |
+
'collapsible' => false,
|
76 |
+
)
|
77 |
+
)
|
78 |
+
),
|
79 |
|
80 |
+
'background' => array(
|
81 |
+
'type' => 'section',
|
82 |
+
'label' => __('Background', 'so-widgets-bundle'),
|
83 |
+
'fields' => array(
|
84 |
+
'image' => array(
|
85 |
+
'type' => 'media',
|
86 |
+
'label' => __( 'Background image', 'so-widgets-bundle' ),
|
87 |
+
'library' => 'image',
|
88 |
+
'fallback' => true,
|
89 |
+
),
|
90 |
|
91 |
+
'opacity' => array(
|
92 |
+
'label' => __( 'Background image opacity', 'so-widgets-bundle' ),
|
93 |
+
'type' => 'slider',
|
94 |
+
'min' => 0,
|
95 |
+
'max' => 100,
|
96 |
+
'default' => 100,
|
97 |
+
),
|
98 |
|
99 |
+
'color' => array(
|
100 |
+
'type' => 'color',
|
101 |
+
'label' => __( 'Background color', 'so-widgets-bundle' ),
|
102 |
+
'default' => '#333333',
|
103 |
+
),
|
104 |
|
105 |
+
'url' => array(
|
106 |
+
'type' => 'link',
|
107 |
+
'label' => __( 'Destination URL', 'so-widgets-bundle' ),
|
108 |
+
),
|
109 |
|
110 |
+
'new_window' => array(
|
111 |
+
'type' => 'checkbox',
|
112 |
+
'label' => __( 'Open URL in a new window', 'so-widgets-bundle' ),
|
113 |
+
),
|
114 |
|
115 |
+
'videos' => array(
|
116 |
+
'type' => 'repeater',
|
117 |
+
'item_name' => __('Video', 'so-widgets-bundle'),
|
118 |
+
'label' => __('Background videos', 'so-widgets-bundle'),
|
119 |
+
'item_label' => array(
|
120 |
+
'selector' => "[id*='frames-background_videos-url']",
|
121 |
+
'update_event' => 'change',
|
122 |
+
'value_method' => 'val'
|
|
|
|
|
123 |
),
|
124 |
+
'fields' => $this->video_form_fields(),
|
125 |
+
),
|
126 |
+
)
|
127 |
),
|
128 |
),
|
129 |
+
),
|
130 |
|
131 |
+
'controls' => array(
|
132 |
+
'type' => 'section',
|
133 |
+
'label' => __('Slider Controls', 'so-widgets-bundle'),
|
134 |
+
'fields' => $this->control_form_fields()
|
135 |
+
),
|
136 |
|
137 |
+
'design' => array(
|
138 |
+
'type' => 'section',
|
139 |
+
'label' => __('Design and Layout', 'so-widgets-bundle'),
|
140 |
+
'fields' => array(
|
141 |
|
142 |
+
'height' => array(
|
143 |
+
'type' => 'measurement',
|
144 |
+
'label' => __( 'Height', 'so-widgets-bundle' ),
|
145 |
+
'default' => 'default',
|
146 |
+
),
|
147 |
|
148 |
+
'padding' => array(
|
149 |
+
'type' => 'measurement',
|
150 |
+
'label' => __('Top and bottom padding', 'so-widgets-bundle'),
|
151 |
+
'default' => '50px',
|
152 |
+
),
|
153 |
|
154 |
+
'extra_top_padding' => array(
|
155 |
+
'type' => 'measurement',
|
156 |
+
'label' => __('Extra top padding', 'so-widgets-bundle'),
|
157 |
+
'description' => __('Additional padding added to the top of the slider', 'so-widgets-bundle'),
|
158 |
+
'default' => '0px',
|
159 |
+
),
|
160 |
|
161 |
+
'padding_sides' => array(
|
162 |
+
'type' => 'measurement',
|
163 |
+
'label' => __('Side padding', 'so-widgets-bundle'),
|
164 |
+
'default' => '20px',
|
165 |
+
),
|
166 |
|
167 |
+
'width' => array(
|
168 |
+
'type' => 'measurement',
|
169 |
+
'label' => __('Maximum container width', 'so-widgets-bundle'),
|
170 |
+
'default' => '1280px',
|
171 |
+
),
|
172 |
|
173 |
+
'heading_font' => array(
|
174 |
+
'type' => 'font',
|
175 |
+
'label' => __('Heading font', 'so-widgets-bundle'),
|
176 |
+
'default' => '',
|
177 |
+
),
|
178 |
|
179 |
+
'heading_color' => array(
|
180 |
+
'type' => 'color',
|
181 |
+
'label' => __('Heading color', 'so-widgets-bundle'),
|
182 |
+
'default' => '#FFFFFF',
|
183 |
+
),
|
184 |
|
185 |
+
'heading_size' => array(
|
186 |
+
'type' => 'measurement',
|
187 |
+
'label' => __('Heading size', 'so-widgets-bundle'),
|
188 |
+
'default' => '38px',
|
189 |
+
),
|
|
|
|
|
190 |
|
191 |
+
'heading_shadow' => array(
|
192 |
+
'type' => 'slider',
|
193 |
+
'label' => __('Heading shadow intensity', 'so-widgets-bundle'),
|
194 |
+
'max' => 100,
|
195 |
+
'min' => 0,
|
196 |
+
'default' => 50,
|
197 |
+
),
|
198 |
|
199 |
+
'text_size' => array(
|
200 |
+
'type' => 'measurement',
|
201 |
+
'label' => __('Text size', 'so-widgets-bundle'),
|
202 |
+
'default' => '16px',
|
203 |
+
),
|
204 |
|
205 |
+
'text_color' => array(
|
206 |
+
'type' => 'color',
|
207 |
+
'label' => __('Text color', 'so-widgets-bundle'),
|
208 |
+
'default' => '#F6F6F6',
|
209 |
+
),
|
210 |
|
211 |
+
)
|
212 |
+
),
|
213 |
+
);
|
214 |
}
|
215 |
|
216 |
/**
|
309 |
|
310 |
$less['heading_shadow'] = intval( $instance['design']['heading_shadow'] );
|
311 |
|
312 |
+
$less['heading_color'] = $instance['design']['heading_color'];
|
313 |
+
$less['text_color'] = $instance['design']['text_color'];
|
314 |
+
|
315 |
$font = siteorigin_widget_get_font( $instance['design']['heading_font'] );
|
316 |
$less['heading_font'] = $font['family'];
|
317 |
if ( ! empty( $font['weight'] ) ) {
|
widgets/hero/styles/default.less
CHANGED
@@ -12,10 +12,12 @@
|
|
12 |
@slide_height: default;
|
13 |
@heading_size: 38px;
|
14 |
@text_size: 16px;
|
|
|
15 |
@heading_shadow: 50;
|
16 |
|
17 |
@heading_font: default;
|
18 |
@heading_font_weight: 400;
|
|
|
19 |
|
20 |
.sow-slider-base {
|
21 |
|
@@ -29,7 +31,7 @@
|
|
29 |
|
30 |
h1,h2,h3,h4,h5,h6{
|
31 |
line-height: 1.375em;
|
32 |
-
color:
|
33 |
text-shadow: 0 2px 2px rgba( 0, 0, 0, @heading_shadow/100 );
|
34 |
margin: 0.1em 0;
|
35 |
|
@@ -61,7 +63,7 @@
|
|
61 |
}
|
62 |
|
63 |
p{
|
64 |
-
color:
|
65 |
text-shadow: 0 1px 2px rgba(0,0,0,0.25);
|
66 |
margin: 1em 0;
|
67 |
font-size: @text_size;
|
12 |
@slide_height: default;
|
13 |
@heading_size: 38px;
|
14 |
@text_size: 16px;
|
15 |
+
@text_color: #F6F6F6;
|
16 |
@heading_shadow: 50;
|
17 |
|
18 |
@heading_font: default;
|
19 |
@heading_font_weight: 400;
|
20 |
+
@heading_color: #FFFFFF;
|
21 |
|
22 |
.sow-slider-base {
|
23 |
|
31 |
|
32 |
h1,h2,h3,h4,h5,h6{
|
33 |
line-height: 1.375em;
|
34 |
+
color: @heading_color;
|
35 |
text-shadow: 0 2px 2px rgba( 0, 0, 0, @heading_shadow/100 );
|
36 |
margin: 0.1em 0;
|
37 |
|
63 |
}
|
64 |
|
65 |
p{
|
66 |
+
color: @text_color;
|
67 |
text-shadow: 0 1px 2px rgba(0,0,0,0.25);
|
68 |
margin: 1em 0;
|
69 |
font-size: @text_size;
|
widgets/icon/icon.php
ADDED
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
Widget Name: Icon
|
5 |
+
Description: An iconic icon.
|
6 |
+
Author: SiteOrigin
|
7 |
+
Author URI: https://siteorigin.com
|
8 |
+
*/
|
9 |
+
|
10 |
+
class SiteOrigin_Widget_Icon_Widget extends SiteOrigin_Widget {
|
11 |
+
|
12 |
+
function __construct() {
|
13 |
+
|
14 |
+
parent::__construct(
|
15 |
+
'sow-icon',
|
16 |
+
__( 'SiteOrigin Icon', 'so-widgets-bundle' ),
|
17 |
+
array(
|
18 |
+
'description' => __( 'An icon widget.', 'so-widgets-bundle' )
|
19 |
+
),
|
20 |
+
array(),
|
21 |
+
false,
|
22 |
+
plugin_dir_path( __FILE__ )
|
23 |
+
);
|
24 |
+
}
|
25 |
+
|
26 |
+
function initialize_form() {
|
27 |
+
return array(
|
28 |
+
'icon' => array(
|
29 |
+
'type' => 'icon',
|
30 |
+
'label' => __( 'Icon', 'so-widgets-bundle' ),
|
31 |
+
),
|
32 |
+
|
33 |
+
'color' => array(
|
34 |
+
'type' => 'color',
|
35 |
+
'label' => __( 'Color', 'so-widgets-bundle' ),
|
36 |
+
),
|
37 |
+
|
38 |
+
'size' => array(
|
39 |
+
'type' => 'measurement',
|
40 |
+
'label' => __( 'Size', 'so-widgets-bundle' ),
|
41 |
+
),
|
42 |
+
|
43 |
+
'alignment' => array(
|
44 |
+
'type' => 'select',
|
45 |
+
'label' => __( 'Alignment', 'so-widgets-bundle' ),
|
46 |
+
'options' => array(
|
47 |
+
'center' => __( 'Center', 'so-widgets-bundle' ),
|
48 |
+
'left' => __( 'Left', 'so-widgets-bundle' ),
|
49 |
+
'right' => __( 'Right', 'so-widgets-bundle' ),
|
50 |
+
),
|
51 |
+
'default' => 'center',
|
52 |
+
),
|
53 |
+
|
54 |
+
'url' => array(
|
55 |
+
'type' => 'link',
|
56 |
+
'label' => __( 'Destination URL', 'so-widgets-bundle' ),
|
57 |
+
),
|
58 |
+
|
59 |
+
'new_window' => array(
|
60 |
+
'type' => 'checkbox',
|
61 |
+
'default' => false,
|
62 |
+
'label' => __( 'Open in a new window', 'so-widgets-bundle' ),
|
63 |
+
),
|
64 |
+
);
|
65 |
+
}
|
66 |
+
|
67 |
+
function get_style_name( $instance ) {
|
68 |
+
return 'sow-icon';
|
69 |
+
}
|
70 |
+
|
71 |
+
function get_less_variables( $instance ) {
|
72 |
+
return array(
|
73 |
+
'color' => $instance['color'],
|
74 |
+
'alignment' => $instance['alignment'],
|
75 |
+
'size' => $instance['size'],
|
76 |
+
'has_size' => empty( $instance['size'] ) ? 'false' : 'true',
|
77 |
+
);
|
78 |
+
}
|
79 |
+
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Get the template for the headline widget
|
83 |
+
*
|
84 |
+
* @param $instance
|
85 |
+
*
|
86 |
+
* @return mixed|string
|
87 |
+
*/
|
88 |
+
function get_template_name( $instance ) {
|
89 |
+
return 'icon';
|
90 |
+
}
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Get the template variables for the headline
|
94 |
+
*
|
95 |
+
* @param $instance
|
96 |
+
* @param $args
|
97 |
+
*
|
98 |
+
* @return array
|
99 |
+
*/
|
100 |
+
function get_template_variables( $instance, $args ) {
|
101 |
+
return array(
|
102 |
+
'icon' => $instance['icon'],
|
103 |
+
'url' => $instance['url'],
|
104 |
+
'new_window' => $instance['new_window'],
|
105 |
+
);
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
siteorigin_widget_register( 'sow-icon', __FILE__, 'SiteOrigin_Widget_Icon_Widget' );
|
widgets/icon/styles/sow-icon.less
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@color: #000000;
|
2 |
+
@size: 12px;
|
3 |
+
@has_size: false;
|
4 |
+
@alignment: center;
|
5 |
+
|
6 |
+
.sow-icon {
|
7 |
+
text-align: @alignment;
|
8 |
+
}
|
9 |
+
|
10 |
+
.sow-icon span,
|
11 |
+
.sow-icon a span {
|
12 |
+
display: inline-block;
|
13 |
+
color: @color !important;
|
14 |
+
|
15 |
+
.fontsize() when (@has_size = true) {
|
16 |
+
font-size: @size !important;
|
17 |
+
}
|
18 |
+
.fontsize();
|
19 |
+
}
|
widgets/icon/tpl/icon.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @var $icon
|
4 |
+
* @var $url
|
5 |
+
* @var $new_window
|
6 |
+
*/
|
7 |
+
?>
|
8 |
+
|
9 |
+
<div class="sow-icon-container sow-icon">
|
10 |
+
<?php if ( ! empty( $url ) ) { ?>
|
11 |
+
<a href="<?php esc_attr_e( $url ) ?>" <?php if ( ! empty( $new_window ) ) echo 'target="_blank"'; ?>>
|
12 |
+
<?php } ?>
|
13 |
+
<?php
|
14 |
+
echo siteorigin_widget_get_icon( $icon );
|
15 |
+
?>
|
16 |
+
<?php if ( ! empty( $url ) ) { ?>
|
17 |
+
</a>
|
18 |
+
<?php } ?>
|
19 |
+
</div>
|
widgets/image-grid/image-grid.php
CHANGED
@@ -17,64 +17,8 @@ class SiteOrigin_Widgets_ImageGrid_Widget extends SiteOrigin_Widget {
|
|
17 |
'description' => __('Display a grid of images.', 'so-widgets-bundle'),
|
18 |
),
|
19 |
array(),
|
20 |
-
|
21 |
-
|
22 |
-
'images' => array(
|
23 |
-
'type' => 'repeater',
|
24 |
-
'label' => __('Images', 'so-widgets-bundle'),
|
25 |
-
'item_name' => __( 'Image', 'so-widgets-bundle' ),
|
26 |
-
'item_label' => array(
|
27 |
-
'selector' => "[name*='title']",
|
28 |
-
'update_event' => 'change',
|
29 |
-
'value_method' => 'val'
|
30 |
-
),
|
31 |
-
'fields' => array(
|
32 |
-
'image' => array(
|
33 |
-
'type' => 'media',
|
34 |
-
'label' => __('Image', 'so-widgets-bundle')
|
35 |
-
),
|
36 |
-
'title' => array(
|
37 |
-
'type' => 'text',
|
38 |
-
'label' => __('Image title', 'so-widgets-bundle')
|
39 |
-
),
|
40 |
-
'url' => array(
|
41 |
-
'type' => 'link',
|
42 |
-
'label' => __('URL', 'so-widgets-bundle')
|
43 |
-
),
|
44 |
-
)
|
45 |
-
),
|
46 |
-
|
47 |
-
'display' => array(
|
48 |
-
'type' => 'section',
|
49 |
-
'label' => __('Display', 'so-widgets-bundle'),
|
50 |
-
'fields' => array(
|
51 |
-
'attachment_size' => array(
|
52 |
-
'label' => __('Image size', 'so-widgets-bundle'),
|
53 |
-
'type' => 'select',
|
54 |
-
'options' => array(),
|
55 |
-
'default' => 'full',
|
56 |
-
),
|
57 |
-
|
58 |
-
'max_height' => array(
|
59 |
-
'label' => __('Maximum image height', 'so-widgets-bundle'),
|
60 |
-
'type' => 'number',
|
61 |
-
),
|
62 |
-
|
63 |
-
'max_width' => array(
|
64 |
-
'label' => __('Maximum image width', 'so-widgets-bundle'),
|
65 |
-
'type' => 'number',
|
66 |
-
),
|
67 |
-
|
68 |
-
'spacing' => array(
|
69 |
-
'label' => __('Spacing', 'so-widgets-bundle'),
|
70 |
-
'description' => __('Amount of spacing between images.', 'so-widgets-bundle'),
|
71 |
-
'type' => 'number',
|
72 |
-
'default' => 10,
|
73 |
-
),
|
74 |
-
)
|
75 |
-
)
|
76 |
-
|
77 |
-
)
|
78 |
);
|
79 |
}
|
80 |
|
@@ -98,22 +42,71 @@ class SiteOrigin_Widgets_ImageGrid_Widget extends SiteOrigin_Widget {
|
|
98 |
) );
|
99 |
}
|
100 |
|
101 |
-
|
102 |
-
* Modify the form widget
|
103 |
-
*
|
104 |
-
* @param $form
|
105 |
-
*
|
106 |
-
* @return mixed
|
107 |
-
*/
|
108 |
-
function modify_form( $form ){
|
109 |
$intermediate = get_intermediate_image_sizes();
|
110 |
$sizes = array();
|
111 |
foreach( $intermediate as $name ) {
|
112 |
$sizes[$name] = ucwords(preg_replace('/[-_]/', ' ', $name));
|
113 |
}
|
114 |
$sizes = array_merge( array( 'full' => __('Full', 'so-widgets-bundle') ), $sizes );
|
115 |
-
|
116 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
}
|
118 |
|
119 |
/**
|
17 |
'description' => __('Display a grid of images.', 'so-widgets-bundle'),
|
18 |
),
|
19 |
array(),
|
20 |
+
false,
|
21 |
+
plugin_dir_path( __FILE__ )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
);
|
23 |
}
|
24 |
|
42 |
) );
|
43 |
}
|
44 |
|
45 |
+
function initialize_form(){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
$intermediate = get_intermediate_image_sizes();
|
47 |
$sizes = array();
|
48 |
foreach( $intermediate as $name ) {
|
49 |
$sizes[$name] = ucwords(preg_replace('/[-_]/', ' ', $name));
|
50 |
}
|
51 |
$sizes = array_merge( array( 'full' => __('Full', 'so-widgets-bundle') ), $sizes );
|
52 |
+
|
53 |
+
return array(
|
54 |
+
|
55 |
+
'images' => array(
|
56 |
+
'type' => 'repeater',
|
57 |
+
'label' => __('Images', 'so-widgets-bundle'),
|
58 |
+
'item_name' => __( 'Image', 'so-widgets-bundle' ),
|
59 |
+
'item_label' => array(
|
60 |
+
'selector' => "[name*='title']",
|
61 |
+
'update_event' => 'change',
|
62 |
+
'value_method' => 'val'
|
63 |
+
),
|
64 |
+
'fields' => array(
|
65 |
+
'image' => array(
|
66 |
+
'type' => 'media',
|
67 |
+
'label' => __('Image', 'so-widgets-bundle')
|
68 |
+
),
|
69 |
+
'title' => array(
|
70 |
+
'type' => 'text',
|
71 |
+
'label' => __('Image title', 'so-widgets-bundle')
|
72 |
+
),
|
73 |
+
'url' => array(
|
74 |
+
'type' => 'link',
|
75 |
+
'label' => __('URL', 'so-widgets-bundle')
|
76 |
+
),
|
77 |
+
)
|
78 |
+
),
|
79 |
+
|
80 |
+
'display' => array(
|
81 |
+
'type' => 'section',
|
82 |
+
'label' => __('Display', 'so-widgets-bundle'),
|
83 |
+
'fields' => array(
|
84 |
+
'attachment_size' => array(
|
85 |
+
'label' => __('Image size', 'so-widgets-bundle'),
|
86 |
+
'type' => 'select',
|
87 |
+
'options' => $sizes,
|
88 |
+
'default' => 'full',
|
89 |
+
),
|
90 |
+
|
91 |
+
'max_height' => array(
|
92 |
+
'label' => __('Maximum image height', 'so-widgets-bundle'),
|
93 |
+
'type' => 'number',
|
94 |
+
),
|
95 |
+
|
96 |
+
'max_width' => array(
|
97 |
+
'label' => __('Maximum image width', 'so-widgets-bundle'),
|
98 |
+
'type' => 'number',
|
99 |
+
),
|
100 |
+
|
101 |
+
'spacing' => array(
|
102 |
+
'label' => __('Spacing', 'so-widgets-bundle'),
|
103 |
+
'description' => __('Amount of spacing between images.', 'so-widgets-bundle'),
|
104 |
+
'type' => 'number',
|
105 |
+
'default' => 10,
|
106 |
+
),
|
107 |
+
)
|
108 |
+
)
|
109 |
+
);
|
110 |
}
|
111 |
|
112 |
/**
|
widgets/image/image.php
CHANGED
@@ -18,95 +18,97 @@ class SiteOrigin_Widget_Image_Widget extends SiteOrigin_Widget {
|
|
18 |
array(
|
19 |
|
20 |
),
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
'library' => 'image',
|
26 |
-
'fallback' => true,
|
27 |
-
),
|
28 |
|
29 |
-
|
30 |
-
'type' => 'select',
|
31 |
-
'label' => __('Image size', 'so-widgets-bundle'),
|
32 |
-
'options' => array(
|
33 |
-
'full' => __('Full', 'so-widgets-bundle'),
|
34 |
-
'large' => __('Large', 'so-widgets-bundle'),
|
35 |
-
'medium' => __('Medium', 'so-widgets-bundle'),
|
36 |
-
'thumb' => __('Thumbnail', 'so-widgets-bundle'),
|
37 |
-
),
|
38 |
-
),
|
39 |
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
|
|
51 |
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
),
|
|
|
|
|
|
|
56 |
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
'hidden' => __( 'Hidden', 'so-widgets-bundle' ),
|
63 |
-
'above' => __( 'Above', 'so-widgets-bundle' ),
|
64 |
-
'below' => __( 'Below', 'so-widgets-bundle' ),
|
65 |
-
),
|
66 |
-
),
|
67 |
|
68 |
-
|
69 |
-
|
70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
),
|
|
|
72 |
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
'new_window' => array(
|
78 |
-
'type' => 'checkbox',
|
79 |
-
'default' => false,
|
80 |
-
'label' => __('Open in new window', 'so-widgets-bundle'),
|
81 |
-
),
|
82 |
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
'
|
91 |
-
'default' => false,
|
92 |
-
'label' => __('Full Width', 'so-widgets-bundle'),
|
93 |
-
'description' => __("Resize image to fit its container.", 'so-widgets-bundle'),
|
94 |
),
|
|
|
95 |
|
|
|
|
|
|
|
96 |
),
|
97 |
-
plugin_dir_path(__FILE__).'../'
|
98 |
-
);
|
99 |
-
}
|
100 |
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
|
|
|
|
108 |
|
109 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
}
|
111 |
|
112 |
function get_style_hash($instance) {
|
18 |
array(
|
19 |
|
20 |
),
|
21 |
+
false,
|
22 |
+
plugin_dir_path(__FILE__)
|
23 |
+
);
|
24 |
+
}
|
|
|
|
|
|
|
25 |
|
26 |
+
function initialize_form(){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
+
global $_wp_additional_image_sizes;
|
29 |
+
$sizes = array(
|
30 |
+
'full' => __('Full', 'so-widgets-bundle'),
|
31 |
+
'large' => __('Large', 'so-widgets-bundle'),
|
32 |
+
'medium' => __('Medium', 'so-widgets-bundle'),
|
33 |
+
'thumb' => __('Thumbnail', 'so-widgets-bundle'),
|
34 |
+
);
|
35 |
+
if( !empty($_wp_additional_image_sizes) ) {
|
36 |
+
foreach($_wp_additional_image_sizes as $i => $s) {
|
37 |
+
$sizes[$i] = $i;
|
38 |
+
}
|
39 |
+
}
|
40 |
|
41 |
+
return array(
|
42 |
+
'image' => array(
|
43 |
+
'type' => 'media',
|
44 |
+
'label' => __('Image file', 'so-widgets-bundle'),
|
45 |
+
'library' => 'image',
|
46 |
+
'fallback' => true,
|
47 |
+
),
|
48 |
|
49 |
+
'size' => array(
|
50 |
+
'type' => 'select',
|
51 |
+
'label' => __('Image size', 'so-widgets-bundle'),
|
52 |
+
'options' => $sizes,
|
53 |
+
),
|
|
|
|
|
|
|
|
|
|
|
54 |
|
55 |
+
'align' => array(
|
56 |
+
'type' => 'select',
|
57 |
+
'label' => __('Image alignment', 'so-widgets-bundle'),
|
58 |
+
'default' => 'default',
|
59 |
+
'options' => array(
|
60 |
+
'default' => __('Default', 'so-widgets-bundle'),
|
61 |
+
'left' => __('Left', 'so-widgets-bundle'),
|
62 |
+
'right' => __('Right', 'so-widgets-bundle'),
|
63 |
+
'center' => __('Center', 'so-widgets-bundle'),
|
64 |
),
|
65 |
+
),
|
66 |
|
67 |
+
'title' => array(
|
68 |
+
'type' => 'text',
|
69 |
+
'label' => __('Title text', 'so-widgets-bundle'),
|
70 |
+
),
|
|
|
|
|
|
|
|
|
|
|
71 |
|
72 |
+
'title_position' => array(
|
73 |
+
'type' => 'select',
|
74 |
+
'label' => __('Title position', 'so-widgets-bundle'),
|
75 |
+
'default' => 'hidden',
|
76 |
+
'options' => array(
|
77 |
+
'hidden' => __( 'Hidden', 'so-widgets-bundle' ),
|
78 |
+
'above' => __( 'Above', 'so-widgets-bundle' ),
|
79 |
+
'below' => __( 'Below', 'so-widgets-bundle' ),
|
|
|
|
|
|
|
80 |
),
|
81 |
+
),
|
82 |
|
83 |
+
'alt' => array(
|
84 |
+
'type' => 'text',
|
85 |
+
'label' => __('Alt text', 'so-widgets-bundle'),
|
86 |
),
|
|
|
|
|
|
|
87 |
|
88 |
+
'url' => array(
|
89 |
+
'type' => 'link',
|
90 |
+
'label' => __('Destination URL', 'so-widgets-bundle'),
|
91 |
+
),
|
92 |
+
'new_window' => array(
|
93 |
+
'type' => 'checkbox',
|
94 |
+
'default' => false,
|
95 |
+
'label' => __('Open in new window', 'so-widgets-bundle'),
|
96 |
+
),
|
97 |
|
98 |
+
'bound' => array(
|
99 |
+
'type' => 'checkbox',
|
100 |
+
'default' => true,
|
101 |
+
'label' => __('Bound', 'so-widgets-bundle'),
|
102 |
+
'description' => __("Make sure the image doesn't extend beyond its container.", 'so-widgets-bundle'),
|
103 |
+
),
|
104 |
+
'full_width' => array(
|
105 |
+
'type' => 'checkbox',
|
106 |
+
'default' => false,
|
107 |
+
'label' => __('Full Width', 'so-widgets-bundle'),
|
108 |
+
'description' => __("Resize image to fit its container.", 'so-widgets-bundle'),
|
109 |
+
),
|
110 |
+
|
111 |
+
);
|
112 |
}
|
113 |
|
114 |
function get_style_hash($instance) {
|
widgets/post-carousel/post-carousel.php
CHANGED
@@ -49,17 +49,7 @@ class SiteOrigin_Widget_PostCarousel_Widget extends SiteOrigin_Widget {
|
|
49 |
array(
|
50 |
|
51 |
),
|
52 |
-
|
53 |
-
'title' => array(
|
54 |
-
'type' => 'text',
|
55 |
-
'label' => __('Title', 'so-widgets-bundle'),
|
56 |
-
),
|
57 |
-
|
58 |
-
'posts' => array(
|
59 |
-
'type' => 'posts',
|
60 |
-
'label' => __('Posts query', 'so-widgets-bundle'),
|
61 |
-
),
|
62 |
-
),
|
63 |
plugin_dir_path(__FILE__).'../'
|
64 |
);
|
65 |
}
|
@@ -94,6 +84,20 @@ class SiteOrigin_Widget_PostCarousel_Widget extends SiteOrigin_Widget {
|
|
94 |
);
|
95 |
}
|
96 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
function get_template_name($instance){
|
98 |
return 'base';
|
99 |
}
|
@@ -103,4 +107,4 @@ class SiteOrigin_Widget_PostCarousel_Widget extends SiteOrigin_Widget {
|
|
103 |
}
|
104 |
}
|
105 |
|
106 |
-
siteorigin_widget_register('sow-post-carousel', __FILE__, 'SiteOrigin_Widget_PostCarousel_Widget');
|
49 |
array(
|
50 |
|
51 |
),
|
52 |
+
false ,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
plugin_dir_path(__FILE__).'../'
|
54 |
);
|
55 |
}
|
84 |
);
|
85 |
}
|
86 |
|
87 |
+
function initialize_form(){
|
88 |
+
return array(
|
89 |
+
'title' => array(
|
90 |
+
'type' => 'text',
|
91 |
+
'label' => __('Title', 'so-widgets-bundle'),
|
92 |
+
),
|
93 |
+
|
94 |
+
'posts' => array(
|
95 |
+
'type' => 'posts',
|
96 |
+
'label' => __('Posts query', 'so-widgets-bundle'),
|
97 |
+
),
|
98 |
+
);
|
99 |
+
}
|
100 |
+
|
101 |
function get_template_name($instance){
|
102 |
return 'base';
|
103 |
}
|
107 |
}
|
108 |
}
|
109 |
|
110 |
+
siteorigin_widget_register('sow-post-carousel', __FILE__, 'SiteOrigin_Widget_PostCarousel_Widget');
|
widgets/price-table/price-table.php
CHANGED
@@ -18,143 +18,147 @@ class SiteOrigin_Widget_PriceTable_Widget extends SiteOrigin_Widget {
|
|
18 |
array(
|
19 |
|
20 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
array(
|
22 |
-
|
23 |
-
'
|
24 |
-
|
25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
),
|
36 |
-
'fields' => array(
|
37 |
-
'featured' => array(
|
38 |
-
'type' => 'checkbox',
|
39 |
-
'label' => __('Featured', 'so-widgets-bundle'),
|
40 |
-
),
|
41 |
-
'title' => array(
|
42 |
-
'type' => 'text',
|
43 |
-
'label' => __('Title', 'so-widgets-bundle'),
|
44 |
-
),
|
45 |
-
'subtitle' => array(
|
46 |
-
'type' => 'text',
|
47 |
-
'label' => __('Subtitle', 'so-widgets-bundle'),
|
48 |
-
),
|
49 |
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
),
|
81 |
-
'
|
82 |
-
'
|
83 |
-
|
84 |
-
|
85 |
-
'item_label' => array(
|
86 |
-
'selector' => "[id*='columns-features-text']",
|
87 |
-
'update_event' => 'change',
|
88 |
-
'value_method' => 'val'
|
89 |
),
|
90 |
-
'
|
91 |
-
'
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
'
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
'
|
100 |
-
|
101 |
-
'label' => __('Icon', 'so-widgets-bundle'),
|
102 |
-
),
|
103 |
-
'icon_color' => array(
|
104 |
-
'type' => 'color',
|
105 |
-
'label' => __('Icon color', 'so-widgets-bundle'),
|
106 |
-
),
|
107 |
),
|
108 |
),
|
109 |
),
|
110 |
),
|
|
|
111 |
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
),
|
118 |
-
),
|
119 |
-
|
120 |
-
'header_color' => array(
|
121 |
-
'type' => 'color',
|
122 |
-
'label' => __('Header color', 'so-widgets-bundle'),
|
123 |
),
|
|
|
124 |
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
),
|
144 |
),
|
145 |
-
plugin_dir_path(__FILE__).'../'
|
146 |
-
);
|
147 |
-
}
|
148 |
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
'siteorigin-pricetable',
|
154 |
-
plugin_dir_url(__FILE__) . 'js/pricetable' . SOW_BUNDLE_JS_SUFFIX . '.js',
|
155 |
-
array( 'jquery' )
|
156 |
-
)
|
157 |
-
)
|
158 |
);
|
159 |
}
|
160 |
|
18 |
array(
|
19 |
|
20 |
),
|
21 |
+
false,
|
22 |
+
plugin_dir_path(__FILE__).'../'
|
23 |
+
);
|
24 |
+
}
|
25 |
+
|
26 |
+
function initialize() {
|
27 |
+
$this->register_frontend_scripts(
|
28 |
array(
|
29 |
+
array(
|
30 |
+
'siteorigin-pricetable',
|
31 |
+
plugin_dir_url(__FILE__) . 'js/pricetable' . SOW_BUNDLE_JS_SUFFIX . '.js',
|
32 |
+
array( 'jquery' )
|
33 |
+
)
|
34 |
+
)
|
35 |
+
);
|
36 |
+
}
|
37 |
+
|
38 |
+
function initialize_form(){
|
39 |
+
return array(
|
40 |
+
'title' => array(
|
41 |
+
'type' => 'text',
|
42 |
+
'label' => __('Title', 'so-widgets-bundle'),
|
43 |
+
),
|
44 |
|
45 |
+
'columns' => array(
|
46 |
+
'type' => 'repeater',
|
47 |
+
'label' => __('Columns', 'so-widgets-bundle'),
|
48 |
+
'item_name' => __('Column', 'so-widgets-bundle'),
|
49 |
+
'item_label' => array(
|
50 |
+
'selector' => "[id*='columns-title']",
|
51 |
+
'update_event' => 'change',
|
52 |
+
'value_method' => 'val'
|
53 |
+
),
|
54 |
+
'fields' => array(
|
55 |
+
'featured' => array(
|
56 |
+
'type' => 'checkbox',
|
57 |
+
'label' => __('Featured', 'so-widgets-bundle'),
|
58 |
+
),
|
59 |
+
'title' => array(
|
60 |
+
'type' => 'text',
|
61 |
+
'label' => __('Title', 'so-widgets-bundle'),
|
62 |
+
),
|
63 |
+
'subtitle' => array(
|
64 |
+
'type' => 'text',
|
65 |
+
'label' => __('Subtitle', 'so-widgets-bundle'),
|
66 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
|
68 |
+
'image' => array(
|
69 |
+
'type' => 'media',
|
70 |
+
'label' => __('Image', 'so-widgets-bundle'),
|
71 |
+
),
|
72 |
|
73 |
+
'image_title' => array(
|
74 |
+
'type' => 'text',
|
75 |
+
'label' => __('Image title', 'so-widgets-bundle'),
|
76 |
+
),
|
77 |
|
78 |
+
'image_alt' => array(
|
79 |
+
'type' => 'text',
|
80 |
+
'label' => __('Image alt text', 'so-widgets-bundle'),
|
81 |
+
),
|
82 |
|
83 |
+
'price' => array(
|
84 |
+
'type' => 'text',
|
85 |
+
'label' => __('Price', 'so-widgets-bundle'),
|
86 |
+
),
|
87 |
+
'per' => array(
|
88 |
+
'type' => 'text',
|
89 |
+
'label' => __('Per', 'so-widgets-bundle'),
|
90 |
+
),
|
91 |
+
'button' => array(
|
92 |
+
'type' => 'text',
|
93 |
+
'label' => __('Button text', 'so-widgets-bundle'),
|
94 |
+
),
|
95 |
+
'url' => array(
|
96 |
+
'type' => 'link',
|
97 |
+
'label' => __('Button URL', 'so-widgets-bundle'),
|
98 |
+
),
|
99 |
+
'features' => array(
|
100 |
+
'type' => 'repeater',
|
101 |
+
'label' => __('Features', 'so-widgets-bundle'),
|
102 |
+
'item_name' => __('Feature', 'so-widgets-bundle'),
|
103 |
+
'item_label' => array(
|
104 |
+
'selector' => "[id*='columns-features-text']",
|
105 |
+
'update_event' => 'change',
|
106 |
+
'value_method' => 'val'
|
107 |
),
|
108 |
+
'fields' => array(
|
109 |
+
'text' => array(
|
110 |
+
'type' => 'text',
|
111 |
+
'label' => __('Text', 'so-widgets-bundle'),
|
|
|
|
|
|
|
|
|
112 |
),
|
113 |
+
'hover' => array(
|
114 |
+
'type' => 'text',
|
115 |
+
'label' => __('Hover text', 'so-widgets-bundle'),
|
116 |
+
),
|
117 |
+
'icon_new' => array(
|
118 |
+
'type' => 'icon',
|
119 |
+
'label' => __('Icon', 'so-widgets-bundle'),
|
120 |
+
),
|
121 |
+
'icon_color' => array(
|
122 |
+
'type' => 'color',
|
123 |
+
'label' => __('Icon color', 'so-widgets-bundle'),
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
),
|
125 |
),
|
126 |
),
|
127 |
),
|
128 |
+
),
|
129 |
|
130 |
+
'theme' => array(
|
131 |
+
'type' => 'select',
|
132 |
+
'label' => __('Price table theme', 'so-widgets-bundle'),
|
133 |
+
'options' => array(
|
134 |
+
'atom' => __('Atom', 'so-widgets-bundle'),
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
),
|
136 |
+
),
|
137 |
|
138 |
+
'header_color' => array(
|
139 |
+
'type' => 'color',
|
140 |
+
'label' => __('Header color', 'so-widgets-bundle'),
|
141 |
+
),
|
142 |
|
143 |
+
'featured_header_color' => array(
|
144 |
+
'type' => 'color',
|
145 |
+
'label' => __('Featured header color', 'so-widgets-bundle'),
|
146 |
+
),
|
147 |
|
148 |
+
'button_color' => array(
|
149 |
+
'type' => 'color',
|
150 |
+
'label' => __('Button color', 'so-widgets-bundle'),
|
151 |
+
),
|
152 |
|
153 |
+
'featured_button_color' => array(
|
154 |
+
'type' => 'color',
|
155 |
+
'label' => __('Featured button color', 'so-widgets-bundle'),
|
|
|
156 |
),
|
|
|
|
|
|
|
157 |
|
158 |
+
'button_new_window' => array(
|
159 |
+
'type' => 'checkbox',
|
160 |
+
'label' => __('Open Button URL in a new window', 'so-widgets-bundle'),
|
161 |
+
),
|
|
|
|
|
|
|
|
|
|
|
162 |
);
|
163 |
}
|
164 |
|
widgets/price-table/styles/atom.less
CHANGED
@@ -82,6 +82,17 @@
|
|
82 |
padding: 15px 20px;
|
83 |
background: #ffffff;
|
84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
.gradient(#FFFFFF, #fcfcfc, #FFFFFF);
|
86 |
|
87 |
&.ow-pt-feature-odd {
|
@@ -219,4 +230,4 @@
|
|
219 |
}
|
220 |
}
|
221 |
}
|
222 |
-
}
|
82 |
padding: 15px 20px;
|
83 |
background: #ffffff;
|
84 |
|
85 |
+
.sow-feature-icon {
|
86 |
+
display: table-cell;
|
87 |
+
vertical-align: middle;
|
88 |
+
padding-right: 10px;
|
89 |
+
}
|
90 |
+
|
91 |
+
.sow-feature-icon + .sow-feature-text {
|
92 |
+
display: table-cell;
|
93 |
+
vertical-align: middle;
|
94 |
+
}
|
95 |
+
|
96 |
.gradient(#FFFFFF, #fcfcfc, #FFFFFF);
|
97 |
|
98 |
&.ow-pt-feature-odd {
|
230 |
}
|
231 |
}
|
232 |
}
|
233 |
+
}
|
widgets/price-table/tpl/atom.php
CHANGED
@@ -25,16 +25,22 @@
|
|
25 |
<div class="ow-pt-feature ow-pt-feature-<?php echo $i % 2 == 0 ? 'even' : 'odd' ?>">
|
26 |
|
27 |
<?php
|
28 |
-
if( !empty($feature['icon_new']) ) {
|
|
|
|
|
29 |
$icon_styles = array();
|
30 |
if(!empty($feature['icon_color'])) $icon_styles[] = 'color: '.$feature['icon_color'];
|
31 |
echo siteorigin_widget_get_icon($feature['icon_new'], $icon_styles);
|
|
|
|
|
|
|
32 |
}
|
33 |
?>
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
|
|
38 |
</div>
|
39 |
<?php endforeach; ?>
|
40 |
</div>
|
25 |
<div class="ow-pt-feature ow-pt-feature-<?php echo $i % 2 == 0 ? 'even' : 'odd' ?>">
|
26 |
|
27 |
<?php
|
28 |
+
if( !empty($feature['icon_new']) ) { ?>
|
29 |
+
<div class="sow-feature-icon">
|
30 |
+
<?php
|
31 |
$icon_styles = array();
|
32 |
if(!empty($feature['icon_color'])) $icon_styles[] = 'color: '.$feature['icon_color'];
|
33 |
echo siteorigin_widget_get_icon($feature['icon_new'], $icon_styles);
|
34 |
+
?>
|
35 |
+
</div>
|
36 |
+
<?php
|
37 |
}
|
38 |
?>
|
39 |
+
<div class="sow-feature-text">
|
40 |
+
<p <?php if(!empty( $feature['hover'] ) ) : ?>data-tooltip-text="<?php echo esc_attr($feature['hover']) ?>"<?php endif; ?>>
|
41 |
+
<?php echo wp_kses_post($feature['text']) ?>
|
42 |
+
</p>
|
43 |
+
</div>
|
44 |
</div>
|
45 |
<?php endforeach; ?>
|
46 |
</div>
|
widgets/simple-masonry/simple-masonry.php
CHANGED
@@ -17,141 +17,7 @@ class SiteOrigin_Widget_Simple_Masonry_Widget extends SiteOrigin_Widget {
|
|
17 |
// 'help' => 'https://siteorigin.com/widgets-bundle/simple-masonry-widget-documentation/'
|
18 |
),
|
19 |
array(),
|
20 |
-
|
21 |
-
'widget_title' => array(
|
22 |
-
'type' => 'text',
|
23 |
-
'label' => __('Title', 'so-widgets-bundle'),
|
24 |
-
),
|
25 |
-
'items' => array(
|
26 |
-
'type' => 'repeater',
|
27 |
-
'label' => __( 'Images', 'so-widgets-bundle' ),
|
28 |
-
'item_label' => array(
|
29 |
-
'selector' => "[id*='title']"
|
30 |
-
),
|
31 |
-
'fields' => array(
|
32 |
-
'image' => array(
|
33 |
-
'type' => 'media',
|
34 |
-
'label' => __( 'Image', 'so-widgets-bundle')
|
35 |
-
),
|
36 |
-
'column_span' => array(
|
37 |
-
'type' => 'slider',
|
38 |
-
'label' => __( 'Column span', 'so-widgets-bundle' ),
|
39 |
-
'description' => __( 'Number of columns this item should span. (Limited to number of columns selected in Layout section below.)', 'so-widgets-bundle' ),
|
40 |
-
'min' => 1,
|
41 |
-
'max' => 10,
|
42 |
-
'default' => 1
|
43 |
-
),
|
44 |
-
'row_span' => array(
|
45 |
-
'type' => 'slider',
|
46 |
-
'label' => __( 'Row span', 'so-widgets-bundle' ),
|
47 |
-
'description' => __( 'Number of rows this item should span. (Limited to number of columns selected in Layout section below.)', 'so-widgets-bundle' ),
|
48 |
-
'min' => 1,
|
49 |
-
'max' => 10,
|
50 |
-
'default' => 1
|
51 |
-
),
|
52 |
-
'title' => array(
|
53 |
-
'type' => 'text',
|
54 |
-
'label' => __('Title', 'so-widgets-bundle'),
|
55 |
-
),
|
56 |
-
'url' => array(
|
57 |
-
'type' => 'link',
|
58 |
-
'label' => __('Destination URL', 'so-widgets-bundle'),
|
59 |
-
),
|
60 |
-
'new_window' => array(
|
61 |
-
'type' => 'checkbox',
|
62 |
-
'default' => false,
|
63 |
-
'label' => __('Open in a new window', 'so-widgets-bundle'),
|
64 |
-
),
|
65 |
-
)
|
66 |
-
),
|
67 |
-
'desktop_layout' => array(
|
68 |
-
'type' => 'section',
|
69 |
-
'label' => __( 'Desktop Layout', 'so-widgets-bundle' ),
|
70 |
-
'fields' => array(
|
71 |
-
'columns' => array(
|
72 |
-
'type' => 'slider',
|
73 |
-
'label' => __( 'Number of columns', 'so-widgets-bundle' ),
|
74 |
-
'min' => 1,
|
75 |
-
'max' => 10,
|
76 |
-
'default' => 4
|
77 |
-
),
|
78 |
-
'row_height' => array(
|
79 |
-
'type' => 'number',
|
80 |
-
'label' => __( 'Row height', 'so-widgets-bundle' ),
|
81 |
-
'description' => __( 'Leave blank to match calculated column width.', 'so-widgets-bundle' ),
|
82 |
-
'default' => 0
|
83 |
-
),
|
84 |
-
'gutter' => array(
|
85 |
-
'type' => 'number',
|
86 |
-
'label' => __( 'Gutter', 'so-widgets-bundle'),
|
87 |
-
'description' => __( 'Space between masonry items.', 'so-widgets-bundle' ),
|
88 |
-
'default' => 0
|
89 |
-
)
|
90 |
-
)
|
91 |
-
),
|
92 |
-
'tablet_layout' => array(
|
93 |
-
'type' => 'section',
|
94 |
-
'label' => __( 'Tablet Layout', 'so-widgets-bundle' ),
|
95 |
-
'hide' => true,
|
96 |
-
'fields' => array(
|
97 |
-
'break_point' => array(
|
98 |
-
'type' => 'number',
|
99 |
-
'lanel' => __( 'Break point', 'so-widgets-bundle' ),
|
100 |
-
'default' => 768
|
101 |
-
),
|
102 |
-
'columns' => array(
|
103 |
-
'type' => 'slider',
|
104 |
-
'label' => __( 'Number of columns', 'so-widgets-bundle' ),
|
105 |
-
'min' => 1,
|
106 |
-
'max' => 10,
|
107 |
-
'default' => 2
|
108 |
-
),
|
109 |
-
'row_height' => array(
|
110 |
-
'type' => 'number',
|
111 |
-
'label' => __( 'Row height', 'so-widgets-bundle' ),
|
112 |
-
'description' => __( 'Leave blank to match calculated column width.', 'so-widgets-bundle' ),
|
113 |
-
'default' => 0
|
114 |
-
),
|
115 |
-
'gutter' => array(
|
116 |
-
'type' => 'number',
|
117 |
-
'label' => __( 'Gutter', 'so-widgets-bundle'),
|
118 |
-
'description' => __( 'Space between masonry items.', 'so-widgets-bundle' ),
|
119 |
-
'default' => 0
|
120 |
-
)
|
121 |
-
)
|
122 |
-
),
|
123 |
-
'mobile_layout' => array(
|
124 |
-
'type' => 'section',
|
125 |
-
'label' => __( 'Mobile Layout', 'so-widgets-bundle' ),
|
126 |
-
'hide' => true,
|
127 |
-
'fields' => array(
|
128 |
-
'break_point' => array(
|
129 |
-
'type' => 'number',
|
130 |
-
'lanel' => __( 'Break point', 'so-widgets-bundle' ),
|
131 |
-
'default' => 480
|
132 |
-
),
|
133 |
-
'columns' => array(
|
134 |
-
'type' => 'slider',
|
135 |
-
'label' => __( 'Number of columns', 'so-widgets-bundle' ),
|
136 |
-
'min' => 1,
|
137 |
-
'max' => 10,
|
138 |
-
'default' => 1
|
139 |
-
),
|
140 |
-
'row_height' => array(
|
141 |
-
'type' => 'number',
|
142 |
-
'label' => __( 'Row height', 'so-widgets-bundle' ),
|
143 |
-
'description' => __( 'Leave blank to match calculated column width.', 'so-widgets-bundle' ),
|
144 |
-
'default' => 0
|
145 |
-
),
|
146 |
-
'gutter' => array(
|
147 |
-
'type' => 'number',
|
148 |
-
'label' => __( 'Gutter', 'so-widgets-bundle'),
|
149 |
-
'description' => __( 'Space between masonry items.', 'so-widgets-bundle' ),
|
150 |
-
'default' => 0
|
151 |
-
)
|
152 |
-
)
|
153 |
-
)
|
154 |
-
),
|
155 |
plugin_dir_path(__FILE__)
|
156 |
);
|
157 |
|
@@ -182,6 +48,144 @@ class SiteOrigin_Widget_Simple_Masonry_Widget extends SiteOrigin_Widget {
|
|
182 |
);
|
183 |
}
|
184 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
function get_template_name($instance) {
|
186 |
return 'simple-masonry';
|
187 |
}
|
17 |
// 'help' => 'https://siteorigin.com/widgets-bundle/simple-masonry-widget-documentation/'
|
18 |
),
|
19 |
array(),
|
20 |
+
false,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
plugin_dir_path(__FILE__)
|
22 |
);
|
23 |
|
48 |
);
|
49 |
}
|
50 |
|
51 |
+
function initialize_form(){
|
52 |
+
return array(
|
53 |
+
'widget_title' => array(
|
54 |
+
'type' => 'text',
|
55 |
+
'label' => __('Title', 'so-widgets-bundle'),
|
56 |
+
),
|
57 |
+
'items' => array(
|
58 |
+
'type' => 'repeater',
|
59 |
+
'label' => __( 'Images', 'so-widgets-bundle' ),
|
60 |
+
'item_label' => array(
|
61 |
+
'selector' => "[id*='title']"
|
62 |
+
),
|
63 |
+
'fields' => array(
|
64 |
+
'image' => array(
|
65 |
+
'type' => 'media',
|
66 |
+
'label' => __( 'Image', 'so-widgets-bundle')
|
67 |
+
),
|
68 |
+
'column_span' => array(
|
69 |
+
'type' => 'slider',
|
70 |
+
'label' => __( 'Column span', 'so-widgets-bundle' ),
|
71 |
+
'description' => __( 'Number of columns this item should span. (Limited to number of columns selected in Layout section below.)', 'so-widgets-bundle' ),
|
72 |
+
'min' => 1,
|
73 |
+
'max' => 10,
|
74 |
+
'default' => 1
|
75 |
+
),
|
76 |
+
'row_span' => array(
|
77 |
+
'type' => 'slider',
|
78 |
+
'label' => __( 'Row span', 'so-widgets-bundle' ),
|
79 |
+
'description' => __( 'Number of rows this item should span. (Limited to number of columns selected in Layout section below.)', 'so-widgets-bundle' ),
|
80 |
+
'min' => 1,
|
81 |
+
'max' => 10,
|
82 |
+
'default' => 1
|
83 |
+
),
|
84 |
+
'title' => array(
|
85 |
+
'type' => 'text',
|
86 |
+
'label' => __('Title', 'so-widgets-bundle'),
|
87 |
+
),
|
88 |
+
'url' => array(
|
89 |
+
'type' => 'link',
|
90 |
+
'label' => __('Destination URL', 'so-widgets-bundle'),
|
91 |
+
),
|
92 |
+
'new_window' => array(
|
93 |
+
'type' => 'checkbox',
|
94 |
+
'default' => false,
|
95 |
+
'label' => __('Open in a new window', 'so-widgets-bundle'),
|
96 |
+
),
|
97 |
+
)
|
98 |
+
),
|
99 |
+
'desktop_layout' => array(
|
100 |
+
'type' => 'section',
|
101 |
+
'label' => __( 'Desktop Layout', 'so-widgets-bundle' ),
|
102 |
+
'fields' => array(
|
103 |
+
'columns' => array(
|
104 |
+
'type' => 'slider',
|
105 |
+
'label' => __( 'Number of columns', 'so-widgets-bundle' ),
|
106 |
+
'min' => 1,
|
107 |
+
'max' => 10,
|
108 |
+
'default' => 4
|
109 |
+
),
|
110 |
+
'row_height' => array(
|
111 |
+
'type' => 'number',
|
112 |
+
'label' => __( 'Row height', 'so-widgets-bundle' ),
|
113 |
+
'description' => __( 'Leave blank to match calculated column width.', 'so-widgets-bundle' ),
|
114 |
+
'default' => 0
|
115 |
+
),
|
116 |
+
'gutter' => array(
|
117 |
+
'type' => 'number',
|
118 |
+
'label' => __( 'Gutter', 'so-widgets-bundle'),
|
119 |
+
'description' => __( 'Space between masonry items.', 'so-widgets-bundle' ),
|
120 |
+
'default' => 0
|
121 |
+
)
|
122 |
+
)
|
123 |
+
),
|
124 |
+
'tablet_layout' => array(
|
125 |
+
'type' => 'section',
|
126 |
+
'label' => __( 'Tablet Layout', 'so-widgets-bundle' ),
|
127 |
+
'hide' => true,
|
128 |
+
'fields' => array(
|
129 |
+
'break_point' => array(
|
130 |
+
'type' => 'number',
|
131 |
+
'lanel' => __( 'Break point', 'so-widgets-bundle' ),
|
132 |
+
'default' => 768
|
133 |
+
),
|
134 |
+
'columns' => array(
|
135 |
+
'type' => 'slider',
|
136 |
+
'label' => __( 'Number of columns', 'so-widgets-bundle' ),
|
137 |
+
'min' => 1,
|
138 |
+
'max' => 10,
|
139 |
+
'default' => 2
|
140 |
+
),
|
141 |
+
'row_height' => array(
|
142 |
+
'type' => 'number',
|
143 |
+
'label' => __( 'Row height', 'so-widgets-bundle' ),
|
144 |
+
'description' => __( 'Leave blank to match calculated column width.', 'so-widgets-bundle' ),
|
145 |
+
'default' => 0
|
146 |
+
),
|
147 |
+
'gutter' => array(
|
148 |
+
'type' => 'number',
|
149 |
+
'label' => __( 'Gutter', 'so-widgets-bundle'),
|
150 |
+
'description' => __( 'Space between masonry items.', 'so-widgets-bundle' ),
|
151 |
+
'default' => 0
|
152 |
+
)
|
153 |
+
)
|
154 |
+
),
|
155 |
+
'mobile_layout' => array(
|
156 |
+
'type' => 'section',
|
157 |
+
'label' => __( 'Mobile Layout', 'so-widgets-bundle' ),
|
158 |
+
'hide' => true,
|
159 |
+
'fields' => array(
|
160 |
+
'break_point' => array(
|
161 |
+
'type' => 'number',
|
162 |
+
'lanel' => __( 'Break point', 'so-widgets-bundle' ),
|
163 |
+
'default' => 480
|
164 |
+
),
|
165 |
+
'columns' => array(
|
166 |
+
'type' => 'slider',
|
167 |
+
'label' => __( 'Number of columns', 'so-widgets-bundle' ),
|
168 |
+
'min' => 1,
|
169 |
+
'max' => 10,
|
170 |
+
'default' => 1
|
171 |
+
),
|
172 |
+
'row_height' => array(
|
173 |
+
'type' => 'number',
|
174 |
+
'label' => __( 'Row height', 'so-widgets-bundle' ),
|
175 |
+
'description' => __( 'Leave blank to match calculated column width.', 'so-widgets-bundle' ),
|
176 |
+
'default' => 0
|
177 |
+
),
|
178 |
+
'gutter' => array(
|
179 |
+
'type' => 'number',
|
180 |
+
'label' => __( 'Gutter', 'so-widgets-bundle'),
|
181 |
+
'description' => __( 'Space between masonry items.', 'so-widgets-bundle' ),
|
182 |
+
'default' => 0
|
183 |
+
)
|
184 |
+
)
|
185 |
+
)
|
186 |
+
);
|
187 |
+
}
|
188 |
+
|
189 |
function get_template_name($instance) {
|
190 |
return 'simple-masonry';
|
191 |
}
|
widgets/slider/slider.php
CHANGED
@@ -21,77 +21,81 @@ class SiteOrigin_Widget_Slider_Widget extends SiteOrigin_Widget_Base_Slider {
|
|
21 |
array(
|
22 |
|
23 |
),
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
'item_name' => __('Frame', 'so-widgets-bundle'),
|
29 |
-
'item_label' => array(
|
30 |
-
'selector' => "[id*='frames-url']",
|
31 |
-
'update_event' => 'change',
|
32 |
-
'value_method' => 'val'
|
33 |
-
),
|
34 |
-
'fields' => array(
|
35 |
-
'background_videos' => array(
|
36 |
-
'type' => 'repeater',
|
37 |
-
'item_name' => __('Video', 'so-widgets-bundle'),
|
38 |
-
'label' => __('Background videos', 'so-widgets-bundle'),
|
39 |
-
'item_label' => array(
|
40 |
-
'selector' => "[id*='frames-background_videos-url']",
|
41 |
-
'update_event' => 'change',
|
42 |
-
'value_method' => 'val'
|
43 |
-
),
|
44 |
-
'fields' => $this->video_form_fields(),
|
45 |
-
),
|
46 |
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
),
|
|
|
|
|
53 |
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
),
|
|
|
|
|
58 |
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
'cover' => __('Cover', 'so-widgets-bundle'),
|
64 |
-
'tile' => __('Tile', 'so-widgets-bundle'),
|
65 |
-
),
|
66 |
-
'default' => 'cover',
|
67 |
-
),
|
68 |
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
'
|
|
|
74 |
),
|
|
|
|
|
75 |
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
),
|
|
|
|
|
80 |
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
|
|
|
|
|
|
|
|
86 |
),
|
87 |
),
|
88 |
-
'controls' => array(
|
89 |
-
'type' => 'section',
|
90 |
-
'label' => __('Controls', 'so-widgets-bundle'),
|
91 |
-
'fields' => $this->control_form_fields()
|
92 |
-
)
|
93 |
),
|
94 |
-
|
|
|
|
|
|
|
|
|
95 |
);
|
96 |
}
|
97 |
|
@@ -106,9 +110,11 @@ class SiteOrigin_Widget_Slider_Widget extends SiteOrigin_Widget_Base_Slider {
|
|
106 |
'color' => !empty( $frame['background_color'] ) ? $frame['background_color'] : false,
|
107 |
'image' => !empty( $background_image ) ? $background_image[0] : false,
|
108 |
'opacity' => 1,
|
109 |
-
'image-sizing' => '
|
110 |
'videos' => $frame['background_videos'],
|
111 |
'video-sizing' => empty($frame['foreground_image']) ? 'full' : 'background',
|
|
|
|
|
112 |
);
|
113 |
}
|
114 |
|
21 |
array(
|
22 |
|
23 |
),
|
24 |
+
false,
|
25 |
+
plugin_dir_path( __FILE__ )
|
26 |
+
);
|
27 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
+
function initialize_form(){
|
30 |
+
return array(
|
31 |
+
'frames' => array(
|
32 |
+
'type' => 'repeater',
|
33 |
+
'label' => __('Slider frames', 'so-widgets-bundle'),
|
34 |
+
'item_name' => __('Frame', 'so-widgets-bundle'),
|
35 |
+
'item_label' => array(
|
36 |
+
'selector' => "[id*='frames-url']",
|
37 |
+
'update_event' => 'change',
|
38 |
+
'value_method' => 'val'
|
39 |
+
),
|
40 |
+
'fields' => array(
|
41 |
+
'background_videos' => array(
|
42 |
+
'type' => 'repeater',
|
43 |
+
'item_name' => __('Video', 'so-widgets-bundle'),
|
44 |
+
'label' => __('Background videos', 'so-widgets-bundle'),
|
45 |
+
'item_label' => array(
|
46 |
+
'selector' => "[id*='frames-background_videos-url']",
|
47 |
+
'update_event' => 'change',
|
48 |
+
'value_method' => 'val'
|
49 |
),
|
50 |
+
'fields' => $this->video_form_fields(),
|
51 |
+
),
|
52 |
|
53 |
+
'background_image' => array(
|
54 |
+
'type' => 'media',
|
55 |
+
'library' => 'image',
|
56 |
+
'label' => __('Background image', 'so-widgets-bundle'),
|
57 |
+
'fallback' => true,
|
58 |
+
),
|
59 |
|
60 |
+
'background_color' => array(
|
61 |
+
'type' => 'color',
|
62 |
+
'label' => __('Background Color', 'so-widgets-bundle'),
|
63 |
+
),
|
|
|
|
|
|
|
|
|
|
|
64 |
|
65 |
+
'background_image_type' => array(
|
66 |
+
'type' => 'select',
|
67 |
+
'label' => __('Background image type', 'so-widgets-bundle'),
|
68 |
+
'options' => array(
|
69 |
+
'cover' => __('Cover', 'so-widgets-bundle'),
|
70 |
+
'tile' => __('Tile', 'so-widgets-bundle'),
|
71 |
),
|
72 |
+
'default' => 'cover',
|
73 |
+
),
|
74 |
|
75 |
+
'foreground_image' => array(
|
76 |
+
'type' => 'media',
|
77 |
+
'library' => 'image',
|
78 |
+
'label' => __('Foreground image', 'so-widgets-bundle'),
|
79 |
+
'fallback' => true,
|
80 |
+
),
|
81 |
|
82 |
+
'url' => array(
|
83 |
+
'type' => 'link',
|
84 |
+
'label' => __('Destination URL', 'so-widgets-bundle'),
|
85 |
+
),
|
86 |
+
|
87 |
+
'new_window' => array(
|
88 |
+
'type' => 'checkbox',
|
89 |
+
'label' => __('Open in new window', 'so-widgets-bundle'),
|
90 |
+
'default' => false,
|
91 |
),
|
92 |
),
|
|
|
|
|
|
|
|
|
|
|
93 |
),
|
94 |
+
'controls' => array(
|
95 |
+
'type' => 'section',
|
96 |
+
'label' => __('Controls', 'so-widgets-bundle'),
|
97 |
+
'fields' => $this->control_form_fields()
|
98 |
+
)
|
99 |
);
|
100 |
}
|
101 |
|
110 |
'color' => !empty( $frame['background_color'] ) ? $frame['background_color'] : false,
|
111 |
'image' => !empty( $background_image ) ? $background_image[0] : false,
|
112 |
'opacity' => 1,
|
113 |
+
'image-sizing' => $frame['background_image_type'],
|
114 |
'videos' => $frame['background_videos'],
|
115 |
'video-sizing' => empty($frame['foreground_image']) ? 'full' : 'background',
|
116 |
+
'url' => ! empty( $frame['url'] ) ? $frame['url'] : false,
|
117 |
+
'new_window' => ! empty( $frame['new_window'] ) ? $frame['new_window'] : false,
|
118 |
);
|
119 |
}
|
120 |
|
widgets/social-media-buttons/social-media-buttons.php
CHANGED
@@ -13,6 +13,19 @@ class SiteOrigin_Widget_SocialMediaButtons_Widget extends SiteOrigin_Widget {
|
|
13 |
private $networks;
|
14 |
|
15 |
function __construct() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
$this->networks = include plugin_dir_path( __FILE__ ) . 'data/networks.php';
|
18 |
|
@@ -21,126 +34,118 @@ class SiteOrigin_Widget_SocialMediaButtons_Widget extends SiteOrigin_Widget {
|
|
21 |
$network_names[ $key ] = $value['label'];
|
22 |
}
|
23 |
|
24 |
-
|
25 |
-
'
|
26 |
-
|
27 |
-
|
28 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
),
|
30 |
-
array(
|
31 |
-
|
32 |
-
'
|
33 |
-
|
34 |
-
|
35 |
-
'
|
36 |
-
|
37 |
-
'
|
38 |
-
'
|
39 |
-
'value_method' => 'text'
|
40 |
),
|
41 |
-
'
|
42 |
-
'
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
'
|
47 |
-
|
48 |
-
|
49 |
-
'type' => 'text',
|
50 |
-
'label' => __( 'URL', 'so-widgets-bundle' )
|
51 |
),
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
),
|
56 |
-
'
|
57 |
-
|
58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
)
|
60 |
-
)
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
'
|
69 |
-
'
|
70 |
-
'default' => true
|
71 |
-
),
|
72 |
-
'theme' => array(
|
73 |
-
'type' => 'select',
|
74 |
-
'label' => __( 'Button theme', 'so-widgets-bundle' ),
|
75 |
-
'default' => 'atom',
|
76 |
-
'options' => array(
|
77 |
-
'atom' => __( 'Atom', 'so-widgets-bundle' ),
|
78 |
-
'flat' => __( 'Flat', 'so-widgets-bundle' ),
|
79 |
-
'wire' => __( 'Wire', 'so-widgets-bundle' ),
|
80 |
-
),
|
81 |
-
),
|
82 |
-
'hover' => array(
|
83 |
-
'type' => 'checkbox',
|
84 |
-
'label' => __( 'Use hover effects', 'so-widgets-bundle' ),
|
85 |
-
'default' => true
|
86 |
-
),
|
87 |
-
'icon_size' => array(
|
88 |
-
'type' => 'select',
|
89 |
-
'label' => __( 'Icon size', 'so-widgets-bundle' ),
|
90 |
-
'options' => array(
|
91 |
-
'1' => __( 'Normal', 'so-widgets-bundle' ),
|
92 |
-
'1.33' => __( 'Medium', 'so-widgets-bundle' ),
|
93 |
-
'1.66' => __( 'Large', 'so-widgets-bundle' ),
|
94 |
-
'2' => __( 'Extra large', 'so-widgets-bundle' )
|
95 |
-
)
|
96 |
-
),
|
97 |
-
'rounding' => array(
|
98 |
-
'type' => 'select',
|
99 |
-
'label' => __( 'Rounding', 'so-widgets-bundle' ),
|
100 |
-
'default' => '0.25',
|
101 |
-
'options' => array(
|
102 |
-
'0' => __( 'None', 'so-widgets-bundle' ),
|
103 |
-
'0.25' => __( 'Slightly rounded', 'so-widgets-bundle' ),
|
104 |
-
'0.5' => __( 'Very rounded', 'so-widgets-bundle' ),
|
105 |
-
'1.5' => __( 'Completely rounded', 'so-widgets-bundle' ),
|
106 |
-
),
|
107 |
),
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
),
|
118 |
),
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
),
|
129 |
),
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
),
|
140 |
),
|
141 |
-
)
|
142 |
-
)
|
143 |
-
)
|
144 |
);
|
145 |
}
|
146 |
|
@@ -252,4 +257,4 @@ class SiteOrigin_Widget_SocialMediaButtons_Widget extends SiteOrigin_Widget {
|
|
252 |
}
|
253 |
}
|
254 |
|
255 |
-
siteorigin_widget_register( 'sow-social-media-buttons', __FILE__, 'SiteOrigin_Widget_SocialMediaButtons_Widget' );
|
13 |
private $networks;
|
14 |
|
15 |
function __construct() {
|
16 |
+
parent::__construct(
|
17 |
+
'sow-social-media-buttons',
|
18 |
+
__( 'SiteOrigin Social Media Buttons', 'so-widgets-bundle' ),
|
19 |
+
array(
|
20 |
+
'description' => __( 'A social media buttons widget.', 'so-widgets-bundle' )
|
21 |
+
),
|
22 |
+
array(),
|
23 |
+
false,
|
24 |
+
plugin_dir_path( __FILE__ )
|
25 |
+
);
|
26 |
+
}
|
27 |
+
|
28 |
+
function initialize_form(){
|
29 |
|
30 |
$this->networks = include plugin_dir_path( __FILE__ ) . 'data/networks.php';
|
31 |
|
34 |
$network_names[ $key ] = $value['label'];
|
35 |
}
|
36 |
|
37 |
+
return array(
|
38 |
+
'networks' => array(
|
39 |
+
'type' => 'repeater',
|
40 |
+
'label' => __( 'Networks', 'so-widgets-bundle' ),
|
41 |
+
'item_name' => __( 'Network', 'so-widgets-bundle' ),
|
42 |
+
'item_label' => array(
|
43 |
+
'selector' => "[id*='networks-name'] :selected",
|
44 |
+
'update_event' => 'change',
|
45 |
+
'value_method' => 'text'
|
46 |
+
),
|
47 |
+
'fields' => array(
|
48 |
+
'name' => array(
|
49 |
+
'type' => 'select',
|
50 |
+
'label' => '',
|
51 |
+
'prompt' => __( 'Select network', 'so-widgets-bundle' ),
|
52 |
+
'options' => $network_names
|
53 |
+
),
|
54 |
+
'url' => array(
|
55 |
+
'type' => 'text',
|
56 |
+
'label' => __( 'URL', 'so-widgets-bundle' )
|
57 |
+
),
|
58 |
+
'icon_color' => array(
|
59 |
+
'type' => 'color',
|
60 |
+
'label' => __( 'Icon color', 'so-widgets-bundle' )
|
61 |
+
),
|
62 |
+
'button_color' => array(
|
63 |
+
'type' => 'color',
|
64 |
+
'label' => __( 'Background color', 'so-widgets-bundle' )
|
65 |
+
)
|
66 |
+
)
|
67 |
),
|
68 |
+
'design' => array(
|
69 |
+
'type' => 'section',
|
70 |
+
'label' => __( 'Design and layout', 'so-widgets-bundle' ),
|
71 |
+
'hide' => true,
|
72 |
+
'fields' => array(
|
73 |
+
'new_window' => array(
|
74 |
+
'type' => 'checkbox',
|
75 |
+
'label' => __( 'Open in a new window', 'so-widgets-bundle' ),
|
76 |
+
'default' => true
|
|
|
77 |
),
|
78 |
+
'theme' => array(
|
79 |
+
'type' => 'select',
|
80 |
+
'label' => __( 'Button theme', 'so-widgets-bundle' ),
|
81 |
+
'default' => 'atom',
|
82 |
+
'options' => array(
|
83 |
+
'atom' => __( 'Atom', 'so-widgets-bundle' ),
|
84 |
+
'flat' => __( 'Flat', 'so-widgets-bundle' ),
|
85 |
+
'wire' => __( 'Wire', 'so-widgets-bundle' ),
|
|
|
|
|
86 |
),
|
87 |
+
),
|
88 |
+
'hover' => array(
|
89 |
+
'type' => 'checkbox',
|
90 |
+
'label' => __( 'Use hover effects', 'so-widgets-bundle' ),
|
91 |
+
'default' => true
|
92 |
+
),
|
93 |
+
'icon_size' => array(
|
94 |
+
'type' => 'select',
|
95 |
+
'label' => __( 'Icon size', 'so-widgets-bundle' ),
|
96 |
+
'options' => array(
|
97 |
+
'1' => __( 'Normal', 'so-widgets-bundle' ),
|
98 |
+
'1.33' => __( 'Medium', 'so-widgets-bundle' ),
|
99 |
+
'1.66' => __( 'Large', 'so-widgets-bundle' ),
|
100 |
+
'2' => __( 'Extra large', 'so-widgets-bundle' )
|
101 |
)
|
102 |
+
),
|
103 |
+
'rounding' => array(
|
104 |
+
'type' => 'select',
|
105 |
+
'label' => __( 'Rounding', 'so-widgets-bundle' ),
|
106 |
+
'default' => '0.25',
|
107 |
+
'options' => array(
|
108 |
+
'0' => __( 'None', 'so-widgets-bundle' ),
|
109 |
+
'0.25' => __( 'Slightly rounded', 'so-widgets-bundle' ),
|
110 |
+
'0.5' => __( 'Very rounded', 'so-widgets-bundle' ),
|
111 |
+
'1.5' => __( 'Completely rounded', 'so-widgets-bundle' ),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
),
|
113 |
+
),
|
114 |
+
'padding' => array(
|
115 |
+
'type' => 'select',
|
116 |
+
'label' => __( 'Padding', 'so-widgets-bundle' ),
|
117 |
+
'default' => '1',
|
118 |
+
'options' => array(
|
119 |
+
'0.5' => __( 'Low', 'so-widgets-bundle' ),
|
120 |
+
'1' => __( 'Medium', 'so-widgets-bundle' ),
|
121 |
+
'1.4' => __( 'High', 'so-widgets-bundle' ),
|
122 |
+
'1.8' => __( 'Very high', 'so-widgets-bundle' ),
|
123 |
),
|
124 |
+
),
|
125 |
+
'align' => array(
|
126 |
+
'type' => 'select',
|
127 |
+
'label' => __( 'Align', 'so-widgets-bundle' ),
|
128 |
+
'default' => 'left',
|
129 |
+
'options' => array(
|
130 |
+
'left' => __( 'Left', 'so-widgets-bundle' ),
|
131 |
+
'right' => __( 'Right', 'so-widgets-bundle' ),
|
132 |
+
'center' => __( 'Center', 'so-widgets-bundle' ),
|
133 |
+
'justify' => __( 'Justify', 'so-widgets-bundle' ),
|
134 |
),
|
135 |
+
),
|
136 |
+
'margin' => array(
|
137 |
+
'type' => 'select',
|
138 |
+
'label' => __( 'Margin', 'so-widgets-bundle' ),
|
139 |
+
'default' => '0.1',
|
140 |
+
'options' => array(
|
141 |
+
'0.1' => __( 'Low', 'so-widgets-bundle' ),
|
142 |
+
'0.2' => __( 'Medium', 'so-widgets-bundle' ),
|
143 |
+
'0.3' => __( 'High', 'so-widgets-bundle' ),
|
144 |
+
'0.4' => __( 'Very high', 'so-widgets-bundle' ),
|
145 |
),
|
146 |
+
),
|
147 |
+
)
|
148 |
+
),
|
149 |
);
|
150 |
}
|
151 |
|
257 |
}
|
258 |
}
|
259 |
|
260 |
+
siteorigin_widget_register( 'sow-social-media-buttons', __FILE__, 'SiteOrigin_Widget_SocialMediaButtons_Widget' );
|
widgets/testimonial/testimonial.php
CHANGED
@@ -19,238 +19,243 @@ class SiteOrigin_Widgets_Testimonials_Widget extends SiteOrigin_Widget {
|
|
19 |
array(
|
20 |
|
21 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
array(
|
23 |
-
'
|
24 |
-
|
25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
),
|
27 |
-
'
|
28 |
-
'
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
'selector' => "[id*='testimonials-name']",
|
33 |
-
'update_event' => 'change',
|
34 |
-
'value_method' => 'val'
|
35 |
),
|
36 |
-
'fields' => array(
|
37 |
-
'name' => array(
|
38 |
-
'type' => 'text',
|
39 |
-
'label' => __('Name', 'so-widgets-bundle'),
|
40 |
-
'description' => __('The author of the testimonial', 'so-widgets-bundle'),
|
41 |
-
),
|
42 |
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
)
|
120 |
)
|
121 |
-
)
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
)
|
142 |
)
|
143 |
-
|
144 |
)
|
145 |
-
),
|
146 |
-
)
|
147 |
-
),
|
148 |
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
'image' => array(
|
155 |
-
'type' => 'section',
|
156 |
-
'label' => __('Image', 'so-widgets-bundle'),
|
157 |
-
'fields' => array(
|
158 |
-
'image_shape' => array(
|
159 |
-
'type' => 'select',
|
160 |
-
'label' => __('Testimonial image shape', 'so-widgets-bundle'),
|
161 |
-
'options' => array(
|
162 |
-
'square' => __('Square', 'so-widgets-bundle'),
|
163 |
-
'round' => __('Round', 'so-widgets-bundle'),
|
164 |
-
),
|
165 |
-
'default' => 'square',
|
166 |
-
),
|
167 |
-
|
168 |
-
'image_size' => array(
|
169 |
-
'type' => 'slider',
|
170 |
-
'label' => __('Image size', 'so-widgets-bundle'),
|
171 |
-
'integer' => true,
|
172 |
-
'default' => 50,
|
173 |
-
'max' => 150,
|
174 |
-
'min' => 20,
|
175 |
-
),
|
176 |
-
),
|
177 |
-
),
|
178 |
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
'
|
194 |
-
'label' => __('Text Color', 'so-widgets-bundle'),
|
195 |
-
'default' => '#444444',
|
196 |
),
|
|
|
197 |
),
|
198 |
-
),
|
199 |
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
|
|
207 |
),
|
|
|
208 |
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
'
|
214 |
-
|
215 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
216 |
),
|
|
|
217 |
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
),
|
|
|
|
|
228 |
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
),
|
237 |
-
'default' => 'side',
|
238 |
),
|
|
|
239 |
),
|
240 |
),
|
241 |
-
)
|
242 |
);
|
243 |
}
|
244 |
|
245 |
-
function initialize(){
|
246 |
-
$this->register_frontend_styles( array(
|
247 |
-
array(
|
248 |
-
'sow-testimonial',
|
249 |
-
plugin_dir_url(__FILE__) . 'css/style.css'
|
250 |
-
)
|
251 |
-
) );
|
252 |
-
}
|
253 |
-
|
254 |
function caret_svg(){
|
255 |
static $done = false;
|
256 |
if( $done ) return;
|
19 |
array(
|
20 |
|
21 |
),
|
22 |
+
false,
|
23 |
+
plugin_dir_path( __FILE__ )
|
24 |
+
);
|
25 |
+
}
|
26 |
+
|
27 |
+
function initialize(){
|
28 |
+
$this->register_frontend_styles( array(
|
29 |
array(
|
30 |
+
'sow-testimonial',
|
31 |
+
plugin_dir_url(__FILE__) . 'css/style.css'
|
32 |
+
)
|
33 |
+
) );
|
34 |
+
}
|
35 |
+
|
36 |
+
function initialize_form(){
|
37 |
+
return array(
|
38 |
+
'title' => array(
|
39 |
+
'type' => 'text',
|
40 |
+
'label' => __('Title', 'so-widgets-bundle'),
|
41 |
+
),
|
42 |
+
'testimonials' => array(
|
43 |
+
'type' => 'repeater',
|
44 |
+
'label' => __( 'Testimonials', 'so-widgets-bundle' ),
|
45 |
+
'item_name' => __( 'Testimonial', 'so-widgets-bundle' ),
|
46 |
+
'item_label' => array(
|
47 |
+
'selector' => "[id*='testimonials-name']",
|
48 |
+
'update_event' => 'change',
|
49 |
+
'value_method' => 'val'
|
50 |
),
|
51 |
+
'fields' => array(
|
52 |
+
'name' => array(
|
53 |
+
'type' => 'text',
|
54 |
+
'label' => __('Name', 'so-widgets-bundle'),
|
55 |
+
'description' => __('The author of the testimonial', 'so-widgets-bundle'),
|
|
|
|
|
|
|
56 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
|
58 |
+
'link_name' => array(
|
59 |
+
'type' => 'checkbox',
|
60 |
+
'label' => __('Link name', 'so-widgets-bundle'),
|
61 |
+
),
|
62 |
|
63 |
+
'location' => array(
|
64 |
+
'type' => 'text',
|
65 |
+
'label' => __('Location', 'so-widgets-bundle'),
|
66 |
+
'description' => __('Their location or company name', 'so-widgets-bundle'),
|
67 |
+
),
|
68 |
|
69 |
+
'image' => array(
|
70 |
+
'type' => 'media',
|
71 |
+
'label' => __('Image', 'so-widgets-bundle'),
|
72 |
+
),
|
73 |
|
74 |
+
'link_image' => array(
|
75 |
+
'type' => 'checkbox',
|
76 |
+
'label' => __('Link image', 'so-widgets-bundle'),
|
77 |
+
),
|
78 |
|
79 |
+
'text' => array(
|
80 |
+
'type' => 'tinymce',
|
81 |
+
'label' => __('Text', 'so-widgets-bundle'),
|
82 |
+
'description' => __('What your customer had to say', 'so-widgets-bundle'),
|
83 |
+
),
|
84 |
|
85 |
+
'url' => array(
|
86 |
+
'type' => 'text',
|
87 |
+
'label' => __('URL', 'so-widgets-bundle'),
|
88 |
+
),
|
89 |
|
90 |
+
'new_window' => array(
|
91 |
+
'type' => 'checkbox',
|
92 |
+
'label' => __('Open In New Window', 'so-widgets-bundle'),
|
93 |
+
),
|
94 |
+
)
|
95 |
+
),
|
96 |
|
97 |
+
'settings' => array(
|
98 |
+
'type' => 'section',
|
99 |
+
'label' => __('Settings', 'so-widgets-bundle'),
|
100 |
+
'fields' => array(
|
101 |
+
|
102 |
+
'per_line' => array(
|
103 |
+
'type' => 'slider',
|
104 |
+
'label' => __( 'Testimonials per row', 'so-widgets-bundle' ),
|
105 |
+
'min' => 1,
|
106 |
+
'max' => 5,
|
107 |
+
'integer' => true,
|
108 |
+
'default' => 3
|
109 |
+
),
|
110 |
|
111 |
+
'responsive' => array(
|
112 |
+
'type' => 'section',
|
113 |
+
'label' => __('Responsive', 'so-widgets-bundle'),
|
114 |
+
'hide' => true,
|
115 |
+
'fields' => array(
|
116 |
+
'tablet' => array(
|
117 |
+
'type' => 'section',
|
118 |
+
'label' => __('Tablet', 'so-widgets-bundle'),
|
119 |
+
'fields' => array(
|
120 |
+
'per_line' => array(
|
121 |
+
'type' => 'slider',
|
122 |
+
'label' => __( 'Testimonials per row', 'so-widgets-bundle' ),
|
123 |
+
'min' => 1,
|
124 |
+
'max' => 5,
|
125 |
+
'integer' => true,
|
126 |
+
'default' => 2
|
127 |
+
),
|
128 |
+
'width' => array(
|
129 |
+
'type' => 'text',
|
130 |
+
'label' => __('Resolution', 'so-widgets-bundle'),
|
131 |
+
'description' => __('The resolution to treat as a tablet resolution.', 'so-widgets-bundle'),
|
132 |
+
'default' => 800,
|
133 |
+
'sanitize' => 'intval',
|
|
|
134 |
)
|
135 |
+
)
|
136 |
+
),
|
137 |
+
'mobile' => array(
|
138 |
+
'type' => 'section',
|
139 |
+
'label' => __('Mobile Phone', 'so-widgets-bundle'),
|
140 |
+
'fields' => array(
|
141 |
+
'per_line' => array(
|
142 |
+
'type' => 'slider',
|
143 |
+
'label' => __( 'Testimonials per row', 'so-widgets-bundle' ),
|
144 |
+
'min' => 1,
|
145 |
+
'max' => 5,
|
146 |
+
'integer' => true,
|
147 |
+
'default' => 1
|
148 |
+
),
|
149 |
+
'width' => array(
|
150 |
+
'type' => 'text',
|
151 |
+
'label' => __('Resolution', 'so-widgets-bundle'),
|
152 |
+
'description' => __('The resolution to treat as a tablet resolution.', 'so-widgets-bundle'),
|
153 |
+
'default' => 480,
|
154 |
+
'sanitize' => 'intval',
|
155 |
)
|
156 |
)
|
|
|
157 |
)
|
|
|
|
|
|
|
158 |
|
159 |
+
)
|
160 |
+
),
|
161 |
+
)
|
162 |
+
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
163 |
|
164 |
+
'design' => array(
|
165 |
+
'type' => 'section',
|
166 |
+
'label' => __('Design', 'so-widgets-bundle'),
|
167 |
+
'fields' => array(
|
168 |
+
|
169 |
+
'image' => array(
|
170 |
+
'type' => 'section',
|
171 |
+
'label' => __('Image', 'so-widgets-bundle'),
|
172 |
+
'fields' => array(
|
173 |
+
'image_shape' => array(
|
174 |
+
'type' => 'select',
|
175 |
+
'label' => __('Testimonial image shape', 'so-widgets-bundle'),
|
176 |
+
'options' => array(
|
177 |
+
'square' => __('Square', 'so-widgets-bundle'),
|
178 |
+
'round' => __('Round', 'so-widgets-bundle'),
|
|
|
|
|
179 |
),
|
180 |
+
'default' => 'square',
|
181 |
),
|
|
|
182 |
|
183 |
+
'image_size' => array(
|
184 |
+
'type' => 'slider',
|
185 |
+
'label' => __('Image size', 'so-widgets-bundle'),
|
186 |
+
'integer' => true,
|
187 |
+
'default' => 50,
|
188 |
+
'max' => 150,
|
189 |
+
'min' => 20,
|
190 |
+
),
|
191 |
),
|
192 |
+
),
|
193 |
|
194 |
+
'colors' => array(
|
195 |
+
'type' => 'section',
|
196 |
+
'label' => __('Colors', 'so-widgets-bundle'),
|
197 |
+
'fields' => array(
|
198 |
+
'testimonial_background' => array(
|
199 |
+
'type' => 'color',
|
200 |
+
'label' => __('Widget Background', 'so-widgets-bundle'),
|
201 |
+
),
|
202 |
+
'text_background' => array(
|
203 |
+
'type' => 'color',
|
204 |
+
'label' => __('Text Background', 'so-widgets-bundle'),
|
205 |
+
'default' => '#f0f0f0',
|
206 |
+
),
|
207 |
+
'text_color' => array(
|
208 |
+
'type' => 'color',
|
209 |
+
'label' => __('Text Color', 'so-widgets-bundle'),
|
210 |
+
'default' => '#444444',
|
211 |
+
),
|
212 |
),
|
213 |
+
),
|
214 |
|
215 |
+
'padding' => array(
|
216 |
+
'type' => 'slider',
|
217 |
+
'label' => __('Padding', 'so-widgets-bundle'),
|
218 |
+
'integer' => true,
|
219 |
+
'default' => 10,
|
220 |
+
'max' => 100,
|
221 |
+
'min' => 0,
|
222 |
+
),
|
223 |
+
|
224 |
+
'border_radius' => array(
|
225 |
+
'type' => 'slider',
|
226 |
+
'label' => __('Padding', 'so-widgets-bundle'),
|
227 |
+
'integer' => true,
|
228 |
+
'default' => 4,
|
229 |
+
'max' => 100,
|
230 |
+
'min' => 0,
|
231 |
+
),
|
232 |
+
|
233 |
+
'user_position' => array(
|
234 |
+
'type' => 'select',
|
235 |
+
'label' => __('User position', 'so-widgets-bundle'),
|
236 |
+
'options' => array(
|
237 |
+
'left' => __('Left', 'so-widgets-bundle'),
|
238 |
+
'right' => __('Right', 'so-widgets-bundle'),
|
239 |
+
'middle' => __('Middle', 'so-widgets-bundle'),
|
240 |
),
|
241 |
+
'default' => 'left',
|
242 |
+
),
|
243 |
|
244 |
+
'layout' => array(
|
245 |
+
'type' => 'select',
|
246 |
+
'label' => __('Testimonial layout', 'so-widgets-bundle'),
|
247 |
+
'options' => array(
|
248 |
+
'side' => __('Side by side', 'so-widgets-bundle'),
|
249 |
+
'text_above' => __('Text above user', 'so-widgets-bundle'),
|
250 |
+
'text_below' => __('Text below user', 'so-widgets-bundle'),
|
|
|
|
|
251 |
),
|
252 |
+
'default' => 'side',
|
253 |
),
|
254 |
),
|
255 |
+
),
|
256 |
);
|
257 |
}
|
258 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
259 |
function caret_svg(){
|
260 |
static $done = false;
|
261 |
if( $done ) return;
|
widgets/testimonial/tpl/default.php
CHANGED
@@ -5,6 +5,7 @@
|
|
5 |
* @var $testimonials
|
6 |
*/
|
7 |
?>
|
|
|
8 |
<?php $this->caret_svg() ?>
|
9 |
<div class="sow-testimonials">
|
10 |
<?php foreach( $testimonials as $testimonial ) : ?>
|
5 |
* @var $testimonials
|
6 |
*/
|
7 |
?>
|
8 |
+
<?php if( !empty( $instance['title'] ) ) echo $args['before_title'] . esc_html($instance['title']) . $args['after_title'] ?>
|
9 |
<?php $this->caret_svg() ?>
|
10 |
<div class="sow-testimonials">
|
11 |
<?php foreach( $testimonials as $testimonial ) : ?>
|
widgets/video/video.php
CHANGED
@@ -19,87 +19,92 @@ class SiteOrigin_Widget_Video_Widget extends SiteOrigin_Widget {
|
|
19 |
'help' => 'http://siteorigin.com/widgets-bundle/video-widget-documentation/'
|
20 |
),
|
21 |
array(),
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
),
|
27 |
-
'host_type' => array(
|
28 |
-
'type' => 'radio',
|
29 |
-
'label' => __( 'Video location', 'so-widgets-bundle' ),
|
30 |
-
'default' => 'self',
|
31 |
-
'options' => array(
|
32 |
-
'self' => __( 'Self hosted', 'so-widgets-bundle' ),
|
33 |
-
'external' => __( 'Externally hosted', 'so-widgets-bundle' ),
|
34 |
-
),
|
35 |
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
),
|
42 |
|
43 |
-
|
44 |
-
|
45 |
-
'
|
46 |
-
'
|
47 |
-
|
48 |
-
|
49 |
-
'fallback' => true,
|
50 |
-
'label' => __( 'Select video', 'so-widgets-bundle' ),
|
51 |
-
'description' => __( 'Select an uploaded video in mp4 format. Other formats, such as webm and ogv will work in some browsers. You can use an online service such as <a href="http://video.online-convert.com/convert-to-mp4" target="_blank">online-convert.com</a> to convert your videos to mp4.', 'so-widgets-bundle' ),
|
52 |
-
'default' => '',
|
53 |
-
'library' => 'video',
|
54 |
-
'state_handler' => array(
|
55 |
-
'video_type[self]' => array('show'),
|
56 |
-
'video_type[external]' => array('hide'),
|
57 |
-
)
|
58 |
-
),
|
59 |
-
'self_poster' => array(
|
60 |
-
'type' => 'media',
|
61 |
-
'label' => __( 'Select cover image', 'so-widgets-bundle' ),
|
62 |
-
'default' => '',
|
63 |
-
'library' => 'image',
|
64 |
-
'state_handler' => array(
|
65 |
-
'video_type[self]' => array('show'),
|
66 |
-
'video_type[external]' => array('hide'),
|
67 |
-
)
|
68 |
-
),
|
69 |
-
'external_video' => array(
|
70 |
-
'type' => 'text',
|
71 |
-
'sanitize' => 'url',
|
72 |
-
'label' => __( 'Video URL', 'so-widgets-bundle' ),
|
73 |
-
'state_handler' => array(
|
74 |
-
'video_type[external]' => array('show'),
|
75 |
-
'video_type[self]' => array('hide'),
|
76 |
-
)
|
77 |
-
),
|
78 |
-
)
|
79 |
-
),
|
80 |
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
),
|
90 |
-
'
|
91 |
-
|
92 |
-
|
93 |
-
'
|
94 |
-
'
|
95 |
-
'state_handler' => array(
|
96 |
-
'video_type[external]' => array('show'),
|
97 |
-
'video_type[self]' => array('hide'),
|
98 |
-
)
|
99 |
)
|
100 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
),
|
102 |
-
)
|
103 |
);
|
104 |
}
|
105 |
|
@@ -257,4 +262,4 @@ class SiteOrigin_Widget_Video_Widget extends SiteOrigin_Widget {
|
|
257 |
return $video_host == 'self' || ( ($video_host == 'youtube' || $video_host == 'vimeo') && $wp_version >= 4.2 );
|
258 |
}
|
259 |
}
|
260 |
-
siteorigin_widget_register( 'video', __FILE__, 'SiteOrigin_Widget_Video_Widget' );
|
19 |
'help' => 'http://siteorigin.com/widgets-bundle/video-widget-documentation/'
|
20 |
),
|
21 |
array(),
|
22 |
+
false,
|
23 |
+
plugin_dir_path( __FILE__ )
|
24 |
+
);
|
25 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
+
function initialize_form(){
|
28 |
+
return array(
|
29 |
+
'title' => array(
|
30 |
+
'type' => 'text',
|
31 |
+
'label' => __( 'Title', 'so-widgets-bundle' )
|
32 |
+
),
|
33 |
+
'host_type' => array(
|
34 |
+
'type' => 'radio',
|
35 |
+
'label' => __( 'Video location', 'so-widgets-bundle' ),
|
36 |
+
'default' => 'self',
|
37 |
+
'options' => array(
|
38 |
+
'self' => __( 'Self hosted', 'so-widgets-bundle' ),
|
39 |
+
'external' => __( 'Externally hosted', 'so-widgets-bundle' ),
|
40 |
),
|
41 |
|
42 |
+
// This field should be a video type state emitter
|
43 |
+
'state_emitter' => array(
|
44 |
+
'callback' => 'select',
|
45 |
+
'args' => array('video_type')
|
46 |
+
)
|
47 |
+
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
|
49 |
+
'video' => array(
|
50 |
+
'type' => 'section',
|
51 |
+
'label' => __( 'Video File', 'so-widgets-bundle' ),
|
52 |
+
'fields' => array(
|
53 |
+
'self_video' => array(
|
54 |
+
'type' => 'media',
|
55 |
+
'fallback' => true,
|
56 |
+
'label' => __( 'Select video', 'so-widgets-bundle' ),
|
57 |
+
'description' => __( 'Select an uploaded video in mp4 format. Other formats, such as webm and ogv will work in some browsers. You can use an online service such as <a href="http://video.online-convert.com/convert-to-mp4" target="_blank">online-convert.com</a> to convert your videos to mp4.', 'so-widgets-bundle' ),
|
58 |
+
'default' => '',
|
59 |
+
'library' => 'video',
|
60 |
+
'state_handler' => array(
|
61 |
+
'video_type[self]' => array('show'),
|
62 |
+
'video_type[external]' => array('hide'),
|
|
|
|
|
|
|
|
|
63 |
)
|
64 |
),
|
65 |
+
'self_poster' => array(
|
66 |
+
'type' => 'media',
|
67 |
+
'label' => __( 'Select cover image', 'so-widgets-bundle' ),
|
68 |
+
'default' => '',
|
69 |
+
'library' => 'image',
|
70 |
+
'state_handler' => array(
|
71 |
+
'video_type[self]' => array('show'),
|
72 |
+
'video_type[external]' => array('hide'),
|
73 |
+
)
|
74 |
+
),
|
75 |
+
'external_video' => array(
|
76 |
+
'type' => 'text',
|
77 |
+
'sanitize' => 'url',
|
78 |
+
'label' => __( 'Video URL', 'so-widgets-bundle' ),
|
79 |
+
'state_handler' => array(
|
80 |
+
'video_type[external]' => array('show'),
|
81 |
+
'video_type[self]' => array('hide'),
|
82 |
+
)
|
83 |
+
),
|
84 |
+
)
|
85 |
+
),
|
86 |
+
|
87 |
+
'playback' => array(
|
88 |
+
'type' => 'section',
|
89 |
+
'label' => __('Video Playback', 'so-widgets-bundle'),
|
90 |
+
'fields' => array(
|
91 |
+
'autoplay' => array(
|
92 |
+
'type' => 'checkbox',
|
93 |
+
'default' => false,
|
94 |
+
'label' => __( 'Autoplay', 'so-widgets-bundle' )
|
95 |
+
),
|
96 |
+
'oembed' => array(
|
97 |
+
'type' => 'checkbox',
|
98 |
+
'default' => true,
|
99 |
+
'label' => __( 'Use oEmbed', 'so-widgets-bundle' ),
|
100 |
+
'description' => __( 'Always use the embedded video rather than the MediaElement player.', 'so-widgets-bundle' ),
|
101 |
+
'state_handler' => array(
|
102 |
+
'video_type[external]' => array('show'),
|
103 |
+
'video_type[self]' => array('hide'),
|
104 |
+
)
|
105 |
+
)
|
106 |
),
|
107 |
+
),
|
108 |
);
|
109 |
}
|
110 |
|
262 |
return $video_host == 'self' || ( ($video_host == 'youtube' || $video_host == 'vimeo') && $wp_version >= 4.2 );
|
263 |
}
|
264 |
}
|
265 |
+
siteorigin_widget_register( 'video', __FILE__, 'SiteOrigin_Widget_Video_Widget' );
|