SiteOrigin Widgets Bundle - Version 1.45.0

Version Description

  • 07 December 2022 =
  • Call To Action: Added Mobile Button Align setting.
  • PHP 8.1: Resolved form field deprecated notices.
  • Developer: Removed edit-widgets validation support.
  • Developer: Added min/max for number form field.
Download this release

Release Info

Developer SiteOrigin
Plugin Icon 128x128 SiteOrigin Widgets Bundle
Version 1.45.0
Comparing to
See all releases

Code changes from version 1.44.2 to 1.45.0

base/inc/fields/date-range.class.php CHANGED
@@ -36,10 +36,12 @@ class SiteOrigin_Widget_Field_Date_Range extends SiteOrigin_Widget_Field_Base {
36
  }
37
 
38
  private function render_relative_date_selector( $value ) {
39
- $value = json_decode(
40
- $value,
41
- true
42
- );
 
 
43
 
44
  $from = ! empty( $value['from'] ) ? $value['from'] : array();
45
  $this->render_relative_date_selector_part( 'from', __( 'From', 'so-widgets-bundle' ), $from );
36
  }
37
 
38
  private function render_relative_date_selector( $value ) {
39
+ if ( ! empty( $value ) ) {
40
+ $value = json_decode(
41
+ $value,
42
+ true
43
+ );
44
+ }
45
 
46
  $from = ! empty( $value['from'] ) ? $value['from'] : array();
47
  $this->render_relative_date_selector_part( 'from', __( 'From', 'so-widgets-bundle' ), $from );
base/inc/fields/measurement.class.php CHANGED
@@ -34,11 +34,13 @@ class SiteOrigin_Widget_Field_Measurement extends SiteOrigin_Widget_Field_Text_I
34
  * @return array
35
  */
36
  protected function get_render_values( $value ) {
37
- preg_match('/(\d+\.?\d*)([a-z%]+)*/', $value, $matches);
38
- $num_matches = count( $matches );
 
 
39
  $val = array();
40
- $val['value'] = $num_matches > 1 ? $matches[1] : null;
41
- $val['unit'] = $num_matches > 2 ? $matches[2] : null;
42
  return $val;
43
  }
44
 
34
  * @return array
35
  */
36
  protected function get_render_values( $value ) {
37
+ if ( ! empty( $value ) ) {
38
+ preg_match('/(\d+\.?\d*)([a-z%]+)*/', $value, $matches);
39
+ $num_matches = count( $matches );
40
+ }
41
  $val = array();
42
+ $val['value'] = ! empty( $num_matches ) && $num_matches > 1 ? $matches[1] : null;
43
+ $val['unit'] = ! empty( $num_matches ) && $num_matches > 2 ? $matches[2] : null;
44
  return $val;
45
  }
46
 
base/inc/fields/number.class.php CHANGED
@@ -5,12 +5,29 @@
5
  */
6
  class SiteOrigin_Widget_Field_Number extends SiteOrigin_Widget_Field_Text_Input_Base {
7
 
 
8
  /**
9
  * The minimum value of the allowed range.
10
  *
11
  * @access protected
12
  * @var float
13
  */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  protected $step;
15
 
16
  /**
@@ -28,13 +45,12 @@ class SiteOrigin_Widget_Field_Number extends SiteOrigin_Widget_Field_Text_Input_
28
  }
29
 
30
  protected function get_input_attributes() {
31
- if ( empty( $this->step ) ) {
32
- return array();
33
- }
34
-
35
- return array(
36
  'step' => $this->step,
 
 
37
  );
 
38
  }
39
 
40
  protected function get_input_classes() {
@@ -44,10 +60,22 @@ class SiteOrigin_Widget_Field_Number extends SiteOrigin_Widget_Field_Text_Input_
44
  }
45
 
46
  protected function sanitize_field_input( $value, $instance ) {
47
- if ( ! empty( $value ) ) {
48
- return ( float ) ( ! empty( $this->abs ) ? abs( $value ) : $value );
49
- } else {
50
  return false;
51
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  }
53
  }
5
  */
6
  class SiteOrigin_Widget_Field_Number extends SiteOrigin_Widget_Field_Text_Input_Base {
7
 
8
+
9
  /**
10
  * The minimum value of the allowed range.
11
  *
12
  * @access protected
13
  * @var float
14
  */
15
+ protected $min;
16
+
17
+ /**
18
+ * The maximum value of the allowed range.
19
+ *
20
+ * @access protected
21
+ * @var float
22
+ */
23
+ protected $max;
24
+
25
+ /**
26
+ * The step size when moving in the range.
27
+ *
28
+ * @access protected
29
+ * @var float
30
+ */
31
  protected $step;
32
 
33
  /**
45
  }
46
 
47
  protected function get_input_attributes() {
48
+ $input_attributes = array(
 
 
 
 
49
  'step' => $this->step,
50
+ 'min' => $this->min,
51
+ 'max' => $this->max,
52
  );
53
+ return array_filter( $input_attributes );
54
  }
55
 
56
  protected function get_input_classes() {
60
  }
61
 
62
  protected function sanitize_field_input( $value, $instance ) {
63
+
64
+ if ( empty( $value ) ) {
 
65
  return false;
66
  }
67
+
68
+ if ( ! empty( $this->min ) ) {
69
+ $value = max( $value, $this->min );
70
+ }
71
+
72
+ if ( ! empty( $this->max ) ) {
73
+ $value = min( $value, $this->max );
74
+ }
75
+
76
+ if ( ! empty( $this->abs ) ) {
77
+ $value = abs( $value );
78
+ }
79
+ return (float) $value;
80
  }
81
  }
base/inc/fields/text-input-base.class.php CHANGED
@@ -62,7 +62,7 @@ abstract class SiteOrigin_Widget_Field_Text_Input_Base extends SiteOrigin_Widget
62
  protected function render_data_attributes( $data_attributes ) {
63
  $attr_string = '';
64
  foreach ( $data_attributes as $name => $value ) {
65
- $attr_string = ' data-' . esc_html( $name ) . '="' . esc_attr( $value ) . '"';
66
  }
67
  echo $attr_string;
68
  }
@@ -71,7 +71,7 @@ abstract class SiteOrigin_Widget_Field_Text_Input_Base extends SiteOrigin_Widget
71
  protected function render_attributes( $attributes ) {
72
  $attr_string = '';
73
  foreach ( $attributes as $name => $value ) {
74
- $attr_string = esc_html( $name ) . '="' . esc_attr( $value ) . '"';
75
  }
76
  echo $attr_string;
77
  }
62
  protected function render_data_attributes( $data_attributes ) {
63
  $attr_string = '';
64
  foreach ( $data_attributes as $name => $value ) {
65
+ $attr_string .= ' data-' . esc_html( $name ) . '="' . esc_attr( $value ) . '"';
66
  }
67
  echo $attr_string;
68
  }
71
  protected function render_attributes( $attributes ) {
72
  $attr_string = '';
73
  foreach ( $attributes as $name => $value ) {
74
+ $attr_string .= ' ' . esc_html( $name ) . '="' . esc_attr( $value ) . '"';
75
  }
76
  echo $attr_string;
77
  }
base/inc/fields/tinymce.class.php CHANGED
@@ -250,14 +250,14 @@ class SiteOrigin_Widget_Field_TinyMCE extends SiteOrigin_Widget_Field_Text_Input
250
 
251
  function add_wpc_shortcodes_plugin( $plugins ) {
252
  if( ! isset( $plugins['wpc_shortcodes'] ) ) {
253
- $shortcodes_path = 'wc-shortcodes/includes/mce/js/shortcodes-tinymce-4.js';
254
  if ( file_exists( WP_PLUGIN_DIR . '/' . $shortcodes_path ) ) {
255
  $plugins['wpc_shortcodes'] = plugins_url( $shortcodes_path . '?ver=' . WC_SHORTCODES_VERSION );
256
  }
257
  }
258
 
259
  if( ! isset( $plugins['wpc_font_awesome'] ) ) {
260
- $fontawesome_path = 'wc-shortcodes/includes/mce/js/font-awesome-tinymce-4.js';
261
  if ( file_exists( WP_PLUGIN_DIR . '/' . $fontawesome_path ) ) {
262
  $plugins['wpc_font_awesome'] = plugins_url( $fontawesome_path . '?ver=' . WC_SHORTCODES_VERSION );
263
  }
@@ -351,9 +351,9 @@ class SiteOrigin_Widget_Field_TinyMCE extends SiteOrigin_Widget_Field_Text_Input
351
 
352
  $tmce_settings = array(
353
  'toolbar1' => apply_filters( 'mce_buttons', $this->mce_buttons, $this->element_id ),
354
- 'toolbar2' => apply_filters( 'mce_buttons_2', $this->mce_buttons_2, $this->element_id ),
355
- 'toolbar3' => apply_filters( 'mce_buttons_3',$this->mce_buttons_3, $this->element_id ),
356
- 'toolbar4' => apply_filters( 'mce_buttons_4',$this->mce_buttons_4, $this->element_id ),
357
  'plugins' => ! empty( $tiny_mce_plugins ) && is_array( $tiny_mce_plugins ) ? array_unique( $tiny_mce_plugins ) : array(),
358
  );
359
 
@@ -398,7 +398,7 @@ class SiteOrigin_Widget_Field_TinyMCE extends SiteOrigin_Widget_Field_Text_Input
398
  unset( $jdec );
399
  if ( ! empty( $tmce_settings[ $name ] ) ) {
400
  // Attempt to decode setting as JSON. For back compat with filters used by WP editor.
401
- if ( is_string( $setting ) ) {
402
  $jdec = json_decode( $setting, true );
403
  }
404
  $settings['tinymce'][ $name ] = empty( $jdec ) ? $setting : $jdec;
@@ -425,7 +425,7 @@ class SiteOrigin_Widget_Field_TinyMCE extends SiteOrigin_Widget_Field_Text_Input
425
 
426
  $value = apply_filters( 'the_editor_content', $value, $this->selected_editor );
427
 
428
- if ( false !== stripos( $value, 'textarea' ) ) {
429
  $value = preg_replace( '%</textarea%i', '&lt;/textarea', $value );
430
  }
431
 
@@ -436,27 +436,33 @@ class SiteOrigin_Widget_Field_TinyMCE extends SiteOrigin_Widget_Field_Text_Input
436
  $settings['baseURL'] = includes_url( 'js/tinymce' );
437
  $settings['suffix'] = SCRIPT_DEBUG ? '' : '.min';
438
 
439
- ?><div class="siteorigin-widget-tinymce-container"
 
 
440
  <?php if ( $this->media_buttons && ! empty( $media_buttons_html ) ) : ?>
441
- data-media-buttons="<?php echo esc_attr( json_encode( array( 'html' => $media_buttons_html ) ) ) ?>"
442
  <?php endif; ?>
443
- data-editor-settings="<?php echo esc_attr( json_encode( $settings ) ) ?>">
444
- <textarea id="<?php echo esc_attr( $this->element_id ) ?>"
445
- name="<?php echo esc_attr( $this->element_name ) ?>"
 
 
446
  <?php if ( isset( $this->editor_height ) ) : ?>
447
  style="height: <?php echo (int) $this->editor_height; ?>px"
448
  <?php else : ?>
449
- rows="<?php echo esc_attr( $this->rows ) ?>"
450
  <?php endif; ?>
451
- <?php $this->render_data_attributes( $this->get_input_data_attributes() ) ?>
452
- <?php $this->render_CSS_classes( $this->get_input_classes() ) ?>
453
- <?php if ( ! empty( $this->placeholder ) ) echo 'placeholder="' . esc_attr( $this->placeholder ) . '"' ?>
454
- <?php if( ! empty( $this->readonly ) ) echo 'readonly' ?>><?php echo htmlentities( $value, ENT_QUOTES, 'UTF-8' ) ?></textarea>
455
  </div>
456
- <input type="hidden"
457
- name="<?php echo esc_attr( $this->for_widget->so_get_field_name( $this->base_name . '_selected_editor', $this->parent_container) ) ?>"
458
- class="siteorigin-widget-input siteorigin-widget-tinymce-selected-editor"
459
- value="<?php echo esc_attr( $this->selected_editor ) ?>"/>
 
 
460
  <?php
461
 
462
  }
@@ -477,19 +483,22 @@ class SiteOrigin_Widget_Field_TinyMCE extends SiteOrigin_Widget_Field_Text_Input
477
  preg_match( '/widget-(.+?)\[/', $this->element_name, $id_base_matches );
478
  $widget_id_base = empty($id_base_matches) || count($id_base_matches) < 2 ? '' : $id_base_matches[1];
479
  ?>
480
- <div class="siteorigin-widget-tinymce-container"
481
- data-mce-settings="<?php echo esc_attr( json_encode( $settings['tinymce'] ) ) ?>"
482
- data-qt-settings="<?php echo esc_attr( json_encode( array() ) ) ?>"
483
- data-widget-id-base="<?php echo esc_attr( $widget_id_base ) ?>"
 
484
  >
485
  <?php
486
- wp_editor( $value, esc_attr( $this->element_id ), $settings )
487
  ?>
488
  </div>
489
- <input type="hidden"
490
- name="<?php echo esc_attr( $this->for_widget->so_get_field_name( $this->base_name . '_selected_editor', $this->parent_container) ) ?>"
491
- class="siteorigin-widget-input siteorigin-widget-tinymce-selected-editor"
492
- value="<?php echo esc_attr( $this->selected_editor ) ?>"/>
 
 
493
  <?php
494
 
495
  if( $this->selected_editor == 'html' ) {
250
 
251
  function add_wpc_shortcodes_plugin( $plugins ) {
252
  if( ! isset( $plugins['wpc_shortcodes'] ) ) {
253
+ $shortcodes_path = 'wc-shortcodes/includes/mce/js/shortcodes-tinymce-4.js';
254
  if ( file_exists( WP_PLUGIN_DIR . '/' . $shortcodes_path ) ) {
255
  $plugins['wpc_shortcodes'] = plugins_url( $shortcodes_path . '?ver=' . WC_SHORTCODES_VERSION );
256
  }
257
  }
258
 
259
  if( ! isset( $plugins['wpc_font_awesome'] ) ) {
260
+ $fontawesome_path = 'wc-shortcodes/includes/mce/js/font-awesome-tinymce-4.js';
261
  if ( file_exists( WP_PLUGIN_DIR . '/' . $fontawesome_path ) ) {
262
  $plugins['wpc_font_awesome'] = plugins_url( $fontawesome_path . '?ver=' . WC_SHORTCODES_VERSION );
263
  }
351
 
352
  $tmce_settings = array(
353
  'toolbar1' => apply_filters( 'mce_buttons', $this->mce_buttons, $this->element_id ),
354
+ 'toolbar2' => apply_filters( 'mce_buttons_2', $this->mce_buttons_2, $this->element_id ),
355
+ 'toolbar3' => apply_filters( 'mce_buttons_3', $this->mce_buttons_3, $this->element_id ),
356
+ 'toolbar4' => apply_filters( 'mce_buttons_4', $this->mce_buttons_4, $this->element_id ),
357
  'plugins' => ! empty( $tiny_mce_plugins ) && is_array( $tiny_mce_plugins ) ? array_unique( $tiny_mce_plugins ) : array(),
358
  );
359
 
398
  unset( $jdec );
399
  if ( ! empty( $tmce_settings[ $name ] ) ) {
400
  // Attempt to decode setting as JSON. For back compat with filters used by WP editor.
401
+ if ( is_string( $setting ) ) {
402
  $jdec = json_decode( $setting, true );
403
  }
404
  $settings['tinymce'][ $name ] = empty( $jdec ) ? $setting : $jdec;
425
 
426
  $value = apply_filters( 'the_editor_content', $value, $this->selected_editor );
427
 
428
+ if ( ! empty( $value ) && stripos( $value, 'textarea' ) !== false ) {
429
  $value = preg_replace( '%</textarea%i', '&lt;/textarea', $value );
430
  }
431
 
436
  $settings['baseURL'] = includes_url( 'js/tinymce' );
437
  $settings['suffix'] = SCRIPT_DEBUG ? '' : '.min';
438
 
439
+ ?>
440
+ <div
441
+ class="siteorigin-widget-tinymce-container"
442
  <?php if ( $this->media_buttons && ! empty( $media_buttons_html ) ) : ?>
443
+ data-media-buttons="<?php echo esc_attr( json_encode( array( 'html' => $media_buttons_html ) ) ); ?>"
444
  <?php endif; ?>
445
+ data-editor-settings="<?php echo esc_attr( json_encode( $settings ) ); ?>"
446
+ >
447
+ <textarea
448
+ id="<?php echo esc_attr( $this->element_id ); ?>"
449
+ name="<?php echo esc_attr( $this->element_name ); ?>"
450
  <?php if ( isset( $this->editor_height ) ) : ?>
451
  style="height: <?php echo (int) $this->editor_height; ?>px"
452
  <?php else : ?>
453
+ rows="<?php echo esc_attr( $this->rows ); ?>"
454
  <?php endif; ?>
455
+ <?php $this->render_data_attributes( $this->get_input_data_attributes() ); ?>
456
+ <?php $this->render_CSS_classes( $this->get_input_classes() ); ?>
457
+ <?php if ( ! empty( $this->placeholder ) ) echo 'placeholder="' . esc_attr( $this->placeholder ) . '"'; ?>
458
+ <?php if( ! empty( $this->readonly ) ) echo 'readonly' ?>><?php echo ! empty( $value ) ? htmlentities( $value, ENT_QUOTES, 'UTF-8' ) : ''; ?></textarea>
459
  </div>
460
+ <input
461
+ type="hidden"
462
+ name="<?php echo esc_attr( $this->for_widget->so_get_field_name( $this->base_name . '_selected_editor', $this->parent_container ) ); ?>"
463
+ class="siteorigin-widget-input siteorigin-widget-tinymce-selected-editor"
464
+ value="<?php echo esc_attr( $this->selected_editor ); ?>"
465
+ />
466
  <?php
467
 
468
  }
483
  preg_match( '/widget-(.+?)\[/', $this->element_name, $id_base_matches );
484
  $widget_id_base = empty($id_base_matches) || count($id_base_matches) < 2 ? '' : $id_base_matches[1];
485
  ?>
486
+ <div
487
+ class="siteorigin-widget-tinymce-container"
488
+ data-mce-settings="<?php echo esc_attr( json_encode( $settings['tinymce'] ) ); ?>"
489
+ data-qt-settings="<?php echo esc_attr( json_encode( array() ) ); ?>"
490
+ data-widget-id-base="<?php echo esc_attr( $widget_id_base ); ?>"
491
  >
492
  <?php
493
+ wp_editor( $value, esc_attr( $this->element_id ), $settings );
494
  ?>
495
  </div>
496
+ <input
497
+ type="hidden"
498
+ name="<?php echo esc_attr( $this->for_widget->so_get_field_name( $this->base_name . '_selected_editor', $this->parent_container ) ); ?>"
499
+ class="siteorigin-widget-input siteorigin-widget-tinymce-selected-editor"
500
+ value="<?php echo esc_attr( $this->selected_editor ) ?>"
501
+ />
502
  <?php
503
 
504
  if( $this->selected_editor == 'html' ) {
compat/block-editor/widget-block.js CHANGED
@@ -8,7 +8,7 @@
8
  var Toolbar = components.Toolbar;
9
  var ToolbarButton = components.ToolbarButton;
10
  var Placeholder = components.Placeholder;
11
- var Spinner = components.Spinner;
12
  var __ = i18n.__;
13
 
14
  var getAjaxErrorMsg = function( response ) {
@@ -332,72 +332,38 @@
332
 
333
  // Setup SiteOrigin Widgets Block Validation.
334
  var sowbTimeoutSetup = false;
335
- if ( typeof wp.data.select == 'function' ) {
336
- wp.data.subscribe( function () {
337
- if ( ! sowbTimeoutSetup ) {
338
- var setupTimer = false;
 
 
 
 
 
339
 
340
- if ( typeof wp.data.select( 'core/edit-widgets' ) == 'object' ) {
341
- // New Widget Area.
342
- if ( wp.data.select( 'core/edit-widgets' ).isSavingWidgetAreas() ) {
343
- setupTimer = true;
344
- }
345
- } else if (
346
- typeof wp.data.select( 'core/editor' ) == 'object' &&
347
- wp.data.select( 'core/editor' ).isSavingPost()
348
- ) {
349
- // Block Editor.
350
- setupTimer = true;
351
- }
352
-
353
- if ( setupTimer ) {
354
- sowbTimeoutSetup = true;
355
- var saveCheck = setInterval( function() {
356
- var checkPass = false;
357
- if ( typeof wp.data.select( 'core/edit-widgets' ) == 'object' ) {
358
- if ( ! wp.data.select( 'core/edit-widgets' ).isSavingWidgetAreas() ) {
359
- checkPass = true;
360
- }
361
- } else if (
362
- typeof wp.data.select( 'core/editor' ) == 'object' &&
363
- ! wp.data.select( 'core/editor' ).isSavingPost() &&
364
- ! wp.data.select( 'core/editor' ).isAutosavingPost() &&
365
- wp.data.select( 'core/editor' ).didPostSaveRequestSucceed()
366
- ) {
367
- checkPass = true;
368
- }
369
-
370
- if ( checkPass ) {
371
- clearInterval( saveCheck );
372
-
373
- var showPrompt = true;
374
- if ( typeof wp.data.select( 'core/edit-widgets' ) == 'object' ) {
375
- // New Widget Area.
376
- var $widgets = jQuery( '.wp-block-widget-area .components-panel__body.is-opened .siteorigin-widget-form-main-siteorigin-widget-button-widget' );
377
- jQuery.each( $widgets , function() {
378
- if ( ! sowbForms.validateFields( jQuery( this ).parent(), showPrompt) ) {
379
- showPrompt = false;
380
- }
381
- } );
382
- } else if ( typeof wp.data.select( 'core/editor' ) == 'object' ) {
383
- // Block Editor.
384
- var sowbCurrentBlocks = wp.data.select( 'core/block-editor' ).getBlocks();
385
- for ( var i = 0; i < sowbCurrentBlocks.length; i++ ) {
386
- if ( sowbCurrentBlocks[ i ].name == 'sowb/widget-block' && sowbCurrentBlocks[ i ].isValid ) {
387
- $form = jQuery( '#block-' + sowbCurrentBlocks[ i ].clientId ).find( '.so-widget-placeholder ');
388
- if ( ! sowbForms.validateFields( $form, showPrompt) ) {
389
- showPrompt = false;
390
- }
391
- $form.find( '.siteorigin-widget-field-is-required input' ).on( 'change', function() {
392
- sowbForms.validateFields( $form );
393
- } );
394
- }
395
  }
 
 
 
396
  }
397
- sowbTimeoutSetup = false;
398
  }
399
- }, 250 );
400
- }
 
401
  }
402
  } );
403
  }
8
  var Toolbar = components.Toolbar;
9
  var ToolbarButton = components.ToolbarButton;
10
  var Placeholder = components.Placeholder;
11
+ var Spinner = components.Spinner;
12
  var __ = i18n.__;
13
 
14
  var getAjaxErrorMsg = function( response ) {
332
 
333
  // Setup SiteOrigin Widgets Block Validation.
334
  var sowbTimeoutSetup = false;
335
+ if ( adminpage != 'widgets-php' && typeof wp.data.select == 'function' ) {
336
+ wp.data.subscribe( function() {
337
+ if (
338
+ ! sowbTimeoutSetup &&
339
+ typeof wp.data.select( 'core/editor' ) == 'object' &&
340
+ wp.data.select( 'core/editor' ).isSavingPost()
341
+ ) {
342
+ sowbTimeoutSetup = true;
343
+ var saveCheck = setInterval( function() {
344
 
345
+ if (
346
+ ! wp.data.select( 'core/editor' ).isSavingPost() &&
347
+ ! wp.data.select( 'core/editor' ).isAutosavingPost() &&
348
+ wp.data.select( 'core/editor' ).didPostSaveRequestSucceed()
349
+ ) {
350
+ clearInterval( saveCheck );
351
+ var showPrompt = true;
352
+ var sowbCurrentBlocks = wp.data.select( 'core/block-editor' ).getBlocks();
353
+ for ( var i = 0; i < sowbCurrentBlocks.length; i++ ) {
354
+ if ( sowbCurrentBlocks[ i ].name == 'sowb/widget-block' && sowbCurrentBlocks[ i ].isValid ) {
355
+ $form = jQuery( '#block-' + sowbCurrentBlocks[ i ].clientId ).find( '.so-widget-placeholder ');
356
+ if ( ! sowbForms.validateFields( $form, showPrompt) ) {
357
+ showPrompt = false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
358
  }
359
+ $form.find( '.siteorigin-widget-field-is-required input' ).on( 'change', function() {
360
+ sowbForms.validateFields( $form );
361
+ } );
362
  }
 
363
  }
364
+ sowbTimeoutSetup = false;
365
+ }
366
+ }, 250 );
367
  }
368
  } );
369
  }
compat/block-editor/widget-block.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,t,i,o,s,n,d){var a=o.createElement,r=t.registerBlockType,l=d.BlockControls,w=s.ComboboxControl,c=n.withState,g=s.Toolbar,u=s.ToolbarButton,p=s.Placeholder,m=s.Spinner,b=i.__,f=function(e){var t="";return e.hasOwnProperty("responseJSON")?t=e.responseJSON.message:e.hasOwnProperty("responseText")&&(t=e.responseText),t};r("sowb/widget-block",{title:b("SiteOrigin Widget","so-widgets-bundle"),description:b("Select a SiteOrigin widget from the dropdown.","so-widgets-bundle"),icon:function(){return a("span",{className:"widget-icon so-widget-icon so-block-editor-icon"})},category:"widgets",keywords:[sowbBlockEditorAdmin.widgets.reduce((function(e,t){return e.length>0&&(e+=","),e+t.name}),"")],supports:{html:!1,anchor:!0},attributes:{widgetClass:{type:"string"},anchor:{type:"string"},widgetData:{type:"object"},widgetHtml:{type:"string"},widgetIcons:{type:"array"}},edit:c({editing:!1,formInitialized:!1,previewInitialized:!1,widgetFormHtml:"",widgetSettingsChanged:!1,widgetPreviewHtml:""})((function(e){function t(t=!1){"object"==typeof wp.data.dispatch("core/editor")&&wp.data.dispatch("core/editor").lockPostSaving(),jQuery.post({url:sowbBlockEditorAdmin.restUrl+"sowb/v1/widgets/previews",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",sowbBlockEditorAdmin.nonce)},data:{anchor:e.attributes.anchor,widgetClass:e.attributes.widgetClass,widgetData:t||(e.attributes.widgetData||{})}}).done((function(t){e.setState({widgetPreviewHtml:t.html,previewInitialized:!1}),e.setAttributes({widgetHtml:t.html,widgetIcons:t.icons}),"object"==typeof wp.data.dispatch("core/editor")&&wp.data.dispatch("core/editor").unlockPostSaving()})).fail((function(t){e.setState({widgetFormHtml:"<div>"+f(t)+"</div>"})}))}function i(){e.setState({editing:!1,previewInitialized:!1})}if(!e.editing&&e.attributes.widgetClass&&e.attributes.widgetData){var o=!e.loadingWidgets&&!e.editing&&!e.widgetPreviewHtml&&e.attributes.widgetClass&&e.attributes.widgetData;o&&(e.setAttributes({widgetHtml:null,widgetIcons:null}),t());var s=e.widgetPreviewHtml?e.widgetPreviewHtml:"";return[a(l,{key:"controls"},a(g,{label:b("Preview widget.","so-widgets-bundle")},a(u,{className:"components-icon-button components-toolbar__control",label:b("Edit widget.","so-widgets-bundle"),onClick:function(){e.setState({editing:!0,formInitialized:!1})},icon:"edit"}))),a("div",{key:"preview",className:"so-widget-preview-container"},o?a("div",{className:"so-widgets-spinner-container"},a("span",null,a(m))):a("div",{dangerouslySetInnerHTML:{__html:s},ref:function(){e.previewInitialized||(jQuery(window.sowb).trigger("setup_widgets",{preview:!0}),e.setState({previewInitialized:!0}))}}))]}var n=[];sowbBlockEditorAdmin.widgets&&(n=sowbBlockEditorAdmin.widgets.map((function(e){return{value:e.class,label:e.name}})));var d=e.attributes.widgetClass&&!e.widgetFormHtml;d&&jQuery.post({url:sowbBlockEditorAdmin.restUrl+"sowb/v1/widgets/forms",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",sowbBlockEditorAdmin.nonce)},data:{widgetClass:e.attributes.widgetClass,widgetData:e.attributes.widgetData}}).done((function(t){e.setState({widgetFormHtml:t})})).fail((function(t){e.setState({widgetFormHtml:"<div>"+f(t)+"</div>"})}));var r=e.widgetFormHtml?e.widgetFormHtml:"";return[!!r&&a(l,{key:"controls"},a(g,{label:b("Preview widget.","so-widgets-bundle")},a(u,{className:"components-icon-button components-toolbar__control",label:b("Preview widget.","so-widgets-bundle"),onClick:i,icon:"visibility"}))),a(p,{key:"placeholder",className:"so-widget-placeholder",label:b("SiteOrigin Widget","so-widgets-bundle"),instructions:b("Select the type of widget you want to use:","so-widgets-bundle")},e.loadingWidgets||d?a(m):a("div",{className:"so-widget-block-container"},a(w,{className:"so-widget-autocomplete-field",label:b("Widget type","so-widgets-bundle"),value:e.attributes.widgetClass,onFilterValueChange:function(e){},onChange:function(t){if(""!==t){if(e.widgetSettingsChanged&&!confirm(sowbBlockEditorAdmin.confirmChangeWidget))return!1;e.setAttributes({widgetClass:t,widgetData:null}),e.setState({editing:!0,widgetFormHtml:null,formInitialized:!1,widgetSettingsChanged:!1,widgetPreviewHtml:null,previewInitialized:!1})}},options:n}),a("div",{className:"so-widget-block-form-container",dangerouslySetInnerHTML:{__html:r},ref:function(o){var s=jQuery(o).find(".siteorigin-widget-form-main");s.length>0&&!e.formInitialized&&(s.siblings(".siteorigin-widget-preview").find("> a").on("click",(function(e){e.stopImmediatePropagation(),i()})),s.data("backupDisabled",!0),s.sowSetupForm(),e.attributes.widgetData?sowbForms.setWidgetFormValues(s,e.attributes.widgetData):e.setAttributes({widgetData:sowbForms.getWidgetFormValues(s)}),s.on("change",(function(){e.setState({widgetSettingsChanged:!0,widgetPreviewHtml:null,previewInitialized:!1});var i=sowbForms.getWidgetFormValues(s);e.setAttributes({widgetData:i}),t(i)})),e.setState({formInitialized:!0}))}})))]})),save:function(e){return null}})}(window.wp.editor,window.wp.blocks,window.wp.i18n,window.wp.element,window.wp.components,window.wp.compose,window.wp.blockEditor);var sowbTimeoutSetup=!1;"function"==typeof wp.data.select&&wp.data.subscribe((function(){if(!sowbTimeoutSetup){var e=!1;if("object"==typeof wp.data.select("core/edit-widgets")?wp.data.select("core/edit-widgets").isSavingWidgetAreas()&&(e=!0):"object"==typeof wp.data.select("core/editor")&&wp.data.select("core/editor").isSavingPost()&&(e=!0),e){sowbTimeoutSetup=!0;var t=setInterval((function(){var e=!1;if("object"==typeof wp.data.select("core/edit-widgets")?wp.data.select("core/edit-widgets").isSavingWidgetAreas()||(e=!0):"object"!=typeof wp.data.select("core/editor")||wp.data.select("core/editor").isSavingPost()||wp.data.select("core/editor").isAutosavingPost()||!wp.data.select("core/editor").didPostSaveRequestSucceed()||(e=!0),e){clearInterval(t);var i=!0;if("object"==typeof wp.data.select("core/edit-widgets")){var o=jQuery(".wp-block-widget-area .components-panel__body.is-opened .siteorigin-widget-form-main-siteorigin-widget-button-widget");jQuery.each(o,(function(){sowbForms.validateFields(jQuery(this).parent(),i)||(i=!1)}))}else if("object"==typeof wp.data.select("core/editor"))for(var s=wp.data.select("core/block-editor").getBlocks(),n=0;n<s.length;n++)"sowb/widget-block"==s[n].name&&s[n].isValid&&($form=jQuery("#block-"+s[n].clientId).find(".so-widget-placeholder "),sowbForms.validateFields($form,i)||(i=!1),$form.find(".siteorigin-widget-field-is-required input").on("change",(function(){sowbForms.validateFields($form)})));sowbTimeoutSetup=!1}}),250)}}}));
1
+ !function(e,t,i,o,n,s,d){var a=o.createElement,r=t.registerBlockType,l=d.BlockControls,w=n.ComboboxControl,g=s.withState,c=n.Toolbar,u=n.ToolbarButton,m=n.Placeholder,p=n.Spinner,b=i.__,f=function(e){var t="";return e.hasOwnProperty("responseJSON")?t=e.responseJSON.message:e.hasOwnProperty("responseText")&&(t=e.responseText),t};r("sowb/widget-block",{title:b("SiteOrigin Widget","so-widgets-bundle"),description:b("Select a SiteOrigin widget from the dropdown.","so-widgets-bundle"),icon:function(){return a("span",{className:"widget-icon so-widget-icon so-block-editor-icon"})},category:"widgets",keywords:[sowbBlockEditorAdmin.widgets.reduce((function(e,t){return e.length>0&&(e+=","),e+t.name}),"")],supports:{html:!1,anchor:!0},attributes:{widgetClass:{type:"string"},anchor:{type:"string"},widgetData:{type:"object"},widgetHtml:{type:"string"},widgetIcons:{type:"array"}},edit:g({editing:!1,formInitialized:!1,previewInitialized:!1,widgetFormHtml:"",widgetSettingsChanged:!1,widgetPreviewHtml:""})((function(e){function t(t=!1){"object"==typeof wp.data.dispatch("core/editor")&&wp.data.dispatch("core/editor").lockPostSaving(),jQuery.post({url:sowbBlockEditorAdmin.restUrl+"sowb/v1/widgets/previews",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",sowbBlockEditorAdmin.nonce)},data:{anchor:e.attributes.anchor,widgetClass:e.attributes.widgetClass,widgetData:t||(e.attributes.widgetData||{})}}).done((function(t){e.setState({widgetPreviewHtml:t.html,previewInitialized:!1}),e.setAttributes({widgetHtml:t.html,widgetIcons:t.icons}),"object"==typeof wp.data.dispatch("core/editor")&&wp.data.dispatch("core/editor").unlockPostSaving()})).fail((function(t){e.setState({widgetFormHtml:"<div>"+f(t)+"</div>"})}))}function i(){e.setState({editing:!1,previewInitialized:!1})}if(!e.editing&&e.attributes.widgetClass&&e.attributes.widgetData){var o=!e.loadingWidgets&&!e.editing&&!e.widgetPreviewHtml&&e.attributes.widgetClass&&e.attributes.widgetData;o&&(e.setAttributes({widgetHtml:null,widgetIcons:null}),t());var n=e.widgetPreviewHtml?e.widgetPreviewHtml:"";return[a(l,{key:"controls"},a(c,{label:b("Preview widget.","so-widgets-bundle")},a(u,{className:"components-icon-button components-toolbar__control",label:b("Edit widget.","so-widgets-bundle"),onClick:function(){e.setState({editing:!0,formInitialized:!1})},icon:"edit"}))),a("div",{key:"preview",className:"so-widget-preview-container"},o?a("div",{className:"so-widgets-spinner-container"},a("span",null,a(p))):a("div",{dangerouslySetInnerHTML:{__html:n},ref:function(){e.previewInitialized||(jQuery(window.sowb).trigger("setup_widgets",{preview:!0}),e.setState({previewInitialized:!0}))}}))]}var s=[];sowbBlockEditorAdmin.widgets&&(s=sowbBlockEditorAdmin.widgets.map((function(e){return{value:e.class,label:e.name}})));var d=e.attributes.widgetClass&&!e.widgetFormHtml;d&&jQuery.post({url:sowbBlockEditorAdmin.restUrl+"sowb/v1/widgets/forms",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",sowbBlockEditorAdmin.nonce)},data:{widgetClass:e.attributes.widgetClass,widgetData:e.attributes.widgetData}}).done((function(t){e.setState({widgetFormHtml:t})})).fail((function(t){e.setState({widgetFormHtml:"<div>"+f(t)+"</div>"})}));var r=e.widgetFormHtml?e.widgetFormHtml:"";return[!!r&&a(l,{key:"controls"},a(c,{label:b("Preview widget.","so-widgets-bundle")},a(u,{className:"components-icon-button components-toolbar__control",label:b("Preview widget.","so-widgets-bundle"),onClick:i,icon:"visibility"}))),a(m,{key:"placeholder",className:"so-widget-placeholder",label:b("SiteOrigin Widget","so-widgets-bundle"),instructions:b("Select the type of widget you want to use:","so-widgets-bundle")},e.loadingWidgets||d?a(p):a("div",{className:"so-widget-block-container"},a(w,{className:"so-widget-autocomplete-field",label:b("Widget type","so-widgets-bundle"),value:e.attributes.widgetClass,onFilterValueChange:function(e){},onChange:function(t){if(""!==t){if(e.widgetSettingsChanged&&!confirm(sowbBlockEditorAdmin.confirmChangeWidget))return!1;e.setAttributes({widgetClass:t,widgetData:null}),e.setState({editing:!0,widgetFormHtml:null,formInitialized:!1,widgetSettingsChanged:!1,widgetPreviewHtml:null,previewInitialized:!1})}},options:s}),a("div",{className:"so-widget-block-form-container",dangerouslySetInnerHTML:{__html:r},ref:function(o){var n=jQuery(o).find(".siteorigin-widget-form-main");n.length>0&&!e.formInitialized&&(n.siblings(".siteorigin-widget-preview").find("> a").on("click",(function(e){e.stopImmediatePropagation(),i()})),n.data("backupDisabled",!0),n.sowSetupForm(),e.attributes.widgetData?sowbForms.setWidgetFormValues(n,e.attributes.widgetData):e.setAttributes({widgetData:sowbForms.getWidgetFormValues(n)}),n.on("change",(function(){e.setState({widgetSettingsChanged:!0,widgetPreviewHtml:null,previewInitialized:!1});var i=sowbForms.getWidgetFormValues(n);e.setAttributes({widgetData:i}),t(i)})),e.setState({formInitialized:!0}))}})))]})),save:function(e){return null}})}(window.wp.editor,window.wp.blocks,window.wp.i18n,window.wp.element,window.wp.components,window.wp.compose,window.wp.blockEditor);var sowbTimeoutSetup=!1;"widgets-php"!=adminpage&&"function"==typeof wp.data.select&&wp.data.subscribe((function(){if(!sowbTimeoutSetup&&"object"==typeof wp.data.select("core/editor")&&wp.data.select("core/editor").isSavingPost()){sowbTimeoutSetup=!0;var e=setInterval((function(){if(!wp.data.select("core/editor").isSavingPost()&&!wp.data.select("core/editor").isAutosavingPost()&&wp.data.select("core/editor").didPostSaveRequestSucceed()){clearInterval(e);for(var t=!0,i=wp.data.select("core/block-editor").getBlocks(),o=0;o<i.length;o++)"sowb/widget-block"==i[o].name&&i[o].isValid&&($form=jQuery("#block-"+i[o].clientId).find(".so-widget-placeholder "),sowbForms.validateFields($form,t)||(t=!1),$form.find(".siteorigin-widget-field-is-required input").on("change",(function(){sowbForms.validateFields($form)})));sowbTimeoutSetup=!1}}),250)}}));
lang/so-widgets-bundle.pot CHANGED
@@ -300,7 +300,7 @@ msgstr ""
300
  msgid "When opening the panel, scroll the user to the top of the panel."
301
  msgstr ""
302
 
303
- #: widgets/accordion/accordion.php:72, widgets/accordion/accordion.php:85, widgets/anything-carousel/anything-carousel.php:65, widgets/anything-carousel/anything-carousel.php:81, widgets/blog/blog.php:70, widgets/contact/contact.php:61, widgets/cta/cta.php:64, widgets/editor/editor.php:34, widgets/features/features.php:140, widgets/icon/icon.php:68, widgets/post-carousel/post-carousel.php:269, widgets/price-table/price-table.php:42, widgets/price-table/price-table.php:61, widgets/simple-masonry/simple-masonry.php:44, widgets/simple-masonry/simple-masonry.php:86, widgets/social-media-buttons/social-media-buttons.php:53, widgets/tabs/tabs.php:72, widgets/tabs/tabs.php:85, widgets/taxonomy/taxonomy.php:34, widgets/testimonial/testimonial.php:41, widgets/video/video.php:33, base/inc/fields/posts.class.php:108
304
  msgid "Title"
305
  msgstr ""
306
 
@@ -332,7 +332,7 @@ msgstr ""
332
  msgid "Closed"
333
  msgstr ""
334
 
335
- #: widgets/accordion/accordion.php:111, widgets/blog/blog.php:179, widgets/contact/contact.php:429, widgets/cta/cta.php:74, widgets/hero/hero.php:254, widgets/layout-slider/layout-slider.php:222, widgets/slider/slider.php:134, widgets/tabs/tabs.php:101, widgets/testimonial/testimonial.php:184, base/inc/widgets/base-carousel.class.php:352
336
  msgid "Design"
337
  msgstr ""
338
 
@@ -340,7 +340,7 @@ msgstr ""
340
  msgid "Headings"
341
  msgstr ""
342
 
343
- #: widgets/accordion/accordion.php:121, widgets/accordion/accordion.php:159, widgets/contact/contact.php:384, widgets/contact/contact.php:439, widgets/contact/contact.php:677, widgets/cta/cta.php:78, widgets/hero/hero.php:133, widgets/layout-slider/layout-slider.php:101, widgets/slider/slider.php:87, widgets/social-media-buttons/social-media-buttons.php:85, widgets/tabs/tabs.php:111, widgets/tabs/tabs.php:131, widgets/tabs/tabs.php:175
344
  msgid "Background color"
345
  msgstr ""
346
 
@@ -348,7 +348,7 @@ msgstr ""
348
  msgid "Background hover color"
349
  msgstr ""
350
 
351
- #: widgets/accordion/accordion.php:131, widgets/cta/cta.php:88, widgets/tabs/tabs.php:140
352
  msgid "Title color"
353
  msgstr ""
354
 
@@ -356,7 +356,7 @@ msgstr ""
356
  msgid "Title hover color"
357
  msgstr ""
358
 
359
- #: widgets/accordion/accordion.php:140, widgets/accordion/accordion.php:168, widgets/contact/contact.php:449, widgets/contact/contact.php:571, widgets/contact/contact.php:687, widgets/cta/cta.php:83, widgets/tabs/tabs.php:116, widgets/tabs/tabs.php:150, widgets/tabs/tabs.php:184
360
  msgid "Border color"
361
  msgstr ""
362
 
@@ -424,7 +424,7 @@ msgstr ""
424
  msgid "Top"
425
  msgstr ""
426
 
427
- #: widgets/anything-carousel/anything-carousel.php:129, widgets/button/button.php:105, widgets/button/button.php:131, widgets/button/button.php:142, widgets/button/button.php:226, widgets/contact/contact.php:504, widgets/contact/contact.php:519, widgets/contact/contact.php:748, widgets/cta/cta.php:100, widgets/features/features.php:73, widgets/headline/headline.php:102, widgets/headline/headline.php:112, widgets/headline/headline.php:183, widgets/headline/headline.php:193, widgets/headline/headline.php:248, widgets/headline/headline.php:257, widgets/icon/icon.php:50, widgets/image/image.php:70, widgets/image/image.php:82, widgets/image-grid/image-grid.php:137, widgets/image-grid/image-grid.php:167, widgets/image-grid/image-grid.php:204, widgets/image-grid/image-grid.php:250, widgets/simple-masonry/simple-masonry.php:161, widgets/simple-masonry/simple-masonry.php:208, widgets/simple-masonry/simple-masonry.php:236, widgets/social-media-buttons/social-media-buttons.php:175, widgets/social-media-buttons/social-media-buttons.php:186, widgets/testimonial/testimonial.php:256
428
  msgid "Right"
429
  msgstr ""
430
 
@@ -432,7 +432,7 @@ msgstr ""
432
  msgid "Bottom"
433
  msgstr ""
434
 
435
- #: widgets/anything-carousel/anything-carousel.php:137, widgets/button/button.php:107, widgets/button/button.php:130, widgets/button/button.php:141, widgets/button/button.php:232, widgets/contact/contact.php:503, widgets/contact/contact.php:518, widgets/contact/contact.php:747, widgets/cta/cta.php:99, widgets/features/features.php:75, widgets/headline/headline.php:101, widgets/headline/headline.php:111, widgets/headline/headline.php:182, widgets/headline/headline.php:192, widgets/headline/headline.php:247, widgets/headline/headline.php:256, widgets/icon/icon.php:49, widgets/image/image.php:69, widgets/image/image.php:81, widgets/image-grid/image-grid.php:143, widgets/image-grid/image-grid.php:165, widgets/image-grid/image-grid.php:202, widgets/image-grid/image-grid.php:256, widgets/simple-masonry/simple-masonry.php:159, widgets/simple-masonry/simple-masonry.php:214, widgets/simple-masonry/simple-masonry.php:235, widgets/social-media-buttons/social-media-buttons.php:174, widgets/social-media-buttons/social-media-buttons.php:185, widgets/testimonial/testimonial.php:255
436
  msgid "Left"
437
  msgstr ""
438
 
@@ -544,11 +544,11 @@ msgstr ""
544
  msgid "Post"
545
  msgstr ""
546
 
547
- #: widgets/blog/blog.php:189, widgets/blog/blog.php:452, widgets/blog/blog.php:531
548
  msgid "Border Color"
549
  msgstr ""
550
 
551
- #: widgets/blog/blog.php:194
552
  msgid "Background Color"
553
  msgstr ""
554
 
@@ -708,7 +708,7 @@ msgstr ""
708
  msgid "Posts Query"
709
  msgstr ""
710
 
711
- #: widgets/blog/blog.php:608, widgets/button/button.php:33, widgets/contact/contact.php:996, widgets/features/features.php:387, widgets/headline/headline.php:37, widgets/social-media-buttons/social-media-buttons.php:32, base/inc/widgets/base-slider.class.php:222
712
  msgid "Responsive Breakpoint"
713
  msgstr ""
714
 
@@ -737,19 +737,19 @@ msgstr ""
737
  msgid "% Comments"
738
  msgstr ""
739
 
740
- #: widgets/blog/blog.php:1054, widgets/blog/blog.php:1088
741
  msgid "Continue reading"
742
  msgstr ""
743
 
744
- #: widgets/blog/blog.php:1152
745
  msgid "Post navigation"
746
  msgstr ""
747
 
748
- #: widgets/blog/blog.php:1165
749
  msgid "Get more pagination themes and Ajax reloading with %sSiteOrigin Premium%s"
750
  msgstr ""
751
 
752
- #: widgets/blog/blog.php:1170
753
  msgid "Adjust the post Read More link text and choose a custom post date format with %sSiteOrigin Premium%s"
754
  msgstr ""
755
 
@@ -1490,23 +1490,51 @@ msgstr ""
1490
  msgid "SiteOrigin Call To Action"
1491
  msgstr ""
1492
 
1493
- #: widgets/cta/cta.php:69, widgets/price-table/price-table.php:65
 
 
 
 
1494
  msgid "Subtitle"
1495
  msgstr ""
1496
 
1497
- #: widgets/cta/cta.php:92
1498
- msgid "Subtitle color"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1499
  msgstr ""
1500
 
1501
- #: widgets/cta/cta.php:96
1502
- msgid "Button align"
1503
  msgstr ""
1504
 
1505
- #: widgets/cta/cta.php:109, widgets/google-map/google-map.php:506, widgets/hero/hero.php:79, widgets/hero/hero.php:91
 
 
 
 
1506
  msgid "Button"
1507
  msgstr ""
1508
 
1509
- #: widgets/cta/cta.php:137
1510
  msgid "Get more font customization options with %sSiteOrigin Premium%s"
1511
  msgstr ""
1512
 
@@ -2285,10 +2313,6 @@ msgstr ""
2285
  msgid "Slider Controls"
2286
  msgstr ""
2287
 
2288
- #: widgets/hero/hero.php:179, widgets/layout-slider/layout-slider.php:147, widgets/simple-masonry/simple-masonry.php:227
2289
- msgid "Layout"
2290
- msgstr ""
2291
-
2292
  #: widgets/hero/hero.php:183, widgets/layout-slider/layout-slider.php:151, widgets/simple-masonry/simple-masonry.php:242, base/inc/widgets/base-carousel.class.php:193
2293
  msgid "Desktop"
2294
  msgstr ""
@@ -2549,10 +2573,6 @@ msgstr ""
2549
  msgid "Title Font Size"
2550
  msgstr ""
2551
 
2552
- #: widgets/image-grid/image-grid.php:233, widgets/simple-masonry/simple-masonry.php:190
2553
- msgid "Title Color"
2554
- msgstr ""
2555
-
2556
  #: widgets/image-grid/image-grid.php:241, widgets/simple-masonry/simple-masonry.php:199
2557
  msgid "Title Padding"
2558
  msgstr ""
@@ -3137,10 +3157,6 @@ msgstr ""
3137
  msgid "Round"
3138
  msgstr ""
3139
 
3140
- #: widgets/testimonial/testimonial.php:214
3141
- msgid "Colors"
3142
- msgstr ""
3143
-
3144
  #: widgets/testimonial/testimonial.php:218
3145
  msgid "Widget background"
3146
  msgstr ""
@@ -3275,31 +3291,31 @@ msgctxt "From this date"
3275
  msgid "From"
3276
  msgstr ""
3277
 
3278
- #: base/inc/fields/date-range.class.php:34, base/inc/fields/date-range.class.php:48
3279
  msgid "to"
3280
  msgstr ""
3281
 
3282
- #: base/inc/fields/date-range.class.php:45
3283
  msgid "From"
3284
  msgstr ""
3285
 
3286
- #: base/inc/fields/date-range.class.php:64
3287
  msgid "ago"
3288
  msgstr ""
3289
 
3290
- #: base/inc/fields/date-range.class.php:69
3291
  msgid "days"
3292
  msgstr ""
3293
 
3294
- #: base/inc/fields/date-range.class.php:70
3295
  msgid "weeks"
3296
  msgstr ""
3297
 
3298
- #: base/inc/fields/date-range.class.php:71
3299
  msgid "months"
3300
  msgstr ""
3301
 
3302
- #: base/inc/fields/date-range.class.php:72
3303
  msgid "years"
3304
  msgstr ""
3305
 
300
  msgid "When opening the panel, scroll the user to the top of the panel."
301
  msgstr ""
302
 
303
+ #: widgets/accordion/accordion.php:72, widgets/accordion/accordion.php:85, widgets/anything-carousel/anything-carousel.php:65, widgets/anything-carousel/anything-carousel.php:81, widgets/blog/blog.php:70, widgets/contact/contact.php:61, widgets/cta/cta.php:75, widgets/editor/editor.php:34, widgets/features/features.php:140, widgets/icon/icon.php:68, widgets/post-carousel/post-carousel.php:269, widgets/price-table/price-table.php:42, widgets/price-table/price-table.php:61, widgets/simple-masonry/simple-masonry.php:44, widgets/simple-masonry/simple-masonry.php:86, widgets/social-media-buttons/social-media-buttons.php:53, widgets/tabs/tabs.php:72, widgets/tabs/tabs.php:85, widgets/taxonomy/taxonomy.php:34, widgets/testimonial/testimonial.php:41, widgets/video/video.php:33, base/inc/fields/posts.class.php:108
304
  msgid "Title"
305
  msgstr ""
306
 
332
  msgid "Closed"
333
  msgstr ""
334
 
335
+ #: widgets/accordion/accordion.php:111, widgets/blog/blog.php:179, widgets/contact/contact.php:429, widgets/cta/cta.php:85, widgets/hero/hero.php:254, widgets/layout-slider/layout-slider.php:222, widgets/slider/slider.php:134, widgets/tabs/tabs.php:101, widgets/testimonial/testimonial.php:184, base/inc/widgets/base-carousel.class.php:352
336
  msgid "Design"
337
  msgstr ""
338
 
340
  msgid "Headings"
341
  msgstr ""
342
 
343
+ #: widgets/accordion/accordion.php:121, widgets/accordion/accordion.php:159, widgets/contact/contact.php:384, widgets/contact/contact.php:439, widgets/contact/contact.php:677, widgets/hero/hero.php:133, widgets/layout-slider/layout-slider.php:101, widgets/slider/slider.php:87, widgets/social-media-buttons/social-media-buttons.php:85, widgets/tabs/tabs.php:111, widgets/tabs/tabs.php:131, widgets/tabs/tabs.php:175
344
  msgid "Background color"
345
  msgstr ""
346
 
348
  msgid "Background hover color"
349
  msgstr ""
350
 
351
+ #: widgets/accordion/accordion.php:131, widgets/tabs/tabs.php:140
352
  msgid "Title color"
353
  msgstr ""
354
 
356
  msgid "Title hover color"
357
  msgstr ""
358
 
359
+ #: widgets/accordion/accordion.php:140, widgets/accordion/accordion.php:168, widgets/contact/contact.php:449, widgets/contact/contact.php:571, widgets/contact/contact.php:687, widgets/tabs/tabs.php:116, widgets/tabs/tabs.php:150, widgets/tabs/tabs.php:184
360
  msgid "Border color"
361
  msgstr ""
362
 
424
  msgid "Top"
425
  msgstr ""
426
 
427
+ #: widgets/anything-carousel/anything-carousel.php:129, widgets/button/button.php:105, widgets/button/button.php:131, widgets/button/button.php:142, widgets/button/button.php:226, widgets/contact/contact.php:504, widgets/contact/contact.php:519, widgets/contact/contact.php:748, widgets/cta/cta.php:123, widgets/features/features.php:73, widgets/headline/headline.php:102, widgets/headline/headline.php:112, widgets/headline/headline.php:183, widgets/headline/headline.php:193, widgets/headline/headline.php:248, widgets/headline/headline.php:257, widgets/icon/icon.php:50, widgets/image/image.php:70, widgets/image/image.php:82, widgets/image-grid/image-grid.php:137, widgets/image-grid/image-grid.php:167, widgets/image-grid/image-grid.php:204, widgets/image-grid/image-grid.php:250, widgets/simple-masonry/simple-masonry.php:161, widgets/simple-masonry/simple-masonry.php:208, widgets/simple-masonry/simple-masonry.php:236, widgets/social-media-buttons/social-media-buttons.php:175, widgets/social-media-buttons/social-media-buttons.php:186, widgets/testimonial/testimonial.php:256
428
  msgid "Right"
429
  msgstr ""
430
 
432
  msgid "Bottom"
433
  msgstr ""
434
 
435
+ #: widgets/anything-carousel/anything-carousel.php:137, widgets/button/button.php:107, widgets/button/button.php:130, widgets/button/button.php:141, widgets/button/button.php:232, widgets/contact/contact.php:503, widgets/contact/contact.php:518, widgets/contact/contact.php:747, widgets/cta/cta.php:121, widgets/features/features.php:75, widgets/headline/headline.php:101, widgets/headline/headline.php:111, widgets/headline/headline.php:182, widgets/headline/headline.php:192, widgets/headline/headline.php:247, widgets/headline/headline.php:256, widgets/icon/icon.php:49, widgets/image/image.php:69, widgets/image/image.php:81, widgets/image-grid/image-grid.php:143, widgets/image-grid/image-grid.php:165, widgets/image-grid/image-grid.php:202, widgets/image-grid/image-grid.php:256, widgets/simple-masonry/simple-masonry.php:159, widgets/simple-masonry/simple-masonry.php:214, widgets/simple-masonry/simple-masonry.php:235, widgets/social-media-buttons/social-media-buttons.php:174, widgets/social-media-buttons/social-media-buttons.php:185, widgets/testimonial/testimonial.php:255
436
  msgid "Left"
437
  msgstr ""
438
 
544
  msgid "Post"
545
  msgstr ""
546
 
547
+ #: widgets/blog/blog.php:189, widgets/blog/blog.php:452, widgets/blog/blog.php:531, widgets/cta/cta.php:98
548
  msgid "Border Color"
549
  msgstr ""
550
 
551
+ #: widgets/blog/blog.php:194, widgets/cta/cta.php:93
552
  msgid "Background Color"
553
  msgstr ""
554
 
708
  msgid "Posts Query"
709
  msgstr ""
710
 
711
+ #: widgets/blog/blog.php:608, widgets/button/button.php:33, widgets/contact/contact.php:996, widgets/cta/cta.php:63, widgets/features/features.php:387, widgets/headline/headline.php:37, widgets/social-media-buttons/social-media-buttons.php:32, base/inc/widgets/base-slider.class.php:222
712
  msgid "Responsive Breakpoint"
713
  msgstr ""
714
 
737
  msgid "% Comments"
738
  msgstr ""
739
 
740
+ #: widgets/blog/blog.php:1056, widgets/blog/blog.php:1090
741
  msgid "Continue reading"
742
  msgstr ""
743
 
744
+ #: widgets/blog/blog.php:1154
745
  msgid "Post navigation"
746
  msgstr ""
747
 
748
+ #: widgets/blog/blog.php:1167
749
  msgid "Get more pagination themes and Ajax reloading with %sSiteOrigin Premium%s"
750
  msgstr ""
751
 
752
+ #: widgets/blog/blog.php:1172
753
  msgid "Adjust the post Read More link text and choose a custom post date format with %sSiteOrigin Premium%s"
754
  msgstr ""
755
 
1490
  msgid "SiteOrigin Call To Action"
1491
  msgstr ""
1492
 
1493
+ #: widgets/cta/cta.php:65
1494
+ msgid "This setting controls when the mobile alignment will be used. The default value is 780px."
1495
+ msgstr ""
1496
+
1497
+ #: widgets/cta/cta.php:80, widgets/price-table/price-table.php:65
1498
  msgid "Subtitle"
1499
  msgstr ""
1500
 
1501
+ #: widgets/cta/cta.php:89, widgets/testimonial/testimonial.php:214
1502
+ msgid "Colors"
1503
+ msgstr ""
1504
+
1505
+ #: widgets/cta/cta.php:103, widgets/image-grid/image-grid.php:233, widgets/simple-masonry/simple-masonry.php:190
1506
+ msgid "Title Color"
1507
+ msgstr ""
1508
+
1509
+ #: widgets/cta/cta.php:107
1510
+ msgid "Subtitle Color"
1511
+ msgstr ""
1512
+
1513
+ #: widgets/cta/cta.php:113, widgets/hero/hero.php:179, widgets/layout-slider/layout-slider.php:147, widgets/simple-masonry/simple-masonry.php:227
1514
+ msgid "Layout"
1515
+ msgstr ""
1516
+
1517
+ #: widgets/cta/cta.php:117, widgets/cta/cta.php:131
1518
+ msgid "Desktop Button Align"
1519
+ msgstr ""
1520
+
1521
+ #: widgets/cta/cta.php:120, widgets/cta/cta.php:132
1522
+ msgid "Center Top"
1523
  msgstr ""
1524
 
1525
+ #: widgets/cta/cta.php:122, widgets/cta/cta.php:133
1526
+ msgid "Center Bottom"
1527
  msgstr ""
1528
 
1529
+ #: widgets/cta/cta.php:128
1530
+ msgid "Mobile Button Align"
1531
+ msgstr ""
1532
+
1533
+ #: widgets/cta/cta.php:144, widgets/google-map/google-map.php:506, widgets/hero/hero.php:79, widgets/hero/hero.php:91
1534
  msgid "Button"
1535
  msgstr ""
1536
 
1537
+ #: widgets/cta/cta.php:198
1538
  msgid "Get more font customization options with %sSiteOrigin Premium%s"
1539
  msgstr ""
1540
 
2313
  msgid "Slider Controls"
2314
  msgstr ""
2315
 
 
 
 
 
2316
  #: widgets/hero/hero.php:183, widgets/layout-slider/layout-slider.php:151, widgets/simple-masonry/simple-masonry.php:242, base/inc/widgets/base-carousel.class.php:193
2317
  msgid "Desktop"
2318
  msgstr ""
2573
  msgid "Title Font Size"
2574
  msgstr ""
2575
 
 
 
 
 
2576
  #: widgets/image-grid/image-grid.php:241, widgets/simple-masonry/simple-masonry.php:199
2577
  msgid "Title Padding"
2578
  msgstr ""
3157
  msgid "Round"
3158
  msgstr ""
3159
 
 
 
 
 
3160
  #: widgets/testimonial/testimonial.php:218
3161
  msgid "Widget background"
3162
  msgstr ""
3291
  msgid "From"
3292
  msgstr ""
3293
 
3294
+ #: base/inc/fields/date-range.class.php:34, base/inc/fields/date-range.class.php:50
3295
  msgid "to"
3296
  msgstr ""
3297
 
3298
+ #: base/inc/fields/date-range.class.php:47
3299
  msgid "From"
3300
  msgstr ""
3301
 
3302
+ #: base/inc/fields/date-range.class.php:66
3303
  msgid "ago"
3304
  msgstr ""
3305
 
3306
+ #: base/inc/fields/date-range.class.php:71
3307
  msgid "days"
3308
  msgstr ""
3309
 
3310
+ #: base/inc/fields/date-range.class.php:72
3311
  msgid "weeks"
3312
  msgstr ""
3313
 
3314
+ #: base/inc/fields/date-range.class.php:73
3315
  msgid "months"
3316
  msgstr ""
3317
 
3318
+ #: base/inc/fields/date-range.class.php:74
3319
  msgid "years"
3320
  msgstr ""
3321
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ Tags: widget, button, slider, hero, google maps, image, carousel, lottie, featur
3
  Requires at least: 4.2
4
  Tested up to: 6.1
5
  Requires PHP: 5.6.20
6
- Stable tag: 1.44.2
7
- Build time: 2022-12-03T19:30:06+00:00
8
  License: GPLv3 or later
9
  Contributors: gpriday, braam-genis, alexgso
10
  Donate link: https://siteorigin.com/downloads/premium/
@@ -106,6 +106,12 @@ The Widgets Bundle global interface is available at Plugins > SiteOrigin Widgets
106
 
107
  == Changelog ==
108
 
 
 
 
 
 
 
109
  = 1.44.2 - 03 December 2022 =
110
  * Added WP Rocket compatibility.
111
  * Button: Expanded Font Size, Padding, and Rounding to be more customizable.
3
  Requires at least: 4.2
4
  Tested up to: 6.1
5
  Requires PHP: 5.6.20
6
+ Stable tag: 1.45.0
7
+ Build time: 2022-12-07T14:01:42+00:00
8
  License: GPLv3 or later
9
  Contributors: gpriday, braam-genis, alexgso
10
  Donate link: https://siteorigin.com/downloads/premium/
106
 
107
  == Changelog ==
108
 
109
+ = 1.45.0 - 07 December 2022 =
110
+ * Call To Action: Added `Mobile Button Align` setting.
111
+ * PHP 8.1: Resolved form field deprecated notices.
112
+ * Developer: Removed `edit-widgets` validation support.
113
+ * Developer: Added min/max for number form field.
114
+
115
  = 1.44.2 - 03 December 2022 =
116
  * Added WP Rocket compatibility.
117
  * Button: Expanded Font Size, Padding, and Rounding to be more customizable.
so-widgets-bundle.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: SiteOrigin Widgets Bundle
4
  Description: A highly customizable collection of widgets, ready to be used anywhere, neatly bundled into a single plugin.
5
- Version: 1.44.2
6
  Text Domain: so-widgets-bundle
7
  Domain Path: /lang
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.44.2' );
16
  define( 'SOW_BUNDLE_BASE_FILE', __FILE__ );
17
 
18
  // Allow JS suffix to be pre-set.
2
  /*
3
  Plugin Name: SiteOrigin Widgets Bundle
4
  Description: A highly customizable collection of widgets, ready to be used anywhere, neatly bundled into a single plugin.
5
+ Version: 1.45.0
6
  Text Domain: so-widgets-bundle
7
  Domain Path: /lang
8
  Author: SiteOrigin
12
  License URI: https://www.gnu.org/licenses/gpl-3.0.txt
13
  */
14
 
15
+ define( 'SOW_BUNDLE_VERSION', '1.45.0' );
16
  define( 'SOW_BUNDLE_BASE_FILE', __FILE__ );
17
 
18
  // Allow JS suffix to be pre-set.
widgets/blog/blog.php CHANGED
@@ -1013,6 +1013,7 @@ class SiteOrigin_Widget_Blog_Widget extends SiteOrigin_Widget {
1013
 
1014
  static public function post_featured_image( $settings, $categories = false, $size = 'full' ) {
1015
  if ( $settings['featured_image'] && has_post_thumbnail() ) : ?>
 
1016
  <div class="sow-entry-thumbnail">
1017
  <?php if ( $categories && $settings['categories'] && has_category() ) : ?>
1018
  <div class="sow-thumbnail-meta">
@@ -1037,6 +1038,7 @@ class SiteOrigin_Widget_Blog_Widget extends SiteOrigin_Widget {
1037
  </a>
1038
  </div>
1039
  <?php
 
1040
  endif;
1041
  }
1042
 
1013
 
1014
  static public function post_featured_image( $settings, $categories = false, $size = 'full' ) {
1015
  if ( $settings['featured_image'] && has_post_thumbnail() ) : ?>
1016
+ <?php ob_start(); ?>
1017
  <div class="sow-entry-thumbnail">
1018
  <?php if ( $categories && $settings['categories'] && has_category() ) : ?>
1019
  <div class="sow-thumbnail-meta">
1038
  </a>
1039
  </div>
1040
  <?php
1041
+ echo apply_filters( 'siteorigin_widgets_blog_featured_image_markup', ob_get_clean(), $settings, $categories = false, $size = 'full' );
1042
  endif;
1043
  }
1044
 
widgets/cta/css/style.css CHANGED
@@ -1 +1 @@
1
- .sow-cta-base{zoom:1;padding:2em 2.5em}.sow-cta-base:before{content:'';display:block}.sow-cta-base:after{content:'';display:table;clear:both}.sow-cta-base .sow-cta-text .sow-cta-title,.sow-cta-base .sow-cta-text .sow-cta-subtitle,.sow-cta-base .sow-cta-text p{margin:.4em 0}.sow-cta-base .sow-cta-text .sow-cta-title{margin-top:0}.sow-cta-base .sow-cta-text .sow-cta-subtitle,.sow-cta-base .sow-cta-text p{margin-bottom:0;font-weight:normal}@media screen and (max-width:640px){.sow-cta-base{text-align:center;padding:1.75em}.sow-cta-base .sow-cta-text{float:none}.sow-cta-base .so-widget-sow-button{display:inline-block;float:none;margin-top:2em !important;margin-left:0!important}}
1
+ .sow-cta-base{zoom:1;padding:2em 2.5em}.sow-cta-base:before{content:'';display:block}.sow-cta-base:after{content:'';display:table;clear:both}.sow-cta-base .sow-cta-text .sow-cta-title,.sow-cta-base .sow-cta-text .sow-cta-subtitle,.sow-cta-base .sow-cta-text p{margin:.4em 0}.sow-cta-base .sow-cta-text .sow-cta-title{margin-top:0}.sow-cta-base .sow-cta-text .sow-cta-subtitle,.sow-cta-base .sow-cta-text p{margin-bottom:0;font-weight:normal}@media screen and (max-width:640px){.sow-cta-base{text-align:center;padding:1.75em}.sow-cta-base .sow-cta-text{float:none}}
widgets/cta/cta.php CHANGED
@@ -56,6 +56,17 @@ class SiteOrigin_Widget_Cta_Widget extends SiteOrigin_Widget {
56
  );
57
  }
58
 
 
 
 
 
 
 
 
 
 
 
 
59
  function get_widget_form() {
60
  return array(
61
 
@@ -73,34 +84,58 @@ class SiteOrigin_Widget_Cta_Widget extends SiteOrigin_Widget {
73
  'type' => 'section',
74
  'label' => __( 'Design', 'so-widgets-bundle' ),
75
  'fields' => array(
76
- 'background_color' => array(
77
- 'type' => 'color',
78
- 'label' => __( 'Background color', 'so-widgets-bundle' ),
79
- 'default' => '#f8f8f8'
80
- ),
81
- 'border_color' => array(
82
- 'type' => 'color',
83
- 'label' => __( 'Border color', 'so-widgets-bundle' ),
84
- 'default' => '#e3e3e3',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  ),
86
- 'title_color' => array(
87
- 'type' => 'color',
88
- 'label' => __( 'Title color', 'so-widgets-bundle' ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  ),
90
- 'subtitle_color' => array(
91
- 'type' => 'color',
92
- 'label' => __( 'Subtitle color', 'so-widgets-bundle' ),
93
- ),
94
- 'button_align' => array(
95
- 'type' => 'select',
96
- 'label' => __( 'Button align', 'so-widgets-bundle' ),
97
- 'default' => 'right',
98
- 'options' => array(
99
- 'left' => __( 'Left', 'so-widgets-bundle' ),
100
- 'right' => __( 'Right', 'so-widgets-bundle' ),
101
- )
102
- )
103
- )
104
  ),
105
 
106
  'button' => array(
@@ -108,26 +143,52 @@ class SiteOrigin_Widget_Cta_Widget extends SiteOrigin_Widget {
108
  'class' => 'SiteOrigin_Widget_Button_Widget',
109
  'label' => __( 'Button', 'so-widgets-bundle' ),
110
  ),
111
-
112
  );
113
  }
114
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  function get_less_variables( $instance ) {
116
  if ( empty( $instance ) || empty( $instance['design'] ) ) {
117
  return array();
118
  }
119
 
120
- return array(
121
- 'border_color' => $instance['design']['border_color'],
122
- 'background_color' => $instance['design']['background_color'],
123
- 'title_color' => $instance['design']['title_color'],
124
- 'subtitle_color' => $instance['design']['subtitle_color'],
125
- 'button_align' => $instance['design']['button_align'],
126
  );
 
 
 
 
 
 
 
 
127
  }
128
 
129
  function modify_child_widget_form( $child_widget_form, $child_widget ) {
130
  unset( $child_widget_form['design']['fields']['align'] );
 
 
131
  return $child_widget_form;
132
  }
133
 
56
  );
57
  }
58
 
59
+ function get_settings_form() {
60
+ return array(
61
+ 'responsive_breakpoint' => array(
62
+ 'type' => 'measurement',
63
+ 'label' => __( 'Responsive Breakpoint', 'so-widgets-bundle' ),
64
+ 'default' => '780px',
65
+ 'description' => __( "This setting controls when the mobile alignment will be used. The default value is 780px.", 'so-widgets-bundle' )
66
+ ),
67
+ );
68
+ }
69
+
70
  function get_widget_form() {
71
  return array(
72
 
84
  'type' => 'section',
85
  'label' => __( 'Design', 'so-widgets-bundle' ),
86
  'fields' => array(
87
+ 'colors' => array(
88
+ 'type' => 'section',
89
+ 'label' => __( 'Colors', 'so-widgets-bundle' ),
90
+ 'fields' => array(
91
+ 'background_color' => array(
92
+ 'type' => 'color',
93
+ 'label' => __( 'Background Color', 'so-widgets-bundle' ),
94
+ 'default' => '#f8f8f8'
95
+ ),
96
+ 'border_color' => array(
97
+ 'type' => 'color',
98
+ 'label' => __( 'Border Color', 'so-widgets-bundle' ),
99
+ 'default' => '#e3e3e3',
100
+ ),
101
+ 'title_color' => array(
102
+ 'type' => 'color',
103
+ 'label' => __( 'Title Color', 'so-widgets-bundle' ),
104
+ ),
105
+ 'subtitle_color' => array(
106
+ 'type' => 'color',
107
+ 'label' => __( 'Subtitle Color', 'so-widgets-bundle' ),
108
+ ),
109
+ ),
110
  ),
111
+ 'layout' => array(
112
+ 'type' => 'section',
113
+ 'label' => __( 'Layout', 'so-widgets-bundle' ),
114
+ 'fields' => array(
115
+ 'desktop' => array(
116
+ 'type' => 'select',
117
+ 'label' => __( 'Desktop Button Align', 'so-widgets-bundle' ),
118
+ 'default' => 'right',
119
+ 'options' => array(
120
+ 'top' => __( 'Center Top', 'so-widgets-bundle' ),
121
+ 'left' => __( 'Left', 'so-widgets-bundle' ),
122
+ 'bottom' => __( 'Center Bottom', 'so-widgets-bundle' ),
123
+ 'right' => __( 'Right', 'so-widgets-bundle' ),
124
+ ),
125
+ ),
126
+ 'mobile' => array(
127
+ 'type' => 'select',
128
+ 'label' => __( 'Mobile Button Align', 'so-widgets-bundle' ),
129
+ 'default' => 'right',
130
+ 'options' => array(
131
+ '' => __( 'Desktop Button Align', 'so-widgets-bundle' ),
132
+ 'above' => __( 'Center Top', 'so-widgets-bundle' ),
133
+ 'below' => __( 'Center Bottom', 'so-widgets-bundle' ),
134
+ ),
135
+ ),
136
+ ),
137
  ),
138
+ ),
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  ),
140
 
141
  'button' => array(
143
  'class' => 'SiteOrigin_Widget_Button_Widget',
144
  'label' => __( 'Button', 'so-widgets-bundle' ),
145
  ),
 
146
  );
147
  }
148
 
149
+ function modify_instance( $instance ) {
150
+ if ( empty( $instance ) || empty( $instance['design'] ) ) {
151
+ return array();
152
+ }
153
+
154
+ if ( isset( $instance['design']['background_color'] ) ) {
155
+ $instance['design']['colors'] = array();
156
+ $instance['design']['colors']['background_color'] = $instance['design']['background_color'] ;
157
+ $instance['design']['colors']['title_color'] = $instance['design']['title_color'];
158
+ $instance['design']['colors']['subtitle_color'] = $instance['design']['subtitle_color'];
159
+ $instance['design']['layout'] = array();
160
+ $instance['design']['layout']['desktop'] = $instance['design']['button_align'] ;
161
+ }
162
+
163
+ return $instance;
164
+ }
165
+
166
  function get_less_variables( $instance ) {
167
  if ( empty( $instance ) || empty( $instance['design'] ) ) {
168
  return array();
169
  }
170
 
171
+ $less_vars = array(
172
+ 'border_color' => $instance['design']['colors']['border_color'],
173
+ 'background_color' => $instance['design']['colors']['background_color'],
174
+ 'title_color' => $instance['design']['colors']['title_color'],
175
+ 'subtitle_color' => $instance['design']['colors']['subtitle_color'],
176
+ 'button_align' => $instance['design']['layout']['desktop'],
177
  );
178
+
179
+ $global_settings = $this->get_global_settings();
180
+ if ( ! empty( $global_settings['responsive_breakpoint'] ) ) {
181
+ $less_vars['responsive_breakpoint'] = ! empty( $global_settings['responsive_breakpoint'] ) ? $global_settings['responsive_breakpoint'] : '780px';
182
+ }
183
+ $less_vars['mobile_button_align'] = ! empty( $instance['design']['layout']['mobile'] ) ? $instance['design']['layout']['mobile'] : '';
184
+
185
+ return $less_vars;
186
  }
187
 
188
  function modify_child_widget_form( $child_widget_form, $child_widget ) {
189
  unset( $child_widget_form['design']['fields']['align'] );
190
+ unset( $child_widget_form['design']['fields']['mobile_align'] );
191
+
192
  return $child_widget_form;
193
  }
194
 
widgets/cta/styles/default.less CHANGED
@@ -10,6 +10,9 @@
10
  @subtitle_font_family: default;
11
  @subtitle_font_weight: default;
12
  @subtitle_font_size: default;
 
 
 
13
 
14
  .sow-cta-base {
15
  & when ( iscolor( @border_color ) ) {
@@ -37,12 +40,21 @@
37
  }
38
  }
39
  }
40
- @button_align: right;
41
 
42
  .sow-cta-base {
43
- & when ( @button_align = right ) {
44
- .sow-cta-text {
45
- float: left;
 
 
 
 
 
 
 
 
 
 
46
  }
47
  }
48
 
@@ -50,19 +62,71 @@
50
  .sow-cta-text {
51
  float: right;
52
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  }
54
 
55
  & when ( @button_align = right ) {
 
 
 
 
56
  .so-widget-sow-button {
57
  float: right;
58
  margin-left: 1em;
59
  }
60
  }
61
 
62
- & when ( @button_align = left ) {
63
- .so-widget-sow-button {
64
- float: left;
65
- margin-right: 1em;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  }
67
  }
68
  }
10
  @subtitle_font_family: default;
11
  @subtitle_font_weight: default;
12
  @subtitle_font_size: default;
13
+ @button_align: right;
14
+ @mobile_button_align: default;
15
+ @responsive_breakpoint: default;
16
 
17
  .sow-cta-base {
18
  & when ( iscolor( @border_color ) ) {
40
  }
41
  }
42
  }
 
43
 
44
  .sow-cta-base {
45
+ & when ( @button_align = top ) {
46
+ .sow-cta-wrapper {
47
+ display: flex;
48
+ flex-direction: column-reverse;
49
+ justify-content: center;
50
+
51
+ .sow-cta-text {
52
+ text-align: center;
53
+ }
54
+ }
55
+
56
+ .so-widget-sow-button {
57
+ margin-bottom: 1.5em;
58
  }
59
  }
60
 
62
  .sow-cta-text {
63
  float: right;
64
  }
65
+
66
+ .so-widget-sow-button {
67
+ float: left;
68
+ margin-right: 1em;
69
+ }
70
+ }
71
+
72
+ & when ( @button_align = bottom ) {
73
+ .sow-cta-text {
74
+ text-align: center;
75
+ }
76
+
77
+ .so-widget-sow-button {
78
+ margin-top: 1.5em;
79
+ }
80
  }
81
 
82
  & when ( @button_align = right ) {
83
+ .sow-cta-text {
84
+ float: left;
85
+ }
86
+
87
  .so-widget-sow-button {
88
  float: right;
89
  margin-left: 1em;
90
  }
91
  }
92
 
93
+
94
+ @media (max-width: @responsive_breakpoint) {
95
+ .sow-cta-wrapper {
96
+ .so-widget-sow-button {
97
+ margin-right: 0;
98
+ margin-left: 0;
99
+ }
100
+
101
+ & when ( @mobile_button_align = above ), ( @mobile_button_align = below ) {
102
+ display: flex;
103
+
104
+ .so-widget-sow-button {
105
+ float: none;
106
+ }
107
+
108
+ .sow-cta-text {
109
+ text-align: center;
110
+ }
111
+
112
+ & when ( @mobile_button_align = above ) {
113
+ flex-direction: column-reverse;
114
+ justify-content: center;
115
+
116
+ .so-widget-sow-button {
117
+ margin-top: 0 !important;
118
+ margin-bottom: 1em;
119
+ }
120
+ }
121
+
122
+ & when ( @mobile_button_align = below ) {
123
+ flex-direction: column;
124
+ .so-widget-sow-button {
125
+ margin-top: 1em !important;
126
+ margin-bottom: 0;
127
+ }
128
+ }
129
+ }
130
  }
131
  }
132
  }