SiteOrigin Widgets Bundle - Version 1.15.7

Version Description

  • 22 May 2019 =
  • Widget Block: Ensure changed data is retained after previewing.
  • Image widget: Prevent overflow of image container when wrapped in link.
  • Image Grid: Dispatch event to notify listeners that layout is complete.
  • Image Grid: Fix layout for images wrapped in links.
  • Image grid: Use image media title for display if title isn't set in the widget form.
  • Layout Slider: Remove header and text style fields.
  • Remove Autoptimize cache clearing as it detects changes automatically.
  • Update FontAwesome icons.
  • Google Maps location field: Ensure value is retained after preview in the block editor.
  • Prevent issue in SiteOrigin Layout Block when sowb hasn't been defined.
Download this release

Release Info

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

Code changes from version 1.15.6 to 1.15.7

Files changed (51) hide show
  1. admin/tpl/admin.php +137 -137
  2. base/base.php +294 -294
  3. base/inc/actions.php +282 -282
  4. base/inc/fields/builder.class.php +72 -72
  5. base/inc/fields/checkbox.class.php +26 -26
  6. base/inc/fields/container-base.class.php +125 -125
  7. base/inc/fields/date-range.class.php +131 -131
  8. base/inc/fields/font.class.php +45 -45
  9. base/inc/fields/icon.class.php +142 -142
  10. base/inc/fields/image-radio.class.php +75 -75
  11. base/inc/fields/js/date-range-field.js +110 -110
  12. base/inc/fields/js/icon-field.js +229 -229
  13. base/inc/fields/js/image-radio-field.js +18 -18
  14. base/inc/fields/js/media-field.js +409 -409
  15. base/inc/fields/js/multi-measurement-field.js +57 -57
  16. base/inc/fields/js/tinymce-field.js +145 -145
  17. base/inc/fields/multi-measurement.class.php +122 -122
  18. base/inc/fields/order.class.php +61 -61
  19. base/inc/fields/posts.class.php +203 -203
  20. base/inc/fields/repeater.class.php +128 -128
  21. base/inc/fields/section.class.php +22 -22
  22. base/inc/fields/slider.class.php +49 -49
  23. base/inc/fields/tinymce.class.php +561 -561
  24. base/inc/fields/widget.class.php +71 -71
  25. base/inc/fonts.php +4846 -4846
  26. base/inc/less-functions.php +41 -41
  27. base/inc/lessc.inc.php +283 -283
  28. base/inc/lib/Less/Exception/Chunk.php +198 -198
  29. base/inc/meta-box-manager.php +177 -177
  30. base/inc/post-selector.php +134 -134
  31. base/inc/routes/siteorigin-widgets-resource.class.php +172 -172
  32. base/inc/routes/sowb-rest-routes.php +50 -50
  33. base/inc/video.php +99 -99
  34. base/inc/widget-manager.class.php +198 -198
  35. base/inc/widgets/base-slider.class.php +370 -370
  36. base/js/admin.js +1456 -1453
  37. base/js/admin.min.js +1 -1
  38. base/js/meta-box-manager.js +13 -13
  39. base/less/mixins.less +193 -193
  40. base/siteorigin-widget.class.php +1406 -1406
  41. compat/beaver-builder/beaver-builder.php +98 -98
  42. compat/beaver-builder/sowb-beaver-builder.js +142 -142
  43. compat/block-editor/widget-block.js +303 -299
  44. compat/block-editor/widget-block.min.js +1 -1
  45. compat/block-editor/widget-block.php +102 -102
  46. compat/compat.php +59 -59
  47. compat/elementor/elementor.php +88 -88
  48. compat/elementor/sowb-elementor.js +25 -25
  49. compat/visual-composer/sowb-vc-widget.js +80 -80
  50. compat/visual-composer/visual-composer.php +296 -296
  51. icons/fontawesome/filter.php +1183 -1660
admin/tpl/admin.php CHANGED
@@ -1,137 +1,137 @@
1
- <div class="wrap" id="sow-widgets-page">
2
- <div class="page-banner">
3
-
4
- <span class="icon">
5
- <img src="<?php echo siteorigin_widgets_url( 'admin/images/icon-back.png' )?>" class="icon-back" width="50" height="43">
6
- <img src="<?php echo siteorigin_widgets_url( 'admin/images/icon-gear.png' ) ?>" class="icon-gear" width="26" height="26">
7
- <img src="<?php echo siteorigin_widgets_url( 'admin/images/icon-front.png' ) ?>" class="icon-front" width="50" height="43">
8
- </span>
9
- <h1><?php _e('SiteOrigin Widgets Bundle', 'so-widgets-bundle') ?></h1>
10
-
11
- <div id="sow-widget-search">
12
- <input type="search" placeholder="<?php esc_attr_e('Filter Widgets', 'so-widgets-bundle') ?>" />
13
- </div>
14
- </div>
15
-
16
- <ul class="page-nav">
17
- <li class="active"><a href="#all"><?php _e('All', 'so-widgets-bundle') ?></a></li>
18
- <li><a href="#enabled"><?php _e('Enabled', 'so-widgets-bundle') ?></a></li>
19
- <li><a href="#disabled"><?php _e('Disabled', 'so-widgets-bundle') ?></a></li>
20
- </ul>
21
-
22
-
23
- <div id="widgets-list">
24
-
25
- <?php
26
- foreach( $widgets as $file => $widget ):
27
- $file = wp_normalize_path( $file );
28
- ?>
29
- <div class="so-widget-wrap">
30
- <div class="so-widget so-widget-is-<?php echo $widget['Active'] ? 'active' : 'inactive' ?>" data-id="<?php echo esc_attr( $widget['ID'] ) ?>">
31
-
32
- <?php
33
- $banner = '';
34
- $widget_dir = dirname( $file );
35
- if( file_exists( $widget_dir . '/assets/banner.svg' ) ) {
36
- $banner = str_replace( wp_normalize_path( WP_CONTENT_DIR ), content_url(), $widget_dir ) . '/assets/banner.svg';
37
- }
38
- $banner = apply_filters('siteorigin_widgets_widget_banner', $banner, $widget);
39
- ?>
40
- <div class="so-widget-banner" data-seed="<?php echo esc_attr( substr( md5($widget['ID']), 0, 6 ) ) ?>">
41
- <?php if( !empty( $banner ) ) : ?>
42
- <img src="<?php echo esc_url($banner) ?>" />
43
- <?php endif; ?>
44
- </div>
45
-
46
- <div class="so-widget-text">
47
-
48
- <div class="so-widget-active-indicator"><?php _e('Active', 'so-widgets-bundle') ?></div>
49
-
50
- <h3><?php echo esc_html( $widget['Name'] ); ?></h3>
51
-
52
- <div class="so-widget-description">
53
- <?php echo esc_html( $widget['Description'] ) ?>
54
- </div>
55
-
56
- <?php if( !empty( $widget['Author'] ) ) : ?>
57
- <div class="so-widget-byline">
58
- By
59
- <strong>
60
- <?php
61
- if( !empty($widget['AuthorURI']) ) echo '<a href="' . esc_url( $widget['AuthorURI'] ) . '" target="_blank" rel="noopener noreferrer">';
62
- echo esc_html( $widget['Author'] );
63
- if( !empty($widget['AuthorURI']) ) echo '</a>';
64
- ?>
65
- </strong>
66
- </div>
67
- <?php endif; ?>
68
- <div class="so-action-links">
69
- <div class="so-widget-toggle-active">
70
- <button class="button-secondary so-widget-activate" data-status="1"><?php esc_html_e( 'Activate', 'so-widgets-bundle' ) ?></button>
71
- <button class="button-secondary so-widget-deactivate" data-status="0"><?php esc_html_e( 'Deactivate', 'so-widgets-bundle' ) ?></button>
72
- </div>
73
-
74
- <?php
75
- /** @var SiteOrigin_Widget $widget_object */
76
- $widget_object = !empty( $widget_objects[ $file ] ) ? $widget_objects[ $file ] : false;
77
- if( !empty( $widget_object ) && $widget_object->has_form( 'settings' ) ) {
78
- $rel_path = str_replace( wp_normalize_path( WP_CONTENT_DIR ), '', $file );
79
-
80
- $form_url = add_query_arg( array(
81
- 'id' => $rel_path,
82
- 'action' => 'so_widgets_setting_form',
83
- ),
84
- admin_url( 'admin-ajax.php' )
85
- );
86
- $form_url = wp_nonce_url( $form_url, 'display-widget-form' );
87
-
88
- ?>
89
- <button class="button-secondary so-widget-settings" data-form-url="<?php echo esc_url( $form_url ) ?>">
90
- <?php esc_html_e( 'Settings', 'so-widgets-bundle' ) ?>
91
- </button>
92
- <?php
93
- }
94
- ?>
95
-
96
- <?php if( ! empty( $widget['Documentation'] ) ) : ?>
97
- <a href="<?php echo esc_url( $widget['Documentation'] ) ?>" target="_blank" rel="noopener noreferrer" class="so-widget-documentation">
98
- <?php _e( 'Documentation', 'so-widgets-bundle' ) ?>
99
- </a>
100
- <?php endif; ?>
101
- </div>
102
- </div>
103
-
104
- </div>
105
- </div>
106
- <?php endforeach; ?>
107
-
108
- </div>
109
-
110
- <div class="developers-link">
111
- <?php _e('Developers - create your own widgets for the Widgets Bundle.', 'so-widgets-bundle') ?>
112
- <a href="https://siteorigin.com/docs/widgets-bundle/" target="_blank" rel="noopener noreferrer"><?php _e('Read More', 'so-widgets-bundle') ?></a>.
113
- </div>
114
-
115
- <div id="sow-settings-dialog">
116
- <div class="so-overlay"></div>
117
-
118
- <div class="so-title-bar">
119
- <h3 class="so-title"><?php _e( 'Widget Settings', 'so-widgets-bundle' ) ?></h3>
120
- <a class="so-close">
121
- <span class="so-dialog-icon"></span>
122
- </a>
123
- </div>
124
-
125
- <div class="so-content so-loading">
126
- </div>
127
-
128
- <div class="so-toolbar">
129
- <div class="so-buttons">
130
- <button class="button-primary so-save"><?php _e( 'Save', 'so-widgets-bundle' ) ?></button>
131
- </div>
132
- </div>
133
- </div>
134
-
135
- <iframe id="so-widget-settings-save" name="so-widget-settings-save"></iframe>
136
-
137
- </div>
1
+ <div class="wrap" id="sow-widgets-page">
2
+ <div class="page-banner">
3
+
4
+ <span class="icon">
5
+ <img src="<?php echo siteorigin_widgets_url( 'admin/images/icon-back.png' )?>" class="icon-back" width="50" height="43">
6
+ <img src="<?php echo siteorigin_widgets_url( 'admin/images/icon-gear.png' ) ?>" class="icon-gear" width="26" height="26">
7
+ <img src="<?php echo siteorigin_widgets_url( 'admin/images/icon-front.png' ) ?>" class="icon-front" width="50" height="43">
8
+ </span>
9
+ <h1><?php _e('SiteOrigin Widgets Bundle', 'so-widgets-bundle') ?></h1>
10
+
11
+ <div id="sow-widget-search">
12
+ <input type="search" placeholder="<?php esc_attr_e('Filter Widgets', 'so-widgets-bundle') ?>" />
13
+ </div>
14
+ </div>
15
+
16
+ <ul class="page-nav">
17
+ <li class="active"><a href="#all"><?php _e('All', 'so-widgets-bundle') ?></a></li>
18
+ <li><a href="#enabled"><?php _e('Enabled', 'so-widgets-bundle') ?></a></li>
19
+ <li><a href="#disabled"><?php _e('Disabled', 'so-widgets-bundle') ?></a></li>
20
+ </ul>
21
+
22
+
23
+ <div id="widgets-list">
24
+
25
+ <?php
26
+ foreach( $widgets as $file => $widget ):
27
+ $file = wp_normalize_path( $file );
28
+ ?>
29
+ <div class="so-widget-wrap">
30
+ <div class="so-widget so-widget-is-<?php echo $widget['Active'] ? 'active' : 'inactive' ?>" data-id="<?php echo esc_attr( $widget['ID'] ) ?>">
31
+
32
+ <?php
33
+ $banner = '';
34
+ $widget_dir = dirname( $file );
35
+ if( file_exists( $widget_dir . '/assets/banner.svg' ) ) {
36
+ $banner = str_replace( wp_normalize_path( WP_CONTENT_DIR ), content_url(), $widget_dir ) . '/assets/banner.svg';
37
+ }
38
+ $banner = apply_filters('siteorigin_widgets_widget_banner', $banner, $widget);
39
+ ?>
40
+ <div class="so-widget-banner" data-seed="<?php echo esc_attr( substr( md5($widget['ID']), 0, 6 ) ) ?>">
41
+ <?php if( !empty( $banner ) ) : ?>
42
+ <img src="<?php echo esc_url($banner) ?>" />
43
+ <?php endif; ?>
44
+ </div>
45
+
46
+ <div class="so-widget-text">
47
+
48
+ <div class="so-widget-active-indicator"><?php _e('Active', 'so-widgets-bundle') ?></div>
49
+
50
+ <h3><?php echo esc_html( $widget['Name'] ); ?></h3>
51
+
52
+ <div class="so-widget-description">
53
+ <?php echo esc_html( $widget['Description'] ) ?>
54
+ </div>
55
+
56
+ <?php if( !empty( $widget['Author'] ) ) : ?>
57
+ <div class="so-widget-byline">
58
+ By
59
+ <strong>
60
+ <?php
61
+ if( !empty($widget['AuthorURI']) ) echo '<a href="' . esc_url( $widget['AuthorURI'] ) . '" target="_blank" rel="noopener noreferrer">';
62
+ echo esc_html( $widget['Author'] );
63
+ if( !empty($widget['AuthorURI']) ) echo '</a>';
64
+ ?>
65
+ </strong>
66
+ </div>
67
+ <?php endif; ?>
68
+ <div class="so-action-links">
69
+ <div class="so-widget-toggle-active">
70
+ <button class="button-secondary so-widget-activate" data-status="1"><?php esc_html_e( 'Activate', 'so-widgets-bundle' ) ?></button>
71
+ <button class="button-secondary so-widget-deactivate" data-status="0"><?php esc_html_e( 'Deactivate', 'so-widgets-bundle' ) ?></button>
72
+ </div>
73
+
74
+ <?php
75
+ /** @var SiteOrigin_Widget $widget_object */
76
+ $widget_object = !empty( $widget_objects[ $file ] ) ? $widget_objects[ $file ] : false;
77
+ if( !empty( $widget_object ) && $widget_object->has_form( 'settings' ) ) {
78
+ $rel_path = str_replace( wp_normalize_path( WP_CONTENT_DIR ), '', $file );
79
+
80
+ $form_url = add_query_arg( array(
81
+ 'id' => $rel_path,
82
+ 'action' => 'so_widgets_setting_form',
83
+ ),
84
+ admin_url( 'admin-ajax.php' )
85
+ );
86
+ $form_url = wp_nonce_url( $form_url, 'display-widget-form' );
87
+
88
+ ?>
89
+ <button class="button-secondary so-widget-settings" data-form-url="<?php echo esc_url( $form_url ) ?>">
90
+ <?php esc_html_e( 'Settings', 'so-widgets-bundle' ) ?>
91
+ </button>
92
+ <?php
93
+ }
94
+ ?>
95
+
96
+ <?php if( ! empty( $widget['Documentation'] ) ) : ?>
97
+ <a href="<?php echo esc_url( $widget['Documentation'] ) ?>" target="_blank" rel="noopener noreferrer" class="so-widget-documentation">
98
+ <?php _e( 'Documentation', 'so-widgets-bundle' ) ?>
99
+ </a>
100
+ <?php endif; ?>
101
+ </div>
102
+ </div>
103
+
104
+ </div>
105
+ </div>
106
+ <?php endforeach; ?>
107
+
108
+ </div>
109
+
110
+ <div class="developers-link">
111
+ <?php _e('Developers - create your own widgets for the Widgets Bundle.', 'so-widgets-bundle') ?>
112
+ <a href="https://siteorigin.com/docs/widgets-bundle/" target="_blank" rel="noopener noreferrer"><?php _e('Read More', 'so-widgets-bundle') ?></a>.
113
+ </div>
114
+
115
+ <div id="sow-settings-dialog">
116
+ <div class="so-overlay"></div>
117
+
118
+ <div class="so-title-bar">
119
+ <h3 class="so-title"><?php _e( 'Widget Settings', 'so-widgets-bundle' ) ?></h3>
120
+ <a class="so-close">
121
+ <span class="so-dialog-icon"></span>
122
+ </a>
123
+ </div>
124
+
125
+ <div class="so-content so-loading">
126
+ </div>
127
+
128
+ <div class="so-toolbar">
129
+ <div class="so-buttons">
130
+ <button class="button-primary so-save"><?php _e( 'Save', 'so-widgets-bundle' ) ?></button>
131
+ </div>
132
+ </div>
133
+ </div>
134
+
135
+ <iframe id="so-widget-settings-save" name="so-widget-settings-save"></iframe>
136
+
137
+ </div>
base/base.php CHANGED
@@ -1,294 +1,294 @@
1
- <?php
2
-
3
- include plugin_dir_path(__FILE__).'inc/fields/siteorigin-widget-field-class-loader.class.php';
4
- include plugin_dir_path(__FILE__).'siteorigin-widget.class.php';
5
-
6
- include plugin_dir_path(__FILE__).'inc/widget-manager.class.php';
7
- include plugin_dir_path(__FILE__).'inc/meta-box-manager.php';
8
- include plugin_dir_path(__FILE__).'inc/post-selector.php';
9
- include plugin_dir_path(__FILE__).'inc/string-utils.php';
10
- include plugin_dir_path(__FILE__).'inc/array-utils.php';
11
- include plugin_dir_path(__FILE__).'inc/attachments.php';
12
- include plugin_dir_path(__FILE__).'inc/actions.php';
13
- include plugin_dir_path(__FILE__).'inc/shortcode.php';
14
- include plugin_dir_path(__FILE__).'inc/video.php';
15
- include plugin_dir_path(__FILE__).'inc/routes/sowb-rest-routes.php';
16
-
17
- /**
18
- * @param $css
19
- */
20
- function siteorigin_widget_add_inline_css($css){
21
- global $siteorigin_widgets_inline_styles;
22
- if ( empty( $siteorigin_widgets_inline_styles ) ) {
23
- $siteorigin_widgets_inline_styles = array();
24
- }
25
-
26
- $siteorigin_widgets_inline_styles[] = $css;
27
- }
28
-
29
- /**
30
- * Print any inline styles that have been added with siteorigin_widget_add_inline_css
31
- */
32
- function siteorigin_widget_print_styles(){
33
- global $siteorigin_widgets_inline_styles;
34
- if ( ! empty( $siteorigin_widgets_inline_styles ) ) {
35
- foreach ($siteorigin_widgets_inline_styles as $widget_css) {
36
- ?>
37
- <style type="text/css"><?php echo($widget_css) ?></style><?php
38
- }
39
- }
40
-
41
- $siteorigin_widgets_inline_styles = array();
42
- }
43
- add_action('wp_head', 'siteorigin_widget_print_styles');
44
- add_action('wp_footer', 'siteorigin_widget_print_styles');
45
-
46
- /**
47
- * The ajax handler for getting a list of available icons.
48
- */
49
- function siteorigin_widget_get_icon_list(){
50
- if ( empty( $_REQUEST['_widgets_nonce'] ) || ! wp_verify_nonce( $_REQUEST['_widgets_nonce'], 'widgets_action' ) ) {
51
- wp_die( __( 'Invalid request.', 'so-widgets-bundle' ), 403 );
52
- }
53
-
54
- if ( empty( $_GET['family'] ) ) {
55
- wp_die( __( 'Invalid request.', 'so-widgets-bundle' ), 400 );
56
- }
57
-
58
- $widget_icon_families = apply_filters( 'siteorigin_widgets_icon_families', array() );
59
- $icons = ! empty( $widget_icon_families[ $_GET['family'] ] ) ? $widget_icon_families[ $_GET['family'] ] : array();
60
- wp_send_json( $icons );
61
- }
62
- add_action('wp_ajax_siteorigin_widgets_get_icons', 'siteorigin_widget_get_icon_list');
63
-
64
- /**
65
- * @param $icon_value
66
- * @param bool $icon_styles
67
- *
68
- * @return bool|string
69
- */
70
- function siteorigin_widget_get_icon($icon_value, $icon_styles = false) {
71
- if( empty( $icon_value ) ) return false;
72
- $value_parts = SiteOrigin_Widget_Field_Icon::get_value_parts( $icon_value );
73
- $family = $value_parts['family'];
74
- $style = empty( $value_parts['style'] ) ? null : $value_parts['style'];
75
- $icon = $value_parts['icon'];
76
- if( empty( $family ) || empty( $icon ) ) return false;
77
-
78
- static $widget_icon_families;
79
- static $widget_icons_enqueued = array();
80
-
81
- if ( empty( $widget_icon_families ) ) {
82
- $widget_icon_families = apply_filters('siteorigin_widgets_icon_families', array() );
83
- }
84
- if ( empty( $widget_icon_families[ $family ] ) ||
85
- empty( $widget_icon_families[ $family ]['icons'][ $icon ] ) ) {
86
- return false;
87
- }
88
-
89
- if ( empty( $widget_icons_enqueued[ $family ] ) &&
90
- ! empty( $widget_icon_families[ $family ]['style_uri'] ) ) {
91
- if( ! wp_style_is( 'siteorigin-widget-icon-font-'.$family ) ) {
92
- wp_enqueue_style( 'siteorigin-widget-icon-font-' . $family, $widget_icon_families[ $family ]['style_uri'] );
93
- }
94
- $family_style = 'sow-icon-' . $family . ( empty( $style ) ? '' : ' ' . $style );
95
- $icon_data = $widget_icon_families[ $family ]['icons'][ $icon ];
96
- $unicode = '';
97
- if ( is_array($icon_data) && ! empty( $icon_data['unicode'] ) ) {
98
- $unicode = $icon_data['unicode'];
99
- } else if ( is_string( $icon_data ) ) {
100
- $unicode = $icon_data;
101
- }
102
- return '<span class="' . esc_attr( $family_style ) . '" data-sow-icon="' . $unicode . '" ' . ( ! empty( $icon_styles ) ? 'style="' . implode( '; ', $icon_styles ) . '"' : '' ) . '></span>';
103
- }
104
- else {
105
- return false;
106
- }
107
-
108
- }
109
-
110
- /**
111
- * @param $font_value
112
- *
113
- * @return array
114
- */
115
- function siteorigin_widget_get_font($font_value) {
116
-
117
- $web_safe = array(
118
- 'Arial' => 'Arial, "Helvetica Neue", Helvetica, sans-serif',
119
- 'Helvetica Neue' => '"Helvetica Neue", Helvetica, Arial, sans-serif',
120
- 'Lucida Grande' => 'Lucida, Verdana, sans-serif',
121
- 'Georgia' => '"Times New Roman", Times, serif',
122
- 'Courier New' => 'Courier, mono',
123
- 'default' => 'default',
124
- );
125
-
126
- $font = array();
127
- if ( isset( $web_safe[ $font_value ] ) ) {
128
- $font['family'] = $web_safe[ $font_value ];
129
- }
130
- else if( siteorigin_widgets_is_google_webfont( $font_value ) ) {
131
- $font_parts = explode( ':', $font_value );
132
- $font['family'] = $font_parts[0];
133
- $font_url_param = urlencode( $font_parts[0] );
134
- if ( count( $font_parts ) > 1 ) {
135
- $font['weight'] = $font_parts[1];
136
- $font_url_param .= ':' . $font_parts[1];
137
- }
138
- $font['url'] = 'https://fonts.googleapis.com/css?family=' . $font_url_param;
139
- $font['css_import'] = '@import url(https://fonts.googleapis.com/css?family=' . $font_url_param . ');';
140
- }
141
- else {
142
- $font['family'] = $font_value;
143
- $font = apply_filters( 'siteorigin_widget_get_custom_font_family', $font );
144
- }
145
-
146
- return $font;
147
- }
148
-
149
- /**
150
- * Compatibility with Page Builder, add the groups and icons.
151
- *
152
- * @param $widgets
153
- *
154
- * @return mixed
155
- */
156
- function siteorigin_widget_add_bundle_groups($widgets){
157
- foreach( $widgets as $class => &$widget ) {
158
- if( preg_match('/SiteOrigin_Widgets?_(.*)_Widget/i', $class, $matches) ) {
159
- $widget['icon'] = 'so-widget-icon so-widget-icon-'.strtolower($matches[1]);
160
- $widget['groups'] = array('so-widgets-bundle');
161
- }
162
- }
163
-
164
- return $widgets;
165
- }
166
- add_filter('siteorigin_panels_widgets', 'siteorigin_widget_add_bundle_groups', 11);
167
-
168
- /**
169
- * Escape a URL
170
- *
171
- * @param $url
172
- *
173
- * @return string
174
- */
175
- function sow_esc_url( $url ) {
176
- if( preg_match('/^post: *([0-9]+)/', $url, $matches) ) {
177
- // Convert the special post URL into a permalink
178
- $url = get_the_permalink( intval($matches[1]) );
179
- if( empty($url) ) return '';
180
- }
181
-
182
- $protocols = wp_allowed_protocols();
183
- $protocols[] = 'skype';
184
- return esc_url( $url, $protocols );
185
- }
186
-
187
- /**
188
- * A special URL escaping function that handles additional protocols
189
- *
190
- * @param $url
191
- *
192
- * @return string
193
- */
194
- function sow_esc_url_raw( $url ) {
195
- if( preg_match('/^post: *([0-9]+)/', $url, $matches) ) {
196
- // Convert the special post URL into a permalink
197
- $url = get_the_permalink( intval($matches[1]) );
198
- }
199
-
200
- $protocols = wp_allowed_protocols();
201
- $protocols[] = 'skype';
202
- return esc_url_raw( $url, $protocols );
203
- }
204
-
205
- /**
206
- * Escape an HTML attribute
207
- *
208
- * This is a copy of the WP core `esc_attr` function, but modified to allow specifying arguments to the
209
- * `_wp_specialchars` function for a bit more control. This was specifically necessary to allow double-encoding for
210
- * the layout builder field.
211
- *
212
- * @param $text
213
- * @param int $quote_style
214
- * @param bool $charset
215
- * @param bool $double_encode
216
- *
217
- * @return string
218
- */
219
- function sow_esc_attr( $text, $quote_style = ENT_QUOTES, $charset = false, $double_encode = false ) {
220
- $safe_text = wp_check_invalid_utf8( $text );
221
- $safe_text = _wp_specialchars( $safe_text, $quote_style, $charset, $double_encode );
222
- return apply_filters( 'attribute_escape', $safe_text, $text );
223
- }
224
-
225
- /**
226
- * Get all the Google Web Fonts.
227
- *
228
- * @return mixed|void
229
- */
230
- function siteorigin_widgets_fonts_google_webfonts( ) {
231
- $fonts = include plugin_dir_path( __FILE__ ) . 'inc/fonts.php';
232
- $fonts = apply_filters( 'siteorigin_widgets_google_webfonts', $fonts );
233
- return !empty( $fonts ) ? $fonts : array();
234
- }
235
-
236
- function siteorigin_widgets_is_google_webfont( $font_value ) {
237
- $google_webfonts = siteorigin_widgets_fonts_google_webfonts();
238
-
239
- $font_family = explode( ':', $font_value );
240
- $font_family = $font_family[0];
241
-
242
- return isset( $google_webfonts[$font_family] );
243
- }
244
-
245
- function siteorigin_widgets_font_families( ){
246
- // Add the default fonts
247
- $font_families = array(
248
- 'Arial' => 'Arial',
249
- 'Helvetica Neue' => 'Helvetica Neue',
250
- 'Lucida Grande' => 'Lucida Grande',
251
- 'Georgia' => 'Georgia',
252
- 'Courier New' => 'Courier New',
253
- );
254
-
255
- // Add in all the Google font families
256
- foreach ( siteorigin_widgets_fonts_google_webfonts() as $font => $variants ) {
257
- foreach ( $variants as $variant ) {
258
- if ( $variant == 'regular' || $variant == 400 ) {
259
- $font_families[ $font ] = $font;
260
- }
261
- else {
262
- $font_families[ $font . ':' . $variant ] = $font . ' (' . $variant . ')';
263
- }
264
- }
265
- }
266
-
267
- return apply_filters('siteorigin_widgets_font_families', $font_families);
268
- }
269
-
270
- /**
271
- * Get list of supported measurements
272
- *
273
- * @return array
274
- */
275
- function siteorigin_widgets_get_measurements_list() {
276
- $measurements = array(
277
- 'px', '%', 'in', 'cm', 'mm', 'em', 'rem', 'pt', 'pc', 'ex', 'ch', 'vw', 'vh', 'vmin', 'vmax',
278
- );
279
-
280
- // Allow themes and plugins to trim or enhance the list.
281
- return apply_filters('siteorigin_widgets_get_measurements_list', $measurements);
282
- }
283
-
284
-
285
- /**
286
- * Returns the base URL of our widget with `$path` appended.
287
- *
288
- * @param string $path Extra path to append to the end of the URL.
289
- *
290
- * @return string Base URL of the widget, with $path appended.
291
- */
292
- function siteorigin_widgets_url( $path = '' ) {
293
- return plugins_url( 'so-widgets-bundle/' . $path );
294
- }
1
+ <?php
2
+
3
+ include plugin_dir_path(__FILE__).'inc/fields/siteorigin-widget-field-class-loader.class.php';
4
+ include plugin_dir_path(__FILE__).'siteorigin-widget.class.php';
5
+
6
+ include plugin_dir_path(__FILE__).'inc/widget-manager.class.php';
7
+ include plugin_dir_path(__FILE__).'inc/meta-box-manager.php';
8
+ include plugin_dir_path(__FILE__).'inc/post-selector.php';
9
+ include plugin_dir_path(__FILE__).'inc/string-utils.php';
10
+ include plugin_dir_path(__FILE__).'inc/array-utils.php';
11
+ include plugin_dir_path(__FILE__).'inc/attachments.php';
12
+ include plugin_dir_path(__FILE__).'inc/actions.php';
13
+ include plugin_dir_path(__FILE__).'inc/shortcode.php';
14
+ include plugin_dir_path(__FILE__).'inc/video.php';
15
+ include plugin_dir_path(__FILE__).'inc/routes/sowb-rest-routes.php';
16
+
17
+ /**
18
+ * @param $css
19
+ */
20
+ function siteorigin_widget_add_inline_css($css){
21
+ global $siteorigin_widgets_inline_styles;
22
+ if ( empty( $siteorigin_widgets_inline_styles ) ) {
23
+ $siteorigin_widgets_inline_styles = array();
24
+ }
25
+
26
+ $siteorigin_widgets_inline_styles[] = $css;
27
+ }
28
+
29
+ /**
30
+ * Print any inline styles that have been added with siteorigin_widget_add_inline_css
31
+ */
32
+ function siteorigin_widget_print_styles(){
33
+ global $siteorigin_widgets_inline_styles;
34
+ if ( ! empty( $siteorigin_widgets_inline_styles ) ) {
35
+ foreach ($siteorigin_widgets_inline_styles as $widget_css) {
36
+ ?>
37
+ <style type="text/css"><?php echo($widget_css) ?></style><?php
38
+ }
39
+ }
40
+
41
+ $siteorigin_widgets_inline_styles = array();
42
+ }
43
+ add_action('wp_head', 'siteorigin_widget_print_styles');
44
+ add_action('wp_footer', 'siteorigin_widget_print_styles');
45
+
46
+ /**
47
+ * The ajax handler for getting a list of available icons.
48
+ */
49
+ function siteorigin_widget_get_icon_list(){
50
+ if ( empty( $_REQUEST['_widgets_nonce'] ) || ! wp_verify_nonce( $_REQUEST['_widgets_nonce'], 'widgets_action' ) ) {
51
+ wp_die( __( 'Invalid request.', 'so-widgets-bundle' ), 403 );
52
+ }
53
+
54
+ if ( empty( $_GET['family'] ) ) {
55
+ wp_die( __( 'Invalid request.', 'so-widgets-bundle' ), 400 );
56
+ }
57
+
58
+ $widget_icon_families = apply_filters( 'siteorigin_widgets_icon_families', array() );
59
+ $icons = ! empty( $widget_icon_families[ $_GET['family'] ] ) ? $widget_icon_families[ $_GET['family'] ] : array();
60
+ wp_send_json( $icons );
61
+ }
62
+ add_action('wp_ajax_siteorigin_widgets_get_icons', 'siteorigin_widget_get_icon_list');
63
+
64
+ /**
65
+ * @param $icon_value
66
+ * @param bool $icon_styles
67
+ *
68
+ * @return bool|string
69
+ */
70
+ function siteorigin_widget_get_icon($icon_value, $icon_styles = false) {
71
+ if( empty( $icon_value ) ) return false;
72
+ $value_parts = SiteOrigin_Widget_Field_Icon::get_value_parts( $icon_value );
73
+ $family = $value_parts['family'];
74
+ $style = empty( $value_parts['style'] ) ? null : $value_parts['style'];
75
+ $icon = $value_parts['icon'];
76
+ if( empty( $family ) || empty( $icon ) ) return false;
77
+
78
+ static $widget_icon_families;
79
+ static $widget_icons_enqueued = array();
80
+
81
+ if ( empty( $widget_icon_families ) ) {
82
+ $widget_icon_families = apply_filters('siteorigin_widgets_icon_families', array() );
83
+ }
84
+ if ( empty( $widget_icon_families[ $family ] ) ||
85
+ empty( $widget_icon_families[ $family ]['icons'][ $icon ] ) ) {
86
+ return false;
87
+ }
88
+
89
+ if ( empty( $widget_icons_enqueued[ $family ] ) &&
90
+ ! empty( $widget_icon_families[ $family ]['style_uri'] ) ) {
91
+ if( ! wp_style_is( 'siteorigin-widget-icon-font-'.$family ) ) {
92
+ wp_enqueue_style( 'siteorigin-widget-icon-font-' . $family, $widget_icon_families[ $family ]['style_uri'] );
93
+ }
94
+ $family_style = 'sow-icon-' . $family . ( empty( $style ) ? '' : ' ' . $style );
95
+ $icon_data = $widget_icon_families[ $family ]['icons'][ $icon ];
96
+ $unicode = '';
97
+ if ( is_array($icon_data) && ! empty( $icon_data['unicode'] ) ) {
98
+ $unicode = $icon_data['unicode'];
99
+ } else if ( is_string( $icon_data ) ) {
100
+ $unicode = $icon_data;
101
+ }
102
+ return '<span class="' . esc_attr( $family_style ) . '" data-sow-icon="' . $unicode . '" ' . ( ! empty( $icon_styles ) ? 'style="' . implode( '; ', $icon_styles ) . '"' : '' ) . '></span>';
103
+ }
104
+ else {
105
+ return false;
106
+ }
107
+
108
+ }
109
+
110
+ /**
111
+ * @param $font_value
112
+ *
113
+ * @return array
114
+ */
115
+ function siteorigin_widget_get_font($font_value) {
116
+
117
+ $web_safe = array(
118
+ 'Arial' => 'Arial, "Helvetica Neue", Helvetica, sans-serif',
119
+ 'Helvetica Neue' => '"Helvetica Neue", Helvetica, Arial, sans-serif',
120
+ 'Lucida Grande' => 'Lucida, Verdana, sans-serif',
121
+ 'Georgia' => '"Times New Roman", Times, serif',
122
+ 'Courier New' => 'Courier, mono',
123
+ 'default' => 'default',
124
+ );
125
+
126
+ $font = array();
127
+ if ( isset( $web_safe[ $font_value ] ) ) {
128
+ $font['family'] = $web_safe[ $font_value ];
129
+ }
130
+ else if( siteorigin_widgets_is_google_webfont( $font_value ) ) {
131
+ $font_parts = explode( ':', $font_value );
132
+ $font['family'] = $font_parts[0];
133
+ $font_url_param = urlencode( $font_parts[0] );
134
+ if ( count( $font_parts ) > 1 ) {
135
+ $font['weight'] = $font_parts[1];
136
+ $font_url_param .= ':' . $font_parts[1];
137
+ }
138
+ $font['url'] = 'https://fonts.googleapis.com/css?family=' . $font_url_param;
139
+ $font['css_import'] = '@import url(https://fonts.googleapis.com/css?family=' . $font_url_param . ');';
140
+ }
141
+ else {
142
+ $font['family'] = $font_value;
143
+ $font = apply_filters( 'siteorigin_widget_get_custom_font_family', $font );
144
+ }
145
+
146
+ return $font;
147
+ }
148
+
149
+ /**
150
+ * Compatibility with Page Builder, add the groups and icons.
151
+ *
152
+ * @param $widgets
153
+ *
154
+ * @return mixed
155
+ */
156
+ function siteorigin_widget_add_bundle_groups($widgets){
157
+ foreach( $widgets as $class => &$widget ) {
158
+ if( preg_match('/SiteOrigin_Widgets?_(.*)_Widget/i', $class, $matches) ) {
159
+ $widget['icon'] = 'so-widget-icon so-widget-icon-'.strtolower($matches[1]);
160
+ $widget['groups'] = array('so-widgets-bundle');
161
+ }
162
+ }
163
+
164
+ return $widgets;
165
+ }
166
+ add_filter('siteorigin_panels_widgets', 'siteorigin_widget_add_bundle_groups', 11);
167
+
168
+ /**
169
+ * Escape a URL
170
+ *
171
+ * @param $url
172
+ *
173
+ * @return string
174
+ */
175
+ function sow_esc_url( $url ) {
176
+ if( preg_match('/^post: *([0-9]+)/', $url, $matches) ) {
177
+ // Convert the special post URL into a permalink
178
+ $url = get_the_permalink( intval($matches[1]) );
179
+ if( empty($url) ) return '';
180
+ }
181
+
182
+ $protocols = wp_allowed_protocols();
183
+ $protocols[] = 'skype';
184
+ return esc_url( $url, $protocols );
185
+ }
186
+
187
+ /**
188
+ * A special URL escaping function that handles additional protocols
189
+ *
190
+ * @param $url
191
+ *
192
+ * @return string
193
+ */
194
+ function sow_esc_url_raw( $url ) {
195
+ if( preg_match('/^post: *([0-9]+)/', $url, $matches) ) {
196
+ // Convert the special post URL into a permalink
197
+ $url = get_the_permalink( intval($matches[1]) );
198
+ }
199
+
200
+ $protocols = wp_allowed_protocols();
201
+ $protocols[] = 'skype';
202
+ return esc_url_raw( $url, $protocols );
203
+ }
204
+
205
+ /**
206
+ * Escape an HTML attribute
207
+ *
208
+ * This is a copy of the WP core `esc_attr` function, but modified to allow specifying arguments to the
209
+ * `_wp_specialchars` function for a bit more control. This was specifically necessary to allow double-encoding for
210
+ * the layout builder field.
211
+ *
212
+ * @param $text
213
+ * @param int $quote_style
214
+ * @param bool $charset
215
+ * @param bool $double_encode
216
+ *
217
+ * @return string
218
+ */
219
+ function sow_esc_attr( $text, $quote_style = ENT_QUOTES, $charset = false, $double_encode = false ) {
220
+ $safe_text = wp_check_invalid_utf8( $text );
221
+ $safe_text = _wp_specialchars( $safe_text, $quote_style, $charset, $double_encode );
222
+ return apply_filters( 'attribute_escape', $safe_text, $text );
223
+ }
224
+
225
+ /**
226
+ * Get all the Google Web Fonts.
227
+ *
228
+ * @return mixed|void
229
+ */
230
+ function siteorigin_widgets_fonts_google_webfonts( ) {
231
+ $fonts = include plugin_dir_path( __FILE__ ) . 'inc/fonts.php';
232
+ $fonts = apply_filters( 'siteorigin_widgets_google_webfonts', $fonts );
233
+ return !empty( $fonts ) ? $fonts : array();
234
+ }
235
+
236
+ function siteorigin_widgets_is_google_webfont( $font_value ) {
237
+ $google_webfonts = siteorigin_widgets_fonts_google_webfonts();
238
+
239
+ $font_family = explode( ':', $font_value );
240
+ $font_family = $font_family[0];
241
+
242
+ return isset( $google_webfonts[$font_family] );
243
+ }
244
+
245
+ function siteorigin_widgets_font_families( ){
246
+ // Add the default fonts
247
+ $font_families = array(
248
+ 'Arial' => 'Arial',
249
+ 'Helvetica Neue' => 'Helvetica Neue',
250
+ 'Lucida Grande' => 'Lucida Grande',
251
+ 'Georgia' => 'Georgia',
252
+ 'Courier New' => 'Courier New',
253
+ );
254
+
255
+ // Add in all the Google font families
256
+ foreach ( siteorigin_widgets_fonts_google_webfonts() as $font => $variants ) {
257
+ foreach ( $variants as $variant ) {
258
+ if ( $variant == 'regular' || $variant == 400 ) {
259
+ $font_families[ $font ] = $font;
260
+ }
261
+ else {
262
+ $font_families[ $font . ':' . $variant ] = $font . ' (' . $variant . ')';
263
+ }
264
+ }
265
+ }
266
+
267
+ return apply_filters('siteorigin_widgets_font_families', $font_families);
268
+ }
269
+
270
+ /**
271
+ * Get list of supported measurements
272
+ *
273
+ * @return array
274
+ */
275
+ function siteorigin_widgets_get_measurements_list() {
276
+ $measurements = array(
277
+ 'px', '%', 'in', 'cm', 'mm', 'em', 'rem', 'pt', 'pc', 'ex', 'ch', 'vw', 'vh', 'vmin', 'vmax',
278
+ );
279
+
280
+ // Allow themes and plugins to trim or enhance the list.
281
+ return apply_filters('siteorigin_widgets_get_measurements_list', $measurements);
282
+ }
283
+
284
+
285
+ /**
286
+ * Returns the base URL of our widget with `$path` appended.
287
+ *
288
+ * @param string $path Extra path to append to the end of the URL.
289
+ *
290
+ * @return string Base URL of the widget, with $path appended.
291
+ */
292
+ function siteorigin_widgets_url( $path = '' ) {
293
+ return plugins_url( 'so-widgets-bundle/' . $path );
294
+ }
base/inc/actions.php CHANGED
@@ -1,282 +1,282 @@
1
- <?php
2
-
3
- /**
4
- * Action for displaying the widget preview.
5
- */
6
- function siteorigin_widget_preview_widget_action() {
7
- if (
8
- empty( $_REQUEST['_widgets_nonce'] ) ||
9
- ! wp_verify_nonce( $_REQUEST['_widgets_nonce'], 'widgets_action' )
10
- ) {
11
- wp_die( __( 'Invalid request.', 'so-widgets-bundle' ), 403 );
12
- } else if ( empty( $_POST['class'] ) ) {
13
- wp_die( __( 'Invalid widget.', 'so-widgets-bundle' ), 400 );
14
- }
15
-
16
- // Get the widget from the widget factory
17
- global $wp_widget_factory;
18
- $widget_class = str_replace('\\\\', '\\', $_POST['class']);
19
-
20
- $widget = ! empty( $wp_widget_factory->widgets[ $widget_class ] ) ? $wp_widget_factory->widgets[ $widget_class ] : false;
21
-
22
- if( ! is_a( $widget, 'SiteOrigin_Widget' ) ) {
23
- wp_die( __( 'Invalid post.', 'so-widgets-bundle' ), 400 );
24
- }
25
-
26
- $instance = json_decode( stripslashes_deep($_POST['data']), true);
27
- /* @var $widget SiteOrigin_Widget */
28
- $instance = $widget->update( $instance, $instance );
29
- $instance['is_preview'] = true;
30
-
31
- // The theme stylesheet will change how the button looks
32
- wp_enqueue_style( 'theme-css', get_stylesheet_uri(), array(), rand( 0, 65536 ) );
33
- wp_enqueue_style( 'so-widget-preview', siteorigin_widgets_url( 'base/css/preview.css' ), array(), rand( 0,65536 ) );
34
-
35
- $sowb = SiteOrigin_Widgets_Bundle::single();
36
- $sowb->register_general_scripts();
37
-
38
- do_action( 'siteorigin_widgets_render_preview_' . $widget->id_base, $widget );
39
-
40
- ob_start();
41
- $widget->widget( array(
42
- 'before_widget' => '',
43
- 'after_widget' => '',
44
- 'before_title' => '<h3 class="widget-title">',
45
- 'after_title' => '</h3>',
46
- ), $instance);
47
- $widget_html = ob_get_clean();
48
-
49
- // Print all the scripts and styles
50
- ?>
51
- <html>
52
- <head>
53
- <title><?php _e('Widget Preview', 'so-widgets-bundle') ?></title>
54
- <?php
55
- wp_print_scripts();
56
- wp_print_styles();
57
- ?>
58
- </head>
59
- <body>
60
- <?php // A lot of themes use entry-content as their main content wrapper ?>
61
- <div class="entry-content">
62
- <?php echo $widget_html ?>
63
- </div>
64
- </body>
65
- </html>
66
-
67
- <?php
68
- wp_die();
69
- }
70
- add_action('wp_ajax_so_widgets_preview', 'siteorigin_widget_preview_widget_action');
71
-
72
- /**
73
- * Action to handle searching posts
74
- */
75
- function siteorigin_widget_action_search_posts() {
76
- if ( empty( $_REQUEST['_widgets_nonce'] ) || ! wp_verify_nonce( $_REQUEST['_widgets_nonce'], 'widgets_action' ) ) {
77
- wp_die( __( 'Invalid request.', 'so-widgets-bundle' ), 403 );
78
- }
79
-
80
- // Get all public post types, besides attachments
81
- $post_types = (array) get_post_types( array(
82
- 'public' => true,
83
- ) );
84
-
85
- if ( ! empty( $_REQUEST['postTypes'] ) ) {
86
- $post_types = array_intersect( explode( ',', $_REQUEST['postTypes'] ), $post_types );
87
- } else {
88
- unset( $post_types['attachment'] );
89
- }
90
-
91
- $post_types = apply_filters( 'siteorigin_widgets_search_posts_post_types', $post_types );
92
-
93
- global $wpdb;
94
- if( !empty($_GET['query']) ) {
95
- $query = "AND post_title LIKE '%" . esc_sql( $_GET['query'] ) . "%'";
96
- }
97
- else {
98
- $query = '';
99
- }
100
-
101
- $post_types = "'" . implode("', '", array_map( 'esc_sql', $post_types ) ) . "'";
102
-
103
- $results = $wpdb->get_results( "
104
- SELECT ID AS 'value', post_title AS label, post_type AS 'type'
105
- FROM {$wpdb->posts}
106
- WHERE
107
- post_type IN ( {$post_types} ) AND post_status = 'publish' {$query}
108
- ORDER BY post_modified DESC
109
- LIMIT 20
110
- ", ARRAY_A );
111
-
112
- wp_send_json( apply_filters( 'siteorigin_widgets_search_posts_results', $results ) );
113
- }
114
- add_action('wp_ajax_so_widgets_search_posts', 'siteorigin_widget_action_search_posts');
115
-
116
- /**
117
- * Action to handle searching taxonomy terms.
118
- */
119
- function siteorigin_widget_action_search_terms() {
120
- if ( empty( $_REQUEST['_widgets_nonce'] ) || ! wp_verify_nonce( $_REQUEST['_widgets_nonce'], 'widgets_action' ) ) {
121
- wp_die( __( 'Invalid request.', 'so-widgets-bundle' ), 403 );
122
- }
123
-
124
- global $wpdb;
125
- $term = ! empty($_GET['term']) ? stripslashes($_GET['term']) : '';
126
- $term = trim($term, '%');
127
-
128
- $query = $wpdb->prepare("
129
- SELECT terms.term_id, terms.slug AS 'value', terms.name AS 'label', termtaxonomy.taxonomy AS 'type'
130
- FROM $wpdb->terms AS terms
131
- JOIN $wpdb->term_taxonomy AS termtaxonomy ON terms.term_id = termtaxonomy.term_id
132
- WHERE
133
- terms.name LIKE '%s'
134
- LIMIT 20
135
- ", '%' . esc_sql( $term ) . '%');
136
-
137
- $results = array();
138
-
139
- foreach ( $wpdb->get_results( $query ) as $result ) {
140
- $results[] = array(
141
- 'value' => $result->type . ':' . $result->value,
142
- 'label' => $result->label,
143
- 'type' => $result->type,
144
- );
145
- }
146
-
147
- wp_send_json( $results );
148
- }
149
- add_action('wp_ajax_so_widgets_search_terms', 'siteorigin_widget_action_search_terms');
150
-
151
- /**
152
- * Action for getting the number of posts returned by a query.
153
- */
154
- function siteorigin_widget_get_posts_count_action() {
155
-
156
- if ( empty( $_REQUEST['_widgets_nonce'] ) || ! wp_verify_nonce( $_REQUEST['_widgets_nonce'], 'widgets_action' ) ) {
157
- wp_die( __( 'Invalid request.', 'so-widgets-bundle' ), 403 );
158
- }
159
-
160
- $query = stripslashes( $_POST['query'] );
161
-
162
- wp_send_json( array( 'posts_count' => siteorigin_widget_post_selector_count_posts( $query ) ) );
163
- }
164
-
165
- add_action( 'wp_ajax_sow_get_posts_count', 'siteorigin_widget_get_posts_count_action' );
166
-
167
-
168
- function siteorigin_widget_remote_image_search(){
169
- if( empty( $_GET[ '_sononce' ] ) || ! wp_verify_nonce( $_GET[ '_sononce' ], 'so-image' ) ) {
170
- wp_die( __( 'Invalid request.', 'so-widgets-bundle' ), 403 );
171
- }
172
-
173
- if( empty( $_GET['q'] ) ) {
174
- wp_die( __( 'Invalid request.', 'so-widgets-bundle' ), 400 );
175
- }
176
-
177
- // Send the query to stock search server
178
- $url = add_query_arg( array(
179
- 'q' => $_GET[ 'q' ],
180
- 'page' => !empty( $_GET[ 'page' ] ) ? intval( $_GET[ 'page' ] ) : 1,
181
- ), 'http://stock.siteorigin.com/wp-admin/admin-ajax.php?action=image_search' );
182
-
183
- $result = wp_remote_get( $url, array(
184
- 'timeout' => 20,
185
- ) );
186
-
187
- if( ! is_wp_error( $result ) ) {
188
- $result = json_decode( $result['body'], true );
189
- if( !empty( $result['items'] ) ) {
190
- foreach( $result['items'] as & $r ) {
191
- if( !empty( $r['full_url'] ) ) {
192
- $r['import_signature'] = md5( $r['full_url'] . '::' . NONCE_SALT );
193
- }
194
- }
195
- }
196
- wp_send_json( $result );
197
- }
198
- else {
199
- $result = array(
200
- 'error' => true,
201
- 'message' => $result->get_error_message()
202
- );
203
- wp_send_json_error( $result );
204
- }
205
-
206
- }
207
- add_action('wp_ajax_so_widgets_image_search', 'siteorigin_widget_remote_image_search');
208
-
209
- function siteorigin_widget_image_import(){
210
- if( empty( $_GET[ '_sononce' ] ) || ! wp_verify_nonce( $_GET[ '_sononce' ], 'so-image' ) ) {
211
- $result = array(
212
- 'error' => true,
213
- 'message' => __( 'Nonce error', 'so-widgets-bundle' ),
214
- );
215
- }
216
- else if(
217
- empty( $_GET['import_signature'] ) ||
218
- empty( $_GET['full_url'] ) ||
219
- md5( $_GET['full_url'] . '::' . NONCE_SALT ) !== $_GET['import_signature']
220
- ) {
221
- $result = array(
222
- 'error' => true,
223
- 'message' => __( 'Signature error', 'so-widgets-bundle' ),
224
- );
225
- }
226
- else {
227
- // Fetch the image
228
- $src = media_sideload_image( $_GET['full_url'], $_GET['post_id'], null, 'src' );
229
- if( is_wp_error( $src ) ) {
230
- $result = array(
231
- 'error' => true,
232
- 'message' => $src->get_error_code(),
233
- );
234
- }
235
- else {
236
- global $wpdb;
237
- $attachment = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE guid='%s';", $src ) );
238
- if( !empty( $attachment ) ) {
239
- $thumb_src = wp_get_attachment_image_src( $attachment[0], 'thumbnail' );
240
- $result = array(
241
- 'error' => false,
242
- 'attachment_id' => $attachment[0],
243
- 'thumb' => $thumb_src[0]
244
- );
245
- }
246
- else {
247
- $result = array(
248
- 'error' => true,
249
- 'message' => __( 'Attachment error', 'so-widgets-bundle' ),
250
- );
251
- }
252
- }
253
- }
254
-
255
- // Return the result
256
- wp_send_json( $result );
257
- }
258
- add_action('wp_ajax_so_widgets_image_import', 'siteorigin_widget_image_import');
259
-
260
- /**
261
- * Action to handle a user dismissing a teaser notice.
262
- */
263
- function siteorigin_widgets_dismiss_widget_action(){
264
- if( empty( $_GET[ '_wpnonce' ] ) || ! wp_verify_nonce( $_GET[ '_wpnonce' ], 'dismiss-widget-teaser' ) ) {
265
- wp_die( __( 'Invalid request.', 'so-widgets-bundle' ), 403 );
266
- }
267
- if( empty( $_GET[ 'widget' ] ) ) {
268
- wp_die( __( 'Invalid request.', 'so-widgets-bundle' ), 400 );
269
- }
270
-
271
- $dismissed = get_user_meta( get_current_user_id(), 'teasers_dismissed', true );
272
- if( empty( $dismissed ) ) {
273
- $dismissed = array();
274
- }
275
-
276
- $dismissed[ $_GET[ 'widget' ] ] = true;
277
-
278
- update_user_meta( get_current_user_id(), 'teasers_dismissed', $dismissed );
279
-
280
- wp_die();
281
- }
282
- add_action( 'wp_ajax_so_dismiss_widget_teaser', 'siteorigin_widgets_dismiss_widget_action' );
1
+ <?php
2
+
3
+ /**
4
+ * Action for displaying the widget preview.
5
+ */
6
+ function siteorigin_widget_preview_widget_action() {
7
+ if (
8
+ empty( $_REQUEST['_widgets_nonce'] ) ||
9
+ ! wp_verify_nonce( $_REQUEST['_widgets_nonce'], 'widgets_action' )
10
+ ) {
11
+ wp_die( __( 'Invalid request.', 'so-widgets-bundle' ), 403 );
12
+ } else if ( empty( $_POST['class'] ) ) {
13
+ wp_die( __( 'Invalid widget.', 'so-widgets-bundle' ), 400 );
14
+ }
15
+
16
+ // Get the widget from the widget factory
17
+ global $wp_widget_factory;
18
+ $widget_class = str_replace('\\\\', '\\', $_POST['class']);
19
+
20
+ $widget = ! empty( $wp_widget_factory->widgets[ $widget_class ] ) ? $wp_widget_factory->widgets[ $widget_class ] : false;
21
+
22
+ if( ! is_a( $widget, 'SiteOrigin_Widget' ) ) {
23
+ wp_die( __( 'Invalid post.', 'so-widgets-bundle' ), 400 );
24
+ }
25
+
26
+ $instance = json_decode( stripslashes_deep($_POST['data']), true);
27
+ /* @var $widget SiteOrigin_Widget */
28
+ $instance = $widget->update( $instance, $instance );
29
+ $instance['is_preview'] = true;
30
+
31
+ // The theme stylesheet will change how the button looks
32
+ wp_enqueue_style( 'theme-css', get_stylesheet_uri(), array(), rand( 0, 65536 ) );
33
+ wp_enqueue_style( 'so-widget-preview', siteorigin_widgets_url( 'base/css/preview.css' ), array(), rand( 0,65536 ) );
34
+
35
+ $sowb = SiteOrigin_Widgets_Bundle::single();
36
+ $sowb->register_general_scripts();
37
+
38
+ do_action( 'siteorigin_widgets_render_preview_' . $widget->id_base, $widget );
39
+
40
+ ob_start();
41
+ $widget->widget( array(
42
+ 'before_widget' => '',
43
+ 'after_widget' => '',
44
+ 'before_title' => '<h3 class="widget-title">',
45
+ 'after_title' => '</h3>',
46
+ ), $instance);
47
+ $widget_html = ob_get_clean();
48
+
49
+ // Print all the scripts and styles
50
+ ?>
51
+ <html>
52
+ <head>
53
+ <title><?php _e('Widget Preview', 'so-widgets-bundle') ?></title>
54
+ <?php
55
+ wp_print_scripts();
56
+ wp_print_styles();
57
+ ?>
58
+ </head>
59
+ <body>
60
+ <?php // A lot of themes use entry-content as their main content wrapper ?>
61
+ <div class="entry-content">
62
+ <?php echo $widget_html ?>
63
+ </div>
64
+ </body>
65
+ </html>
66
+
67
+ <?php
68
+ wp_die();
69
+ }
70
+ add_action('wp_ajax_so_widgets_preview', 'siteorigin_widget_preview_widget_action');
71
+
72
+ /**
73
+ * Action to handle searching posts
74
+ */
75
+ function siteorigin_widget_action_search_posts() {
76
+ if ( empty( $_REQUEST['_widgets_nonce'] ) || ! wp_verify_nonce( $_REQUEST['_widgets_nonce'], 'widgets_action' ) ) {
77
+ wp_die( __( 'Invalid request.', 'so-widgets-bundle' ), 403 );
78
+ }
79
+
80
+ // Get all public post types, besides attachments
81
+ $post_types = (array) get_post_types( array(
82
+ 'public' => true,
83
+ ) );
84
+
85
+ if ( ! empty( $_REQUEST['postTypes'] ) ) {
86
+ $post_types = array_intersect( explode( ',', $_REQUEST['postTypes'] ), $post_types );
87
+ } else {
88
+ unset( $post_types['attachment'] );
89
+ }
90
+
91
+ $post_types = apply_filters( 'siteorigin_widgets_search_posts_post_types', $post_types );
92
+
93
+ global $wpdb;
94
+ if( !empty($_GET['query']) ) {
95
+ $query = "AND post_title LIKE '%" . esc_sql( $_GET['query'] ) . "%'";
96
+ }
97
+ else {
98
+ $query = '';
99
+ }
100
+
101
+ $post_types = "'" . implode("', '", array_map( 'esc_sql', $post_types ) ) . "'";
102
+
103
+ $results = $wpdb->get_results( "
104
+ SELECT ID AS 'value', post_title AS label, post_type AS 'type'
105
+ FROM {$wpdb->posts}
106
+ WHERE
107
+ post_type IN ( {$post_types} ) AND post_status = 'publish' {$query}
108
+ ORDER BY post_modified DESC
109
+ LIMIT 20
110
+ ", ARRAY_A );
111
+
112
+ wp_send_json( apply_filters( 'siteorigin_widgets_search_posts_results', $results ) );
113
+ }
114
+ add_action('wp_ajax_so_widgets_search_posts', 'siteorigin_widget_action_search_posts');
115
+
116
+ /**
117
+ * Action to handle searching taxonomy terms.
118
+ */
119
+ function siteorigin_widget_action_search_terms() {
120
+ if ( empty( $_REQUEST['_widgets_nonce'] ) || ! wp_verify_nonce( $_REQUEST['_widgets_nonce'], 'widgets_action' ) ) {
121
+ wp_die( __( 'Invalid request.', 'so-widgets-bundle' ), 403 );
122
+ }
123
+
124
+ global $wpdb;
125
+ $term = ! empty($_GET['term']) ? stripslashes($_GET['term']) : '';
126
+ $term = trim($term, '%');
127
+
128
+ $query = $wpdb->prepare("
129
+ SELECT terms.term_id, terms.slug AS 'value', terms.name AS 'label', termtaxonomy.taxonomy AS 'type'
130
+ FROM $wpdb->terms AS terms
131
+ JOIN $wpdb->term_taxonomy AS termtaxonomy ON terms.term_id = termtaxonomy.term_id
132
+ WHERE
133
+ terms.name LIKE '%s'
134
+ LIMIT 20
135
+ ", '%' . esc_sql( $term ) . '%');
136
+
137
+ $results = array();
138
+
139
+ foreach ( $wpdb->get_results( $query ) as $result ) {
140
+ $results[] = array(
141
+ 'value' => $result->type . ':' . $result->value,
142
+ 'label' => $result->label,
143
+ 'type' => $result->type,
144
+ );
145
+ }
146
+
147
+ wp_send_json( $results );
148
+ }
149
+ add_action('wp_ajax_so_widgets_search_terms', 'siteorigin_widget_action_search_terms');
150
+
151
+ /**
152
+ * Action for getting the number of posts returned by a query.
153
+ */
154
+ function siteorigin_widget_get_posts_count_action() {
155
+
156
+ if ( empty( $_REQUEST['_widgets_nonce'] ) || ! wp_verify_nonce( $_REQUEST['_widgets_nonce'], 'widgets_action' ) ) {
157
+ wp_die( __( 'Invalid request.', 'so-widgets-bundle' ), 403 );
158
+ }
159
+
160
+ $query = stripslashes( $_POST['query'] );
161
+
162
+ wp_send_json( array( 'posts_count' => siteorigin_widget_post_selector_count_posts( $query ) ) );
163
+ }
164
+
165
+ add_action( 'wp_ajax_sow_get_posts_count', 'siteorigin_widget_get_posts_count_action' );
166
+
167
+
168
+ function siteorigin_widget_remote_image_search(){
169
+ if( empty( $_GET[ '_sononce' ] ) || ! wp_verify_nonce( $_GET[ '_sononce' ], 'so-image' ) ) {
170
+ wp_die( __( 'Invalid request.', 'so-widgets-bundle' ), 403 );
171
+ }
172
+
173
+ if( empty( $_GET['q'] ) ) {
174
+ wp_die( __( 'Invalid request.', 'so-widgets-bundle' ), 400 );
175
+ }
176
+
177
+ // Send the query to stock search server
178
+ $url = add_query_arg( array(
179
+ 'q' => $_GET[ 'q' ],
180
+ 'page' => !empty( $_GET[ 'page' ] ) ? intval( $_GET[ 'page' ] ) : 1,
181
+ ), 'http://stock.siteorigin.com/wp-admin/admin-ajax.php?action=image_search' );
182
+
183
+ $result = wp_remote_get( $url, array(
184
+ 'timeout' => 20,
185
+ ) );
186
+
187
+ if( ! is_wp_error( $result ) ) {
188
+ $result = json_decode( $result['body'], true );
189
+ if( !empty( $result['items'] ) ) {
190
+ foreach( $result['items'] as & $r ) {
191
+ if( !empty( $r['full_url'] ) ) {
192
+ $r['import_signature'] = md5( $r['full_url'] . '::' . NONCE_SALT );
193
+ }
194
+ }
195
+ }
196
+ wp_send_json( $result );
197
+ }
198
+ else {
199
+ $result = array(
200
+ 'error' => true,
201
+ 'message' => $result->get_error_message()
202
+ );
203
+ wp_send_json_error( $result );
204
+ }
205
+
206
+ }
207
+ add_action('wp_ajax_so_widgets_image_search', 'siteorigin_widget_remote_image_search');
208
+
209
+ function siteorigin_widget_image_import(){
210
+ if( empty( $_GET[ '_sononce' ] ) || ! wp_verify_nonce( $_GET[ '_sononce' ], 'so-image' ) ) {
211
+ $result = array(
212
+ 'error' => true,
213
+ 'message' => __( 'Nonce error', 'so-widgets-bundle' ),
214
+ );
215
+ }
216
+ else if(
217
+ empty( $_GET['import_signature'] ) ||
218
+ empty( $_GET['full_url'] ) ||
219
+ md5( $_GET['full_url'] . '::' . NONCE_SALT ) !== $_GET['import_signature']
220
+ ) {
221
+ $result = array(
222
+ 'error' => true,
223
+ 'message' => __( 'Signature error', 'so-widgets-bundle' ),
224
+ );
225
+ }
226
+ else {
227
+ // Fetch the image
228
+ $src = media_sideload_image( $_GET['full_url'], $_GET['post_id'], null, 'src' );
229
+ if( is_wp_error( $src ) ) {
230
+ $result = array(
231
+ 'error' => true,
232
+ 'message' => $src->get_error_code(),
233
+ );
234
+ }
235
+ else {
236
+ global $wpdb;
237
+ $attachment = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE guid='%s';", $src ) );
238
+ if( !empty( $attachment ) ) {
239
+ $thumb_src = wp_get_attachment_image_src( $attachment[0], 'thumbnail' );
240
+ $result = array(
241
+ 'error' => false,
242
+ 'attachment_id' => $attachment[0],
243
+ 'thumb' => $thumb_src[0]
244
+ );
245
+ }
246
+ else {
247
+ $result = array(
248
+ 'error' => true,
249
+ 'message' => __( 'Attachment error', 'so-widgets-bundle' ),
250
+ );
251
+ }
252
+ }
253
+ }
254
+
255
+ // Return the result
256
+ wp_send_json( $result );
257
+ }
258
+ add_action('wp_ajax_so_widgets_image_import', 'siteorigin_widget_image_import');
259
+
260
+ /**
261
+ * Action to handle a user dismissing a teaser notice.
262
+ */
263
+ function siteorigin_widgets_dismiss_widget_action(){
264
+ if( empty( $_GET[ '_wpnonce' ] ) || ! wp_verify_nonce( $_GET[ '_wpnonce' ], 'dismiss-widget-teaser' ) ) {
265
+ wp_die( __( 'Invalid request.', 'so-widgets-bundle' ), 403 );
266
+ }
267
+ if( empty( $_GET[ 'widget' ] ) ) {
268
+ wp_die( __( 'Invalid request.', 'so-widgets-bundle' ), 400 );
269
+ }
270
+
271
+ $dismissed = get_user_meta( get_current_user_id(), 'teasers_dismissed', true );
272
+ if( empty( $dismissed ) ) {
273
+ $dismissed = array();
274
+ }
275
+
276
+ $dismissed[ $_GET[ 'widget' ] ] = true;
277
+
278
+ update_user_meta( get_current_user_id(), 'teasers_dismissed', $dismissed );
279
+
280
+ wp_die();
281
+ }
282
+ add_action( 'wp_ajax_so_dismiss_widget_teaser', 'siteorigin_widgets_dismiss_widget_action' );
base/inc/fields/builder.class.php CHANGED
@@ -1,72 +1,72 @@
1
- <?php
2
-
3
- /**
4
- * A full instance of SiteOrigin Page Builder as a field.
5
- *
6
- * Class SiteOrigin_Widget_Field_Builder
7
- */
8
- class SiteOrigin_Widget_Field_Builder extends SiteOrigin_Widget_Field_Base {
9
-
10
- protected function render_field( $value, $instance ){
11
- if( defined('SITEORIGIN_PANELS_VERSION') ) {
12
- // Normal rendering code
13
- // In some contexts this is already encoded, e.g. accordion widget using a layout field for content,
14
- // inside a PB block in the block editor.
15
- $valid_string = is_string( $value ); // Required for PHP <5.4
16
- if ( empty( $valid_string ) ) {
17
- $value = json_encode( $value );
18
- }
19
- ?>
20
- <div
21
- class="siteorigin-page-builder-field"
22
- data-mode="dialog"
23
- data-type="<?php echo isset( $this->field_options['builder_type'] ) ? esc_attr( $this->field_options['builder_type'] ) : 'sow-builder-field' ?>"
24
- >
25
- <p>
26
- <button class="button-secondary siteorigin-panels-display-builder" ><?php _e('Open Builder', 'siteorigin-panels') ?></button>
27
- </p>
28
- <input
29
- type="hidden"
30
- class="siteorigin-widget-input panels-data"
31
- value="<?php echo sow_esc_attr( $value, ENT_QUOTES, false, true ); ?>"
32
- name="<?php echo esc_attr( $this->element_name ) ?>"
33
- id="<?php echo esc_attr( $this->element_id ) ?>"
34
- />
35
- </div>
36
- <?php
37
- }
38
- else {
39
- // Let the user know that they need Page Builder installed
40
- ?>
41
- <p>
42
- <?php _e( 'This field requires: ', 'so-widgets-bundle' ) ?>
43
- <a href="https://siteorigin.com/page-builder/" target="_blank" rel="noopener noreferrer"><?php _e( 'SiteOrigin Page Builder', 'so-widgets-bundle' ) ?></a>
44
- </p>
45
- <?php
46
- }
47
- }
48
-
49
- /**
50
- * Process the panels_data
51
- *
52
- * @param mixed $value
53
- * @param array $instance
54
- *
55
- * @return array|mixed|object
56
- */
57
- protected function sanitize_field_input( $value, $instance ){
58
- if ( empty( $value ) ) {
59
- return array();
60
- }
61
- if ( is_string( $value ) ) {
62
- $value = json_decode( $value, true );
63
- }
64
-
65
- if( function_exists('siteorigin_panels_process_raw_widgets') && !empty( $value['widgets'] ) && is_array( $value['widgets'] ) ) {
66
- $value['widgets'] = siteorigin_panels_process_raw_widgets( $value['widgets'] );
67
- }
68
-
69
- return $value;
70
- }
71
-
72
- }
1
+ <?php
2
+
3
+ /**
4
+ * A full instance of SiteOrigin Page Builder as a field.
5
+ *
6
+ * Class SiteOrigin_Widget_Field_Builder
7
+ */
8
+ class SiteOrigin_Widget_Field_Builder extends SiteOrigin_Widget_Field_Base {
9
+
10
+ protected function render_field( $value, $instance ){
11
+ if( defined('SITEORIGIN_PANELS_VERSION') ) {
12
+ // Normal rendering code
13
+ // In some contexts this is already encoded, e.g. accordion widget using a layout field for content,
14
+ // inside a PB block in the block editor.
15
+ $valid_string = is_string( $value ); // Required for PHP <5.4
16
+ if ( empty( $valid_string ) ) {
17
+ $value = json_encode( $value );
18
+ }
19
+ ?>
20
+ <div
21
+ class="siteorigin-page-builder-field"
22
+ data-mode="dialog"
23
+ data-type="<?php echo isset( $this->field_options['builder_type'] ) ? esc_attr( $this->field_options['builder_type'] ) : 'sow-builder-field' ?>"
24
+ >
25
+ <p>
26
+ <button class="button-secondary siteorigin-panels-display-builder" ><?php _e('Open Builder', 'siteorigin-panels') ?></button>
27
+ </p>
28
+ <input
29
+ type="hidden"
30
+ class="siteorigin-widget-input panels-data"
31
+ value="<?php echo sow_esc_attr( $value, ENT_QUOTES, false, true ); ?>"
32
+ name="<?php echo esc_attr( $this->element_name ) ?>"
33
+ id="<?php echo esc_attr( $this->element_id ) ?>"
34
+ />
35
+ </div>
36
+ <?php
37
+ }
38
+ else {
39
+ // Let the user know that they need Page Builder installed
40
+ ?>
41
+ <p>
42
+ <?php _e( 'This field requires: ', 'so-widgets-bundle' ) ?>
43
+ <a href="https://siteorigin.com/page-builder/" target="_blank" rel="noopener noreferrer"><?php _e( 'SiteOrigin Page Builder', 'so-widgets-bundle' ) ?></a>
44
+ </p>
45
+ <?php
46
+ }
47
+ }
48
+
49
+ /**
50
+ * Process the panels_data
51
+ *
52
+ * @param mixed $value
53
+ * @param array $instance
54
+ *
55
+ * @return array|mixed|object
56
+ */
57
+ protected function sanitize_field_input( $value, $instance ){
58
+ if ( empty( $value ) ) {
59
+ return array();
60
+ }
61
+ if ( is_string( $value ) ) {
62
+ $value = json_decode( $value, true );
63
+ }
64
+
65
+ if( function_exists('siteorigin_panels_process_raw_widgets') && !empty( $value['widgets'] ) && is_array( $value['widgets'] ) ) {
66
+ $value['widgets'] = siteorigin_panels_process_raw_widgets( $value['widgets'] );
67
+ }
68
+
69
+ return $value;
70
+ }
71
+
72
+ }
base/inc/fields/checkbox.class.php CHANGED
@@ -1,26 +1,26 @@
1
- <?php
2
-
3
- /**
4
- * Class SiteOrigin_Widget_Field_Checkbox
5
- */
6
- class SiteOrigin_Widget_Field_Checkbox extends SiteOrigin_Widget_Field_Base {
7
-
8
- protected function render_field( $value, $instance ) {
9
- ?>
10
- <label for="<?php echo esc_attr( $this->element_id ) ?>" class="so-checkbox-label">
11
- <input type="checkbox" name="<?php echo esc_attr( $this->element_name ) ?>" id="<?php echo esc_attr( $this->element_id ) ?>"
12
- class="siteorigin-widget-input" <?php checked( !empty( $value ) ) ?> />
13
- <?php echo esc_html( $this->label ) ?>
14
- </label>
15
- <?php
16
- }
17
-
18
- protected function render_field_label( $value, $instance ) {
19
- // Empty override. This field renders it's own label in the render_field() function.
20
- }
21
-
22
- protected function sanitize_field_input( $value, $instance ) {
23
- return ! empty( $value ) && ! ( is_string( $value ) && $value === 'false' );
24
- }
25
-
26
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class SiteOrigin_Widget_Field_Checkbox
5
+ */
6
+ class SiteOrigin_Widget_Field_Checkbox extends SiteOrigin_Widget_Field_Base {
7
+
8
+ protected function render_field( $value, $instance ) {
9
+ ?>
10
+ <label for="<?php echo esc_attr( $this->element_id ) ?>" class="so-checkbox-label">
11
+ <input type="checkbox" name="<?php echo esc_attr( $this->element_name ) ?>" id="<?php echo esc_attr( $this->element_id ) ?>"
12
+ class="siteorigin-widget-input" <?php checked( !empty( $value ) ) ?> />
13
+ <?php echo esc_html( $this->label ) ?>
14
+ </label>
15
+ <?php
16
+ }
17
+
18
+ protected function render_field_label( $value, $instance ) {
19
+ // Empty override. This field renders it's own label in the render_field() function.
20
+ }
21
+
22
+ protected function sanitize_field_input( $value, $instance ) {
23
+ return ! empty( $value ) && ! ( is_string( $value ) && $value === 'false' );
24
+ }
25
+
26
+ }
base/inc/fields/container-base.class.php CHANGED
@@ -1,125 +1,125 @@
1
- <?php
2
-
3
- /**
4
- *
5
- * The common base class for fields which may contain and render other fields.
6
- *
7
- * Class SiteOrigin_Widget_Field_Container_Base
8
- */
9
- abstract class SiteOrigin_Widget_Field_Container_Base extends SiteOrigin_Widget_Field_Base {
10
- /**
11
- * The child field options.
12
- *
13
- * @access protected
14
- * @var array
15
- */
16
- protected $fields;
17
- /**
18
- * The child field instances.
19
- *
20
- * @access protected
21
- * @var array
22
- */
23
- protected $sub_fields;
24
- /**
25
- * Whether or not this container's fields should initially be hidden.
26
- *
27
- * @access protected
28
- * @var bool
29
- */
30
- protected $hide;
31
- /**
32
- * The current visibility state of this container.
33
- *
34
- * @access protected
35
- * @var string
36
- */
37
- protected $state;
38
- /**
39
- * Whether or not this container's fields are rendered within a collapsible container.
40
- *
41
- * @access protected
42
- * @var bool
43
- */
44
- protected $collapsible = true;
45
-
46
- protected function render_before_field( $value, $instance ) {
47
- if( ! empty( $value[ 'so_field_container_state' ] ) ) {
48
- $this->state = $value[ 'so_field_container_state' ];
49
- }
50
- else {
51
- $this->state = $this->hide ? 'closed' : 'open';
52
- }
53
-
54
- parent::render_before_field( $value, $instance );
55
- }
56
-
57
- protected function get_label_classes( $value, $instance ) {
58
- $label_classes = parent::get_label_classes( $value, $instance );
59
- if( $this->state == 'open' ) $label_classes[] = 'siteorigin-widget-section-visible';
60
- return $label_classes;
61
- }
62
-
63
- protected function render_field_label( $value, $instance ) {
64
- if ($this->collapsible ) {
65
- parent::render_field_label( $value, $instance );
66
- }
67
- }
68
-
69
- protected function create_and_render_sub_fields( $values, $parent_container = null, $is_template = false ) {
70
- $this->sub_fields = array();
71
- if( isset( $parent_container )) {
72
- if( ! in_array( $parent_container, $this->parent_container, true ) ){
73
- $this->parent_container[] = $parent_container;
74
- }
75
- }
76
- /* @var $field_factory SiteOrigin_Widget_Field_Factory */
77
- $field_factory = SiteOrigin_Widget_Field_Factory::single();
78
- foreach( $this->fields as $sub_field_name => $sub_field_options ) {
79
- /* @var $field SiteOrigin_Widget_Field_Base */
80
- $field = $field_factory->create_field(
81
- $sub_field_name,
82
- $sub_field_options,
83
- $this->for_widget,
84
- $this->parent_container,
85
- $is_template
86
- );
87
- $sub_value = ( ! empty( $values ) && isset( $values[$sub_field_name] ) ) ? $values[$sub_field_name] : null;
88
- $field->render( $sub_value, $values );
89
- $field_js_vars = $field->get_javascript_variables();
90
- if( ! empty( $field_js_vars ) ) {
91
- $this->javascript_variables[$sub_field_name] = $field_js_vars;
92
- }
93
- $field->enqueue_scripts();
94
- $this->sub_fields[$sub_field_name] = $field;
95
- }
96
- }
97
-
98
- protected function sanitize_field_input( $value, $instance ) {
99
- if ( ! is_array( $value ) ) {
100
- return array();
101
- }
102
- /* @var $field_factory SiteOrigin_Widget_Field_Factory */
103
- $field_factory = SiteOrigin_Widget_Field_Factory::single();
104
- foreach( $this->fields as $sub_field_name => $sub_field_options ) {
105
-
106
- /* @var $sub_field SiteOrigin_Widget_Field_Base */
107
- if( ! empty( $this->sub_fields ) && ! empty( $this->sub_fields[$sub_field_name] ) ) {
108
- $sub_field = $this->sub_fields[$sub_field_name];
109
- }
110
- else {
111
- $sub_field = $field_factory->create_field(
112
- $this->base_name . '][' . $sub_field_name,
113
- $sub_field_options,
114
- $this->for_widget,
115
- $this->parent_container
116
- );
117
- }
118
- $value[$sub_field_name] = $sub_field->sanitize( isset($value[$sub_field_name]) ? $value[$sub_field_name] : null, $value );
119
- $value = $sub_field->sanitize_instance( $value );
120
- }
121
-
122
- return $value;
123
- }
124
-
125
- }
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ * The common base class for fields which may contain and render other fields.
6
+ *
7
+ * Class SiteOrigin_Widget_Field_Container_Base
8
+ */
9
+ abstract class SiteOrigin_Widget_Field_Container_Base extends SiteOrigin_Widget_Field_Base {
10
+ /**
11
+ * The child field options.
12
+ *
13
+ * @access protected
14
+ * @var array
15
+ */
16
+ protected $fields;
17
+ /**
18
+ * The child field instances.
19
+ *
20
+ * @access protected
21
+ * @var array
22
+ */
23
+ protected $sub_fields;
24
+ /**
25
+ * Whether or not this container's fields should initially be hidden.
26
+ *
27
+ * @access protected
28
+ * @var bool
29
+ */
30
+ protected $hide;
31
+ /**
32
+ * The current visibility state of this container.
33
+ *
34
+ * @access protected
35
+ * @var string
36
+ */
37
+ protected $state;
38
+ /**
39
+ * Whether or not this container's fields are rendered within a collapsible container.
40
+ *
41
+ * @access protected
42
+ * @var bool
43
+ */
44
+ protected $collapsible = true;
45
+
46
+ protected function render_before_field( $value, $instance ) {
47
+ if( ! empty( $value[ 'so_field_container_state' ] ) ) {
48
+ $this->state = $value[ 'so_field_container_state' ];
49
+ }
50
+ else {
51
+ $this->state = $this->hide ? 'closed' : 'open';
52
+ }
53
+
54
+ parent::render_before_field( $value, $instance );
55
+ }
56
+
57
+ protected function get_label_classes( $value, $instance ) {
58
+ $label_classes = parent::get_label_classes( $value, $instance );
59
+ if( $this->state == 'open' ) $label_classes[] = 'siteorigin-widget-section-visible';
60
+ return $label_classes;
61
+ }
62
+
63
+ protected function render_field_label( $value, $instance ) {
64
+ if ($this->collapsible ) {
65
+ parent::render_field_label( $value, $instance );
66
+ }
67
+ }
68
+
69
+ protected function create_and_render_sub_fields( $values, $parent_container = null, $is_template = false ) {
70
+ $this->sub_fields = array();
71
+ if( isset( $parent_container )) {
72
+ if( ! in_array( $parent_container, $this->parent_container, true ) ){
73
+ $this->parent_container[] = $parent_container;
74
+ }
75
+ }
76
+ /* @var $field_factory SiteOrigin_Widget_Field_Factory */
77
+ $field_factory = SiteOrigin_Widget_Field_Factory::single();
78
+ foreach( $this->fields as $sub_field_name => $sub_field_options ) {
79
+ /* @var $field SiteOrigin_Widget_Field_Base */
80
+ $field = $field_factory->create_field(
81
+ $sub_field_name,
82
+ $sub_field_options,
83
+ $this->for_widget,
84
+ $this->parent_container,
85
+ $is_template
86
+ );
87
+ $sub_value = ( ! empty( $values ) && isset( $values[$sub_field_name] ) ) ? $values[$sub_field_name] : null;
88
+ $field->render( $sub_value, $values );
89
+ $field_js_vars = $field->get_javascript_variables();
90
+ if( ! empty( $field_js_vars ) ) {
91
+ $this->javascript_variables[$sub_field_name] = $field_js_vars;
92
+ }
93
+ $field->enqueue_scripts();
94
+ $this->sub_fields[$sub_field_name] = $field;
95
+ }
96
+ }
97
+
98
+ protected function sanitize_field_input( $value, $instance ) {
99
+ if ( ! is_array( $value ) ) {
100
+ return array();
101
+ }
102
+ /* @var $field_factory SiteOrigin_Widget_Field_Factory */
103
+ $field_factory = SiteOrigin_Widget_Field_Factory::single();
104
+ foreach( $this->fields as $sub_field_name => $sub_field_options ) {
105
+
106
+ /* @var $sub_field SiteOrigin_Widget_Field_Base */
107
+ if( ! empty( $this->sub_fields ) && ! empty( $this->sub_fields[$sub_field_name] ) ) {
108
+ $sub_field = $this->sub_fields[$sub_field_name];
109
+ }
110
+ else {
111
+ $sub_field = $field_factory->create_field(
112
+ $this->base_name . '][' . $sub_field_name,
113
+ $sub_field_options,
114
+ $this->for_widget,
115
+ $this->parent_container
116
+ );
117
+ }
118
+ $value[$sub_field_name] = $sub_field->sanitize( isset($value[$sub_field_name]) ? $value[$sub_field_name] : null, $value );
119
+ $value = $sub_field->sanitize_instance( $value );
120
+ }
121
+
122
+ return $value;
123
+ }
124
+
125
+ }
base/inc/fields/date-range.class.php CHANGED
@@ -1,131 +1,131 @@
1
- <?php
2
-
3
- /**
4
- * Class SiteOrigin_Widget_Field_Date_Range
5
- */
6
- class SiteOrigin_Widget_Field_Date_Range extends SiteOrigin_Widget_Field_Base {
7
-
8
- /**
9
- * Either 'relative' or 'specific'. Whether to allow relative or specific date selection.
10
- *
11
- * @access protected
12
- * @var array
13
- */
14
- protected $date_type;
15
-
16
- protected function render_field( $value, $instance ) {
17
-
18
- if ( $this->date_type == 'specific' ) {
19
- $this->render_specific_date_selector();
20
- } else {
21
- $this->render_relative_date_selector( $value );
22
- }
23
- ?><input type="hidden"
24
- class="siteorigin-widget-input"
25
- value="<?php echo esc_attr( $value ) ?>"
26
- name="<?php echo esc_attr( $this->element_name ) ?>" /><?php
27
- }
28
-
29
- private function render_specific_date_selector() {
30
- ?><div class="sowb-specific-date-after"><span><?php
31
- _ex( 'From', 'From this date', 'so-widgets-bundle' );
32
- ?></span><input type="text" class="datepicker after-picker"/></div><?php
33
- ?><div class="sowb-specific-date-before"><span><?php
34
- _e( 'to', 'so-widgets-bundle' );
35
- ?></span><input type="text" class="datepicker before-picker"/></div><?php
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 );
46
-
47
- $to = ! empty( $value['to'] ) ? $value['to'] : array();
48
- $this->render_relative_date_selector_part( 'to', __( 'to', 'so-widgets-bundle' ), $to );
49
- }
50
-
51
- private function render_relative_date_selector_part( $name, $label, $value ) {
52
- $units = $this->get_units();
53
-
54
- $val = ! empty( $value['value'] ) ? $value['value'] : 0;
55
- $unit = ! empty( $value['unit'] ) ? $value['unit'] : 'days';
56
-
57
- ?><div class="sowb-relative-date" data-name="<?php echo esc_attr( $name ) ?>"><span><?php
58
- echo esc_html( $label );
59
- ?></span><input type="number" min="0" step="1" class="sowb-relative-date-value" value="<?php echo esc_attr( $val ) ?>"/>
60
- <select class="sowb-relative-date-unit">
61
- <?php foreach( $units as $value => $label) : ?>
62
- <option value="<?php echo esc_attr( $value ) ?>" <?php selected( $value, $unit ) ?>><?php echo $label ?></option>
63
- <?php endforeach; ?>
64
- </select><span><?php _e( 'ago', 'so-widgets-bundle' ); ?></span></div><?php
65
- }
66
-
67
- private function get_units() {
68
- return array(
69
- 'days' => __( 'days', 'so-widgets-bundle' ),
70
- 'weeks' => __( 'weeks', 'so-widgets-bundle' ),
71
- 'months' => __( 'months', 'so-widgets-bundle' ),
72
- 'years' => __( 'years', 'so-widgets-bundle' ),
73
- );
74
- }
75
-
76
- public function enqueue_scripts() {
77
- wp_enqueue_style(
78
- 'so-date-range-field',
79
- plugin_dir_url(__FILE__) . 'css/date-range-field.css',
80
- array( 'sowb-pikaday' ),
81
- SOW_BUNDLE_VERSION
82
- );
83
- wp_enqueue_script(
84
- 'so-date-range-field',
85
- plugin_dir_url(__FILE__) . 'js/date-range-field' . SOW_BUNDLE_JS_SUFFIX . '.js',
86
- array( 'jquery', 'sowb-pikaday' ),
87
- SOW_BUNDLE_VERSION
88
- );
89
- }
90
-
91
- protected function sanitize_field_input( $value, $instance ) {
92
- if ( $this->date_type == 'specific' ) {
93
- if ( ! empty( $value ) ) {
94
- $value = json_decode(
95
- $value,
96
- true
97
- );
98
- if ( ! empty( $value['after'] ) ) {
99
- $value_after = new DateTime( $value['after'] );
100
- $value['after'] = $value_after->format( 'Y-m-d' );
101
- }
102
- if ( ! empty( $value['before'] ) ) {
103
- $value_before = new DateTime( $value['before'] );
104
- $value['before'] = $value_before->format( 'Y-m-d' );
105
- }
106
- } else {
107
- $value = array( 'after' => '', 'before' => '' );
108
- }
109
- } else if ( $this->date_type == 'relative' ) {
110
- if ( ! empty( $value ) ) {
111
- $value = json_decode(
112
- $value,
113
- true
114
- );
115
- $unit_keys = array_keys( $this->get_units() );
116
- foreach( array( 'from', 'to' ) as $key ) {
117
- if ( empty( $value[$key] ) ) {
118
- $value[$key] = array();
119
- }
120
- $item = $value[$key];
121
- $val = empty( $item['value'] ) ? 0 : intval( $item['value'] );
122
- $unit = ( ! empty( $item['unit'] ) && in_array( $item['unit'], $unit_keys ) ) ? $item['unit'] : $unit_keys[0];
123
- $value[$key] = array( 'value' => $val, 'unit' => $unit );
124
- }
125
- } else {
126
- $value = array( 'from' => array(), 'to' => array() );
127
- }
128
- }
129
- return json_encode( $value );
130
- }
131
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class SiteOrigin_Widget_Field_Date_Range
5
+ */
6
+ class SiteOrigin_Widget_Field_Date_Range extends SiteOrigin_Widget_Field_Base {
7
+
8
+ /**
9
+ * Either 'relative' or 'specific'. Whether to allow relative or specific date selection.
10
+ *
11
+ * @access protected
12
+ * @var array
13
+ */
14
+ protected $date_type;
15
+
16
+ protected function render_field( $value, $instance ) {
17
+
18
+ if ( $this->date_type == 'specific' ) {
19
+ $this->render_specific_date_selector();
20
+ } else {
21
+ $this->render_relative_date_selector( $value );
22
+ }
23
+ ?><input type="hidden"
24
+ class="siteorigin-widget-input"
25
+ value="<?php echo esc_attr( $value ) ?>"
26
+ name="<?php echo esc_attr( $this->element_name ) ?>" /><?php
27
+ }
28
+
29
+ private function render_specific_date_selector() {
30
+ ?><div class="sowb-specific-date-after"><span><?php
31
+ _ex( 'From', 'From this date', 'so-widgets-bundle' );
32
+ ?></span><input type="text" class="datepicker after-picker"/></div><?php
33
+ ?><div class="sowb-specific-date-before"><span><?php
34
+ _e( 'to', 'so-widgets-bundle' );
35
+ ?></span><input type="text" class="datepicker before-picker"/></div><?php
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 );
46
+
47
+ $to = ! empty( $value['to'] ) ? $value['to'] : array();
48
+ $this->render_relative_date_selector_part( 'to', __( 'to', 'so-widgets-bundle' ), $to );
49
+ }
50
+
51
+ private function render_relative_date_selector_part( $name, $label, $value ) {
52
+ $units = $this->get_units();
53
+
54
+ $val = ! empty( $value['value'] ) ? $value['value'] : 0;
55
+ $unit = ! empty( $value['unit'] ) ? $value['unit'] : 'days';
56
+
57
+ ?><div class="sowb-relative-date" data-name="<?php echo esc_attr( $name ) ?>"><span><?php
58
+ echo esc_html( $label );
59
+ ?></span><input type="number" min="0" step="1" class="sowb-relative-date-value" value="<?php echo esc_attr( $val ) ?>"/>
60
+ <select class="sowb-relative-date-unit">
61
+ <?php foreach( $units as $value => $label) : ?>
62
+ <option value="<?php echo esc_attr( $value ) ?>" <?php selected( $value, $unit ) ?>><?php echo $label ?></option>
63
+ <?php endforeach; ?>
64
+ </select><span><?php _e( 'ago', 'so-widgets-bundle' ); ?></span></div><?php
65
+ }
66
+
67
+ private function get_units() {
68
+ return array(
69
+ 'days' => __( 'days', 'so-widgets-bundle' ),
70
+ 'weeks' => __( 'weeks', 'so-widgets-bundle' ),
71
+ 'months' => __( 'months', 'so-widgets-bundle' ),
72
+ 'years' => __( 'years', 'so-widgets-bundle' ),
73
+ );
74
+ }
75
+
76
+ public function enqueue_scripts() {
77
+ wp_enqueue_style(
78
+ 'so-date-range-field',
79
+ plugin_dir_url(__FILE__) . 'css/date-range-field.css',
80
+ array( 'sowb-pikaday' ),
81
+ SOW_BUNDLE_VERSION
82
+ );
83
+ wp_enqueue_script(
84
+ 'so-date-range-field',
85
+ plugin_dir_url(__FILE__) . 'js/date-range-field' . SOW_BUNDLE_JS_SUFFIX . '.js',
86
+ array( 'jquery', 'sowb-pikaday' ),
87
+ SOW_BUNDLE_VERSION
88
+ );
89
+ }
90
+
91
+ protected function sanitize_field_input( $value, $instance ) {
92
+ if ( $this->date_type == 'specific' ) {
93
+ if ( ! empty( $value ) ) {
94
+ $value = json_decode(
95
+ $value,
96
+ true
97
+ );
98
+ if ( ! empty( $value['after'] ) ) {
99
+ $value_after = new DateTime( $value['after'] );
100
+ $value['after'] = $value_after->format( 'Y-m-d' );
101
+ }
102
+ if ( ! empty( $value['before'] ) ) {
103
+ $value_before = new DateTime( $value['before'] );
104
+ $value['before'] = $value_before->format( 'Y-m-d' );
105
+ }
106
+ } else {
107
+ $value = array( 'after' => '', 'before' => '' );
108
+ }
109
+ } else if ( $this->date_type == 'relative' ) {
110
+ if ( ! empty( $value ) ) {
111
+ $value = json_decode(
112
+ $value,
113
+ true
114
+ );
115
+ $unit_keys = array_keys( $this->get_units() );
116
+ foreach( array( 'from', 'to' ) as $key ) {
117
+ if ( empty( $value[$key] ) ) {
118
+ $value[$key] = array();
119
+ }
120
+ $item = $value[$key];
121
+ $val = empty( $item['value'] ) ? 0 : intval( $item['value'] );
122
+ $unit = ( ! empty( $item['unit'] ) && in_array( $item['unit'], $unit_keys ) ) ? $item['unit'] : $unit_keys[0];
123
+ $value[$key] = array( 'value' => $val, 'unit' => $unit );
124
+ }
125
+ } else {
126
+ $value = array( 'from' => array(), 'to' => array() );
127
+ }
128
+ }
129
+ return json_encode( $value );
130
+ }
131
+ }
base/inc/fields/font.class.php CHANGED
@@ -1,46 +1,46 @@
1
- <?php
2
-
3
- /**
4
- * Class SiteOrigin_Widget_Field_Font
5
- */
6
- class SiteOrigin_Widget_Field_Font extends SiteOrigin_Widget_Field_Base {
7
-
8
- protected function render_field( $value, $instance ) {
9
- static $widget_font_families;
10
- if( empty($widget_font_families) ) {
11
-
12
- $widget_font_families = siteorigin_widgets_font_families();
13
- }
14
- ?>
15
- <div class="siteorigin-widget-font-selector siteorigin-widget-field-subcontainer">
16
- <select name="<?php echo esc_attr( $this->element_name ) ?>" id="<?php echo esc_attr( $this->element_id ) ?>" class="siteorigin-widget-input">
17
- <option value="default" selected="selected"><?php esc_html_e( 'Use theme font', 'so-widgets-bundle' ) ?></option>
18
- <?php foreach( $widget_font_families as $key => $val ) : ?>
19
- <option value="<?php echo esc_attr( $key ) ?>" <?php selected( $key, $value ) ?>><?php echo esc_html( $val ) ?></option>
20
- <?php endforeach; ?>
21
- </select>
22
- </div>
23
- <?php
24
- }
25
-
26
- protected function sanitize_field_input( $value, $instance ) {
27
- $sanitized_value = trim( $value );
28
- // Any alphanumeric character followed by alphanumeric or whitespace characters (except newline),
29
- // with optional colon and number.
30
- if( preg_match( '/[\w\d]+[\w\d\t\r ]*(:\d+)?/', $sanitized_value, $sanitized_matches ) ) {
31
- $sanitized_value = $sanitized_matches[0];
32
- }
33
- else {
34
- $sanitized_value = 'default';
35
- }
36
-
37
- static $widget_font_families;
38
- if( empty($widget_font_families) ) {
39
- $widget_font_families = siteorigin_widgets_font_families();
40
- }
41
- $keys = array_keys( $widget_font_families );
42
- if( ! in_array( $sanitized_value, $keys ) ) $sanitized_value = isset( $this->default ) ? $this->default : 'default';
43
-
44
- return $sanitized_value;
45
- }
46
  }
1
+ <?php
2
+
3
+ /**
4
+ * Class SiteOrigin_Widget_Field_Font
5
+ */
6
+ class SiteOrigin_Widget_Field_Font extends SiteOrigin_Widget_Field_Base {
7
+
8
+ protected function render_field( $value, $instance ) {
9
+ static $widget_font_families;
10
+ if( empty($widget_font_families) ) {
11
+
12
+ $widget_font_families = siteorigin_widgets_font_families();
13
+ }
14
+ ?>
15
+ <div class="siteorigin-widget-font-selector siteorigin-widget-field-subcontainer">
16
+ <select name="<?php echo esc_attr( $this->element_name ) ?>" id="<?php echo esc_attr( $this->element_id ) ?>" class="siteorigin-widget-input">
17
+ <option value="default" selected="selected"><?php esc_html_e( 'Use theme font', 'so-widgets-bundle' ) ?></option>
18
+ <?php foreach( $widget_font_families as $key => $val ) : ?>
19
+ <option value="<?php echo esc_attr( $key ) ?>" <?php selected( $key, $value ) ?>><?php echo esc_html( $val ) ?></option>
20
+ <?php endforeach; ?>
21
+ </select>
22
+ </div>
23
+ <?php
24
+ }
25
+
26
+ protected function sanitize_field_input( $value, $instance ) {
27
+ $sanitized_value = trim( $value );
28
+ // Any alphanumeric character followed by alphanumeric or whitespace characters (except newline),
29
+ // with optional colon and number.
30
+ if( preg_match( '/[\w\d]+[\w\d\t\r ]*(:\d+)?/', $sanitized_value, $sanitized_matches ) ) {
31
+ $sanitized_value = $sanitized_matches[0];
32
+ }
33
+ else {
34
+ $sanitized_value = 'default';
35
+ }
36
+
37
+ static $widget_font_families;
38
+ if( empty($widget_font_families) ) {
39
+ $widget_font_families = siteorigin_widgets_font_families();
40
+ }
41
+ $keys = array_keys( $widget_font_families );
42
+ if( ! in_array( $sanitized_value, $keys ) ) $sanitized_value = isset( $this->default ) ? $this->default : 'default';
43
+
44
+ return $sanitized_value;
45
+ }
46
  }
base/inc/fields/icon.class.php CHANGED
@@ -1,142 +1,142 @@
1
- <?php
2
-
3
- /**
4
- * Class SiteOrigin_Widget_Field_Icon
5
- */
6
- class SiteOrigin_Widget_Field_Icon extends SiteOrigin_Widget_Field_Base {
7
- /**
8
- * The number of visible rows in the icons selector.
9
- *
10
- * @access protected
11
- * @var int
12
- *
13
- */
14
- protected $rows = 3;
15
-
16
- protected $icons_callback;
17
-
18
- protected function render_field( $value, $instance ) {
19
- $widget_icon_families = $this->get_widget_icon_families();
20
- $value_parts = self::get_value_parts( $value );
21
- if ( ! empty( $value ) ) {
22
- $value_family = $value_parts['family'];
23
- $value_style = empty( $value_parts['style'] ) ? '' : ( '-' . $value_parts['style'] );
24
- $value = $value_parts['family'] . $value_style . '-' . $value_parts['icon'];
25
-
26
- } else {
27
- $value_family = 'fontawesome';
28
- }
29
- ?>
30
-
31
- <div class="siteorigin-widget-icon-selector-current">
32
- <div class="siteorigin-widget-icon"><span></span></div>
33
- <label><?php _e('Choose Icon', 'so-widgets-bundle') ?></label>
34
- </div>
35
-
36
- <a class="so-icon-remove" style="display: <?php echo !empty( $value ) ? 'inline-block' : 'none' ?>;"><?php esc_html_e( 'Remove', 'so-widgets-bundle' ) ?></a>
37
-
38
- <div class="clear"></div>
39
-
40
- <div class="siteorigin-widget-icon-selector siteorigin-widget-field-subcontainer">
41
- <select class="siteorigin-widget-icon-family" >
42
- <?php foreach( $widget_icon_families as $family_id => $family_info ) : ?>
43
- <option value="<?php echo esc_attr( $family_id ) ?>"
44
- <?php selected( $value_family, $family_id ) ?>
45
- <?php if( !empty( $this->icons_callback ) ) echo 'data-icons="' . esc_attr( json_encode( $family_info ) ) . '"' ?>
46
- >
47
- <?php echo esc_html( $family_info['name'] ) ?> (<?php echo count( $family_info['icons'] ) ?>)
48
- </option>
49
- <?php endforeach; ?>
50
- </select>
51
-
52
- <?php if ( ! empty( $widget_icon_families[$value_family]['styles'] ) ) :
53
- $family_styles = $widget_icon_families[ $value_family ]['styles'];
54
- ?>
55
- <select class="siteorigin-widget-icon-family-styles">
56
- <?php foreach ( $family_styles as $family_style => $family_style_name ) : ?>
57
- <option value="<?php echo esc_attr( $family_style ) ?>"
58
- <?php selected( $value_parts['style'], $family_style ) ?>>
59
- <?php esc_html_e( $family_style_name ); ?>
60
- </option>
61
- <?php endforeach; ?>
62
- </select>
63
- <?php endif;?>
64
-
65
- <input type="search" class="siteorigin-widget-icon-search" placeholder="<?php esc_attr_e( 'Search Icons' ) ?>" />
66
-
67
- <input type="hidden" name="<?php echo esc_attr( $this->element_name ) ?>" value="<?php echo esc_attr( $value ) ?>"
68
- class="siteorigin-widget-icon-icon siteorigin-widget-input" />
69
-
70
- <div class="siteorigin-widget-icon-icons" style="height: <?php echo ( $this->rows * 54 ) - 3 ?>px;"></div>
71
- </div>
72
- <?php
73
- }
74
-
75
- protected function sanitize_field_input( $value, $instance ) {
76
- $sanitized_value = $value;
77
- // Alphanumeric characters and hyphens.
78
- if( preg_match( '/[\w\d]+[\w\d-]*/', $sanitized_value, $sanitized_matches ) ) {
79
- $sanitized_value = $sanitized_matches[0];
80
- }
81
- else {
82
- $sanitized_value = '';
83
- }
84
-
85
- $value_parts = self::get_value_parts( $sanitized_value );
86
- $widget_icon_families = $this->get_widget_icon_families();
87
- if( ! ( isset( $widget_icon_families[$value_parts['family']] ) && isset( $widget_icon_families[$value_parts['family']]['icons'][$value_parts['icon']] ) ) ) {
88
- $sanitized_value = isset( $this->default ) ? $this->default : '';
89
- }
90
-
91
- return $sanitized_value;
92
- }
93
-
94
- private function get_widget_icon_families(){
95
- if( !empty( $this->icons_callback ) ) {
96
- // We'll get the icons from the callback function
97
- $widget_icon_families = call_user_func( $this->icons_callback );
98
- }
99
- else {
100
- // We'll get icons from the main filter
101
- $widget_icon_families = self::get_icon_families();
102
- }
103
-
104
- return $widget_icon_families;
105
- }
106
-
107
- static function get_icon_families() {
108
- static $widget_icon_families;
109
- if( empty( $widget_icon_families ) ) {
110
- $widget_icon_families = apply_filters( 'siteorigin_widgets_icon_families', array() );
111
- }
112
-
113
- return $widget_icon_families;
114
- }
115
-
116
- static function get_value_parts( $value ) {
117
-
118
- list( $value_family, $value_icon ) = ( ! empty( $value ) && strpos( $value, '-' ) !== false ) ? explode( '-', $value, 2 ) : array('', '');
119
-
120
- $matched = preg_match( '/(sow\-fa\w?)\-/', $value_icon, $style_matches );
121
- if ( ! empty( $matched ) ) {
122
- $value_icon = str_replace( $style_matches[0], '', $value_icon );
123
- $value_style = $style_matches[1];
124
- }
125
-
126
- // Trigger loading of the icon families and their filters. This isn't ideal, but necessary to ensure possible
127
- // migrations are available.
128
- self::get_icon_families();
129
-
130
- return apply_filters( 'siteorigin_widgets_icon_migrate_' . $value_family, array(
131
- 'family' => $value_family,
132
- 'style' => ! empty( $value_style ) ? $value_style : null,
133
- 'icon' => $value_icon,
134
- ) );
135
- }
136
-
137
- public function enqueue_scripts(){
138
- wp_enqueue_script( 'so-icon-field', plugin_dir_url( __FILE__ ) . 'js/icon-field' . SOW_BUNDLE_JS_SUFFIX . '.js', array( 'jquery' ), SOW_BUNDLE_VERSION );
139
- wp_enqueue_style( 'so-icon-field', plugin_dir_url( __FILE__ ) . 'css/icon-field.css', array( ), SOW_BUNDLE_VERSION );
140
- }
141
-
142
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class SiteOrigin_Widget_Field_Icon
5
+ */
6
+ class SiteOrigin_Widget_Field_Icon extends SiteOrigin_Widget_Field_Base {
7
+ /**
8
+ * The number of visible rows in the icons selector.
9
+ *
10
+ * @access protected
11
+ * @var int
12
+ *
13
+ */
14
+ protected $rows = 3;
15
+
16
+ protected $icons_callback;
17
+
18
+ protected function render_field( $value, $instance ) {
19
+ $widget_icon_families = $this->get_widget_icon_families();
20
+ $value_parts = self::get_value_parts( $value );
21
+ if ( ! empty( $value ) ) {
22
+ $value_family = $value_parts['family'];
23
+ $value_style = empty( $value_parts['style'] ) ? '' : ( '-' . $value_parts['style'] );
24
+ $value = $value_parts['family'] . $value_style . '-' . $value_parts['icon'];
25
+
26
+ } else {
27
+ $value_family = 'fontawesome';
28
+ }
29
+ ?>
30
+
31
+ <div class="siteorigin-widget-icon-selector-current">
32
+ <div class="siteorigin-widget-icon"><span></span></div>
33
+ <label><?php _e('Choose Icon', 'so-widgets-bundle') ?></label>
34
+ </div>
35
+
36
+ <a class="so-icon-remove" style="display: <?php echo !empty( $value ) ? 'inline-block' : 'none' ?>;"><?php esc_html_e( 'Remove', 'so-widgets-bundle' ) ?></a>
37
+
38
+ <div class="clear"></div>
39
+
40
+ <div class="siteorigin-widget-icon-selector siteorigin-widget-field-subcontainer">
41
+ <select class="siteorigin-widget-icon-family" >
42
+ <?php foreach( $widget_icon_families as $family_id => $family_info ) : ?>
43
+ <option value="<?php echo esc_attr( $family_id ) ?>"
44
+ <?php selected( $value_family, $family_id ) ?>
45
+ <?php if( !empty( $this->icons_callback ) ) echo 'data-icons="' . esc_attr( json_encode( $family_info ) ) . '"' ?>
46
+ >
47
+ <?php echo esc_html( $family_info['name'] ) ?> (<?php echo count( $family_info['icons'] ) ?>)
48
+ </option>
49
+ <?php endforeach; ?>
50
+ </select>
51
+
52
+ <?php if ( ! empty( $widget_icon_families[$value_family]['styles'] ) ) :
53
+ $family_styles = $widget_icon_families[ $value_family ]['styles'];
54
+ ?>
55
+ <select class="siteorigin-widget-icon-family-styles">
56
+ <?php foreach ( $family_styles as $family_style => $family_style_name ) : ?>
57
+ <option value="<?php echo esc_attr( $family_style ) ?>"
58
+ <?php selected( $value_parts['style'], $family_style ) ?>>
59
+ <?php esc_html_e( $family_style_name ); ?>
60
+ </option>
61
+ <?php endforeach; ?>
62
+ </select>
63
+ <?php endif;?>
64
+
65
+ <input type="search" class="siteorigin-widget-icon-search" placeholder="<?php esc_attr_e( 'Search Icons' ) ?>" />
66
+
67
+ <input type="hidden" name="<?php echo esc_attr( $this->element_name ) ?>" value="<?php echo esc_attr( $value ) ?>"
68
+ class="siteorigin-widget-icon-icon siteorigin-widget-input" />
69
+
70
+ <div class="siteorigin-widget-icon-icons" style="height: <?php echo ( $this->rows * 54 ) - 3 ?>px;"></div>
71
+ </div>
72
+ <?php
73
+ }
74
+
75
+ protected function sanitize_field_input( $value, $instance ) {
76
+ $sanitized_value = $value;
77
+ // Alphanumeric characters and hyphens.
78
+ if( preg_match( '/[\w\d]+[\w\d-]*/', $sanitized_value, $sanitized_matches ) ) {
79
+ $sanitized_value = $sanitized_matches[0];
80
+ }
81
+ else {
82
+ $sanitized_value = '';
83
+ }
84
+
85
+ $value_parts = self::get_value_parts( $sanitized_value );
86
+ $widget_icon_families = $this->get_widget_icon_families();
87
+ if( ! ( isset( $widget_icon_families[$value_parts['family']] ) && isset( $widget_icon_families[$value_parts['family']]['icons'][$value_parts['icon']] ) ) ) {
88
+ $sanitized_value = isset( $this->default ) ? $this->default : '';
89
+ }
90
+
91
+ return $sanitized_value;
92
+ }
93
+
94
+ private function get_widget_icon_families(){
95
+ if( !empty( $this->icons_callback ) ) {
96
+ // We'll get the icons from the callback function
97
+ $widget_icon_families = call_user_func( $this->icons_callback );
98
+ }
99
+ else {
100
+ // We'll get icons from the main filter
101
+ $widget_icon_families = self::get_icon_families();
102
+ }
103
+
104
+ return $widget_icon_families;
105
+ }
106
+
107
+ static function get_icon_families() {
108
+ static $widget_icon_families;
109
+ if( empty( $widget_icon_families ) ) {
110
+ $widget_icon_families = apply_filters( 'siteorigin_widgets_icon_families', array() );
111
+ }
112
+
113
+ return $widget_icon_families;
114
+ }
115
+
116
+ static function get_value_parts( $value ) {
117
+
118
+ list( $value_family, $value_icon ) = ( ! empty( $value ) && strpos( $value, '-' ) !== false ) ? explode( '-', $value, 2 ) : array('', '');
119
+
120
+ $matched = preg_match( '/(sow\-fa\w?)\-/', $value_icon, $style_matches );
121
+ if ( ! empty( $matched ) ) {
122
+ $value_icon = str_replace( $style_matches[0], '', $value_icon );
123
+ $value_style = $style_matches[1];
124
+ }
125
+
126
+ // Trigger loading of the icon families and their filters. This isn't ideal, but necessary to ensure possible
127
+ // migrations are available.
128
+ self::get_icon_families();
129
+
130
+ return apply_filters( 'siteorigin_widgets_icon_migrate_' . $value_family, array(
131
+ 'family' => $value_family,
132
+ 'style' => ! empty( $value_style ) ? $value_style : null,
133
+ 'icon' => $value_icon,
134
+ ) );
135
+ }
136
+
137
+ public function enqueue_scripts(){
138
+ wp_enqueue_script( 'so-icon-field', plugin_dir_url( __FILE__ ) . 'js/icon-field' . SOW_BUNDLE_JS_SUFFIX . '.js', array( 'jquery' ), SOW_BUNDLE_VERSION );
139
+ wp_enqueue_style( 'so-icon-field', plugin_dir_url( __FILE__ ) . 'css/icon-field.css', array( ), SOW_BUNDLE_VERSION );
140
+ }
141
+
142
+ }
base/inc/fields/image-radio.class.php CHANGED
@@ -1,75 +1,75 @@
1
- <?php
2
-
3
- /**
4
- * Class SiteOrigin_Widget_Field_Radio
5
- */
6
- class SiteOrigin_Widget_Field_Image_Radio extends SiteOrigin_Widget_Field_Base {
7
- /**
8
- * The list of options which may be selected.
9
- *
10
- * @access protected
11
- * @var array
12
- */
13
- protected $options;
14
-
15
- /**
16
- * Whether the image options should be laid out vertically (default) or horizontally.
17
- *
18
- * @access protected
19
- * @var string
20
- */
21
- protected $layout;
22
-
23
- protected function get_default_options() {
24
- return array(
25
- 'layout' => 'vertical',
26
- );
27
- }
28
-
29
- protected function render_field( $value, $instance ) {
30
- if ( ! isset( $this->options ) || empty( $this->options ) ) return;
31
- $i = 0;
32
- ?>
33
- <div class="siteorigin-widget-image-radio-items siteorigin-widget-image-radio-layout-<?php echo esc_attr( $this->layout )?>">
34
- <?php
35
- foreach( $this->options as $option_name => $option ) {
36
- ?>
37
- <label class="so-image-radio" for="<?php echo esc_attr( $this->element_id . '-' . $i ) ?>">
38
- <img src="<?php echo esc_attr( $option['image'] ) ?>"/>
39
- <input
40
- type="radio" name="<?php echo esc_attr( $this->element_name ) ?>"
41
- id="<?php echo esc_attr( $this->element_id . '-' . $i ) ?>" class="siteorigin-widget-input"
42
- value="<?php echo esc_attr( $option_name ) ?>"
43
- <?php checked( $option_name, $value ) ?>
44
- ><?php echo esc_html( $option['label'] ) ?>
45
- </label>
46
- <?php
47
- $i += 1;
48
- }
49
- ?></div><?php
50
- }
51
-
52
- protected function sanitize_field_input( $value, $instance ) {
53
- $sanitized_value = $value;
54
- $keys = array_keys( $this->options );
55
- if( ! in_array( $sanitized_value, $keys ) ) $sanitized_value = isset( $this->default ) ? $this->default : false;
56
- return $sanitized_value;
57
- }
58
-
59
- public function enqueue_scripts(){
60
- wp_enqueue_style(
61
- 'so-image-radio-field',
62
- plugin_dir_url( __FILE__ ) . 'css/image-radio-field.css',
63
- array(),
64
- SOW_BUNDLE_VERSION
65
- );
66
-
67
- wp_enqueue_script(
68
- 'so-image-radio-field',
69
- plugin_dir_url(__FILE__) . 'js/image-radio-field' . SOW_BUNDLE_JS_SUFFIX . '.js',
70
- array( 'jquery'),
71
- SOW_BUNDLE_VERSION
72
- );
73
- }
74
-
75
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class SiteOrigin_Widget_Field_Radio
5
+ */
6
+ class SiteOrigin_Widget_Field_Image_Radio extends SiteOrigin_Widget_Field_Base {
7
+ /**
8
+ * The list of options which may be selected.
9
+ *
10
+ * @access protected
11
+ * @var array
12
+ */
13
+ protected $options;
14
+
15
+ /**
16
+ * Whether the image options should be laid out vertically (default) or horizontally.
17
+ *
18
+ * @access protected
19
+ * @var string
20
+ */
21
+ protected $layout;
22
+
23
+ protected function get_default_options() {
24
+ return array(
25
+ 'layout' => 'vertical',
26
+ );
27
+ }
28
+
29
+ protected function render_field( $value, $instance ) {
30
+ if ( ! isset( $this->options ) || empty( $this->options ) ) return;
31
+ $i = 0;
32
+ ?>
33
+ <div class="siteorigin-widget-image-radio-items siteorigin-widget-image-radio-layout-<?php echo esc_attr( $this->layout )?>">
34
+ <?php
35
+ foreach( $this->options as $option_name => $option ) {
36
+ ?>
37
+ <label class="so-image-radio" for="<?php echo esc_attr( $this->element_id . '-' . $i ) ?>">
38
+ <img src="<?php echo esc_attr( $option['image'] ) ?>"/>
39
+ <input
40
+ type="radio" name="<?php echo esc_attr( $this->element_name ) ?>"
41
+ id="<?php echo esc_attr( $this->element_id . '-' . $i ) ?>" class="siteorigin-widget-input"
42
+ value="<?php echo esc_attr( $option_name ) ?>"
43
+ <?php checked( $option_name, $value ) ?>
44
+ ><?php echo esc_html( $option['label'] ) ?>
45
+ </label>
46
+ <?php
47
+ $i += 1;
48
+ }
49
+ ?></div><?php
50
+ }
51
+
52
+ protected function sanitize_field_input( $value, $instance ) {
53
+ $sanitized_value = $value;
54
+ $keys = array_keys( $this->options );
55
+ if( ! in_array( $sanitized_value, $keys ) ) $sanitized_value = isset( $this->default ) ? $this->default : false;
56
+ return $sanitized_value;
57
+ }
58
+
59
+ public function enqueue_scripts(){
60
+ wp_enqueue_style(
61
+ 'so-image-radio-field',
62
+ plugin_dir_url( __FILE__ ) . 'css/image-radio-field.css',
63
+ array(),
64
+ SOW_BUNDLE_VERSION
65
+ );
66
+
67
+ wp_enqueue_script(
68
+ 'so-image-radio-field',
69
+ plugin_dir_url(__FILE__) . 'js/image-radio-field' . SOW_BUNDLE_JS_SUFFIX . '.js',
70
+ array( 'jquery'),
71
+ SOW_BUNDLE_VERSION
72
+ );
73
+ }
74
+
75
+ }
base/inc/fields/js/date-range-field.js CHANGED
@@ -1,110 +1,110 @@
1
- /* global jQuery, pikaday */
2
-
3
- (function( $ ) {
4
- $( document ).on( 'sowsetupformfield', '.siteorigin-widget-field-type-date-range', function ( e ) {
5
- var $dateRangeField = $( this );
6
- var valField = $dateRangeField.find( 'input[type="hidden"][class="siteorigin-widget-input"]' );
7
-
8
- if ( $dateRangeField.data( 'initialized' ) ) {
9
- return;
10
- }
11
-
12
- if ( $dateRangeField.find( '[class*="sowb-specific-date"]' ).length > 0 ) {
13
- var createPikadayInput = function ( inputName, initVal ) {
14
- var $field = $dateRangeField.find( '.' + inputName + '-picker' );
15
- var dateToString = function ( date, format ) {
16
- var dateString = '';
17
- if ( ! isNaN( date.valueOf() ) ) {
18
- var day = date.getDate();
19
- day = day < 10 ? '0' + day.toString() : day.toString();
20
- var month = date.getMonth() + 1;
21
- month = month < 10 ? '0' + month.toString() : month.toString();
22
- var year = date.getFullYear();
23
- return year + '-' + month + '-' + day;
24
- }
25
-
26
- return dateString;
27
- };
28
- var parse = function ( dateString, format ) {
29
- var parts = dateString.split( '-' );
30
- var day = parseInt( parts[ 2 ] );
31
- var month = parseInt( parts[ 1 ] ) - 1;
32
- var year = parseInt( parts[ 0 ] );
33
- return new Date( year, month, day );
34
- };
35
- var updateValField = function ( date ) {
36
- var curVal = valField.val() === '' ? {} : JSON.parse( valField.val() );
37
- curVal[ inputName ] = dateToString( date );
38
- $field.val( curVal[ inputName ] );
39
- valField.val( JSON.stringify( curVal ) );
40
- valField.trigger( 'change', { silent: true } );
41
- };
42
- var picker = new Pikaday( {
43
- field: $field[ 0 ],
44
- blurFieldOnSelect: false,
45
- toString: dateToString,
46
- parse: parse,
47
- onSelect: updateValField,
48
- } );
49
-
50
- $field.change( function ( event ) {
51
- var dateVal = parse( $field.val() );
52
- updateValField( dateVal );
53
-
54
- // We trigger the change event on the hidden value field, so prevent 'change' from individual date inputs.
55
- event.preventDefault();
56
- return false;
57
- } );
58
-
59
- if ( initVal ) {
60
- $field.val( initVal );
61
- }
62
- return picker;
63
- }.bind( this );
64
-
65
- var initRange = valField.val() === '' ? { after: '', before: '' } : JSON.parse( valField.val() );
66
- var afterPicker = createPikadayInput( 'after', initRange.after );
67
- var beforePicker = createPikadayInput( 'before', initRange.before );
68
-
69
- valField.change( function ( event, data ) {
70
- if ( ! ( data && data.silent ) ) {
71
- var newRange = valField.val() === '' ? { after: '', before: '' } : JSON.parse( valField.val() );
72
- afterPicker.setDate( newRange.after );
73
- beforePicker.setDate( newRange.before );
74
- }
75
- } );
76
- } else if ( $dateRangeField.find( '.sowb-relative-date' ).length > 0 ) {
77
-
78
- $dateRangeField.find( '.sowb-relative-date' ).each( function () {
79
- var $name = $( this ).data( 'name' );
80
-
81
- $( this ).change( function () {
82
- var range = valField.val() === '' ? {} : JSON.parse( valField.val() );
83
-
84
- if ( ! range.hasOwnProperty( $name ) ) {
85
- range[ $name ] = {};
86
- }
87
-
88
- range[ $name ][ 'value' ] = $( this ).find( '> input' ).val();
89
- range[ $name ][ 'unit' ] = $( this ).find( '> select' ).val();
90
-
91
- valField.val( JSON.stringify( range ) );
92
- valField.trigger( 'change', { silent: true } );
93
- }.bind( this ) );
94
-
95
- valField.change( function ( event, data ) {
96
- if ( ! ( data && data.silent ) ) {
97
- var range = valField.val() === '' ? { from: {}, to: {} } : JSON.parse( valField.val() );
98
-
99
- if ( range.hasOwnProperty( $name ) ) {
100
- $( this ).find( '> input' ).val( range[ $name ][ 'value' ] );
101
- $( this ).find( '> select' ).val( range[ $name ][ 'unit' ] );
102
- }
103
- }
104
- }.bind( this ) );
105
-
106
- } );
107
- }
108
- $dateRangeField.data( 'initialized', true );
109
- } );
110
- })( jQuery );
1
+ /* global jQuery, pikaday */
2
+
3
+ (function( $ ) {
4
+ $( document ).on( 'sowsetupformfield', '.siteorigin-widget-field-type-date-range', function ( e ) {
5
+ var $dateRangeField = $( this );
6
+ var valField = $dateRangeField.find( 'input[type="hidden"][class="siteorigin-widget-input"]' );
7
+
8
+ if ( $dateRangeField.data( 'initialized' ) ) {
9
+ return;
10
+ }
11
+
12
+ if ( $dateRangeField.find( '[class*="sowb-specific-date"]' ).length > 0 ) {
13
+ var createPikadayInput = function ( inputName, initVal ) {
14
+ var $field = $dateRangeField.find( '.' + inputName + '-picker' );
15
+ var dateToString = function ( date, format ) {
16
+ var dateString = '';
17
+ if ( ! isNaN( date.valueOf() ) ) {
18
+ var day = date.getDate();
19
+ day = day < 10 ? '0' + day.toString() : day.toString();
20
+ var month = date.getMonth() + 1;
21
+ month = month < 10 ? '0' + month.toString() : month.toString();
22
+ var year = date.getFullYear();
23
+ return year + '-' + month + '-' + day;
24
+ }
25
+
26
+ return dateString;
27
+ };
28
+ var parse = function ( dateString, format ) {
29
+ var parts = dateString.split( '-' );
30
+ var day = parseInt( parts[ 2 ] );
31
+ var month = parseInt( parts[ 1 ] ) - 1;
32
+ var year = parseInt( parts[ 0 ] );
33
+ return new Date( year, month, day );
34
+ };
35
+ var updateValField = function ( date ) {
36
+ var curVal = valField.val() === '' ? {} : JSON.parse( valField.val() );
37
+ curVal[ inputName ] = dateToString( date );
38
+ $field.val( curVal[ inputName ] );
39
+ valField.val( JSON.stringify( curVal ) );
40
+ valField.trigger( 'change', { silent: true } );
41
+ };
42
+ var picker = new Pikaday( {
43
+ field: $field[ 0 ],
44
+ blurFieldOnSelect: false,
45
+ toString: dateToString,
46
+ parse: parse,
47
+ onSelect: updateValField,
48
+ } );
49
+
50
+ $field.change( function ( event ) {
51
+ var dateVal = parse( $field.val() );
52
+ updateValField( dateVal );
53
+
54
+ // We trigger the change event on the hidden value field, so prevent 'change' from individual date inputs.
55
+ event.preventDefault();
56
+ return false;
57
+ } );
58
+
59
+ if ( initVal ) {
60
+ $field.val( initVal );
61
+ }
62
+ return picker;
63
+ }.bind( this );
64
+
65
+ var initRange = valField.val() === '' ? { after: '', before: '' } : JSON.parse( valField.val() );
66
+ var afterPicker = createPikadayInput( 'after', initRange.after );
67
+ var beforePicker = createPikadayInput( 'before', initRange.before );
68
+
69
+ valField.change( function ( event, data ) {
70
+ if ( ! ( data && data.silent ) ) {
71
+ var newRange = valField.val() === '' ? { after: '', before: '' } : JSON.parse( valField.val() );
72
+ afterPicker.setDate( newRange.after );
73
+ beforePicker.setDate( newRange.before );
74
+ }
75
+ } );
76
+ } else if ( $dateRangeField.find( '.sowb-relative-date' ).length > 0 ) {
77
+
78
+ $dateRangeField.find( '.sowb-relative-date' ).each( function () {
79
+ var $name = $( this ).data( 'name' );
80
+
81
+ $( this ).change( function () {
82
+ var range = valField.val() === '' ? {} : JSON.parse( valField.val() );
83
+
84
+ if ( ! range.hasOwnProperty( $name ) ) {
85
+ range[ $name ] = {};
86
+ }
87
+
88
+ range[ $name ][ 'value' ] = $( this ).find( '> input' ).val();
89
+ range[ $name ][ 'unit' ] = $( this ).find( '> select' ).val();
90
+
91
+ valField.val( JSON.stringify( range ) );
92
+ valField.trigger( 'change', { silent: true } );
93
+ }.bind( this ) );
94
+
95
+ valField.change( function ( event, data ) {
96
+ if ( ! ( data && data.silent ) ) {
97
+ var range = valField.val() === '' ? { from: {}, to: {} } : JSON.parse( valField.val() );
98
+
99
+ if ( range.hasOwnProperty( $name ) ) {
100
+ $( this ).find( '> input' ).val( range[ $name ][ 'value' ] );
101
+ $( this ).find( '> select' ).val( range[ $name ][ 'unit' ] );
102
+ }
103
+ }
104
+ }.bind( this ) );
105
+
106
+ } );
107
+ }
108
+ $dateRangeField.data( 'initialized', true );
109
+ } );
110
+ })( jQuery );
base/inc/fields/js/icon-field.js CHANGED
@@ -1,229 +1,229 @@
1
- /* global jQuery, soWidgets */
2
-
3
- ( function( $ ) {
4
-
5
- var iconWidgetCache = {};
6
-
7
- $(document).on( 'sowsetupformfield', '.siteorigin-widget-field-type-icon', function(e) {
8
- var $$ = $(this),
9
- $is = $$.find('.siteorigin-widget-icon-selector'),
10
- $v = $is.find('.siteorigin-widget-icon-icon'),
11
- $b = $$.find('.siteorigin-widget-icon-selector-current'),
12
- $remove = $$.find( '.so-icon-remove' ),
13
- $search = $$.find( '.siteorigin-widget-icon-search' );
14
-
15
- if ( $$.data( 'initialized' ) ) {
16
- return;
17
- }
18
-
19
- // Clicking on the button should display the icon selector
20
- $b.click( function(){
21
- $is.slideToggle();
22
- $search.val( '' );
23
- searchIcons();
24
- } );
25
-
26
- // Clicking on the remove button
27
- $remove.click( function( e ){
28
- e.preventDefault();
29
-
30
- // Trigger a click on the existing icon to remove it.
31
- $$.find('.siteorigin-widget-active').click();
32
- } );
33
-
34
- var searchIcons = function(){
35
- var q = $search.val().toLowerCase();
36
- if( q === '' ) {
37
- $is.find('.siteorigin-widget-icon-icons-icon').show();
38
- }
39
- else {
40
- $is.find('.siteorigin-widget-icon-icons-icon').each( function(){
41
- var $$ = $( this ),
42
- value = $$.attr( 'data-value' );
43
-
44
- value = value.replace( /-/, ' ' );
45
- if( value.indexOf( q ) === -1 ) {
46
- $$.hide();
47
- }
48
- else {
49
- $$.show();
50
- }
51
- } );
52
- }
53
- };
54
-
55
- $search.keyup( searchIcons ).change( searchIcons );
56
-
57
- var renderStylesSelect = function ( init ) {
58
- var $familySelect = $is.find( 'select.siteorigin-widget-icon-family' );
59
- var family = $familySelect.val();
60
-
61
- if(typeof iconWidgetCache[family] === 'undefined') {
62
- return;
63
- }
64
-
65
- var $stylesSelect = $is.find( '.siteorigin-widget-icon-family-styles' );
66
- if ( !init ) {
67
- $stylesSelect.off( 'change', rerenderIcons );
68
- $stylesSelect.remove();
69
- var iconFamily = iconWidgetCache[ family ];
70
- if ( iconFamily.hasOwnProperty( 'styles' ) && iconFamily.styles ) {
71
- var options = '';
72
- for ( var styleClass in iconFamily.styles ) {
73
- options += '<option value="' + styleClass + '">' + iconFamily.styles[styleClass] + '</option>';
74
- }
75
- if ( options ) {
76
- $stylesSelect = $( '<select class="siteorigin-widget-icon-family-styles"></select>' ).append( options );
77
- $familySelect.after( $stylesSelect );
78
-
79
- }
80
- }
81
- }
82
- $stylesSelect.on( 'change', rerenderIcons );
83
- };
84
-
85
- var rerenderIcons = function() {
86
- var $familySelect = $is.find( 'select.siteorigin-widget-icon-family' );
87
- var family = $familySelect.val();
88
- var container = $is.find('.siteorigin-widget-icon-icons');
89
-
90
- if(typeof iconWidgetCache[family] === 'undefined') {
91
- return;
92
- }
93
-
94
- container.empty();
95
-
96
- var iconFamily = iconWidgetCache[ family ];
97
- var icons = iconFamily.icons;
98
- var style;
99
- if ( iconFamily.hasOwnProperty( 'styles' ) && iconFamily.styles ) {
100
- style = $is.find( '.siteorigin-widget-icon-family-styles' ).val();
101
- }
102
-
103
- if( $('#'+'siteorigin-widget-font-'+family).length === 0) {
104
-
105
- $("<link rel='stylesheet' type='text/css'>")
106
- .attr('id', 'siteorigin-widget-font-' + family)
107
- .attr('href', iconWidgetCache[family].style_uri)
108
- .appendTo('head');
109
- }
110
-
111
- for ( var i in icons ) {
112
- var iconData = icons[ i ];
113
- var unicode = iconData.hasOwnProperty('unicode' ) ? iconData.unicode : iconData;
114
- if ( iconData.hasOwnProperty( 'styles' ) && iconData.styles.indexOf( style ) === -1 ) {
115
- continue;
116
- }
117
- var familyStyle = 'sow-icon-' + family + ( style ? ' ' + style : '' );
118
- var familyValue = family + ( style ? '-' + style : '' ) + '-' + i;
119
- var $icon = $('<div data-sow-icon="' + unicode + '"/>')
120
- .attr('data-value', familyValue )
121
- .addClass( familyStyle )
122
- .addClass( 'siteorigin-widget-icon-icons-icon' )
123
- .click(function(){
124
- var $$ = $(this);
125
-
126
- if( $$.hasClass('siteorigin-widget-active') ) {
127
- // This is being unselected
128
- $$.removeClass('siteorigin-widget-active');
129
- $v.val( '' );
130
-
131
- // Hide the button icon
132
- $b.find('span').hide();
133
-
134
- $remove.hide();
135
- }
136
- else {
137
- // This is being selected
138
- container.find('.siteorigin-widget-icon-icons-icon').removeClass('siteorigin-widget-active');
139
- $$.addClass('siteorigin-widget-active');
140
- $v.val( $$.data( 'value' ) );
141
-
142
- // Also add this to the button
143
- $b.find('span')
144
- .show()
145
- .attr( 'data-sow-icon', $$.attr('data-sow-icon') )
146
- .attr( 'class', '' )
147
- .addClass( familyStyle );
148
-
149
- $remove.show();
150
- }
151
-
152
- $v.trigger( 'change', { isRendering: true });
153
-
154
- // Hide the icon selector
155
- $is.slideUp();
156
- });
157
-
158
- container.append( $icon );
159
-
160
- if( $v.val() === familyValue ) {
161
- // Add selected icon to the button.
162
- $b.find( 'span' )
163
- .show()
164
- .attr( 'data-sow-icon', $icon.attr( 'data-sow-icon' ) )
165
- .attr( 'class', '' )
166
- .addClass( familyStyle );
167
- $icon.addClass( 'siteorigin-widget-active' );
168
- }
169
- }
170
-
171
- // Move a selected item to the first position
172
- container.prepend( container.find('.siteorigin-widget-active') );
173
-
174
- searchIcons();
175
- };
176
-
177
- // Create the function for changing the icon family and call it once
178
- var changeIconFamily = function( init ){
179
- // Fetch the family icons from the server
180
- var family = $is.find('select.siteorigin-widget-icon-family').val();
181
-
182
- var dataIcons = $is.find('select.siteorigin-widget-icon-family option:selected' ).data('icons');
183
- if( dataIcons !== null ) {
184
- iconWidgetCache[family] = dataIcons;
185
- }
186
-
187
- if(typeof family === 'undefined' || family === '') {
188
- return;
189
- }
190
-
191
- if(typeof iconWidgetCache[family] === 'undefined') {
192
- var $container = $is.find('.siteorigin-widget-icon-icons');
193
- $container.addClass( 'loading' );
194
-
195
- $.getJSON(
196
- soWidgets.ajaxurl,
197
- {
198
- 'action' : 'siteorigin_widgets_get_icons',
199
- 'family' : $is.find('select.siteorigin-widget-icon-family').val()
200
- },
201
- function(data) {
202
- iconWidgetCache[family] = data;
203
- renderStylesSelect( init );
204
- $container.removeClass( 'loading' );
205
- rerenderIcons();
206
- }
207
- );
208
- }
209
- else {
210
- rerenderIcons();
211
- }
212
- };
213
- changeIconFamily( true );
214
-
215
- $is.find('select.siteorigin-widget-icon-family').change(function(){
216
- $is.find('.siteorigin-widget-icon-icons').empty();
217
- changeIconFamily();
218
- });
219
-
220
- $v.change( function ( event, data ) {
221
- if ( ! ( data && data.isRendering ) ) {
222
- rerenderIcons();
223
- }
224
- } );
225
-
226
- $$.data( 'initialized', true );
227
- } );
228
-
229
- } )( jQuery );
1
+ /* global jQuery, soWidgets */
2
+
3
+ ( function( $ ) {
4
+
5
+ var iconWidgetCache = {};
6
+
7
+ $(document).on( 'sowsetupformfield', '.siteorigin-widget-field-type-icon', function(e) {
8
+ var $$ = $(this),
9
+ $is = $$.find('.siteorigin-widget-icon-selector'),
10
+ $v = $is.find('.siteorigin-widget-icon-icon'),
11
+ $b = $$.find('.siteorigin-widget-icon-selector-current'),
12
+ $remove = $$.find( '.so-icon-remove' ),
13
+ $search = $$.find( '.siteorigin-widget-icon-search' );
14
+
15
+ if ( $$.data( 'initialized' ) ) {
16
+ return;
17
+ }
18
+
19
+ // Clicking on the button should display the icon selector
20
+ $b.click( function(){
21
+ $is.slideToggle();
22
+ $search.val( '' );
23
+ searchIcons();
24
+ } );
25
+
26
+ // Clicking on the remove button
27
+ $remove.click( function( e ){
28
+ e.preventDefault();
29
+
30
+ // Trigger a click on the existing icon to remove it.
31
+ $$.find('.siteorigin-widget-active').click();
32
+ } );
33
+
34
+ var searchIcons = function(){
35
+ var q = $search.val().toLowerCase();
36
+ if( q === '' ) {
37
+ $is.find('.siteorigin-widget-icon-icons-icon').show();
38
+ }
39
+ else {
40
+ $is.find('.siteorigin-widget-icon-icons-icon').each( function(){
41
+ var $$ = $( this ),
42
+ value = $$.attr( 'data-value' );
43
+
44
+ value = value.replace( /-/, ' ' );
45
+ if( value.indexOf( q ) === -1 ) {
46
+ $$.hide();
47
+ }
48
+ else {
49
+ $$.show();
50
+ }
51
+ } );
52
+ }
53
+ };
54
+
55
+ $search.keyup( searchIcons ).change( searchIcons );
56
+
57
+ var renderStylesSelect = function ( init ) {
58
+ var $familySelect = $is.find( 'select.siteorigin-widget-icon-family' );
59
+ var family = $familySelect.val();
60
+
61
+ if(typeof iconWidgetCache[family] === 'undefined') {
62
+ return;
63
+ }
64
+
65
+ var $stylesSelect = $is.find( '.siteorigin-widget-icon-family-styles' );
66
+ if ( !init ) {
67
+ $stylesSelect.off( 'change', rerenderIcons );
68
+ $stylesSelect.remove();
69
+ var iconFamily = iconWidgetCache[ family ];
70
+ if ( iconFamily.hasOwnProperty( 'styles' ) && iconFamily.styles ) {
71
+ var options = '';
72
+ for ( var styleClass in iconFamily.styles ) {
73
+ options += '<option value="' + styleClass + '">' + iconFamily.styles[styleClass] + '</option>';
74
+ }
75
+ if ( options ) {
76
+ $stylesSelect = $( '<select class="siteorigin-widget-icon-family-styles"></select>' ).append( options );
77
+ $familySelect.after( $stylesSelect );
78
+
79
+ }
80
+ }
81
+ }
82
+ $stylesSelect.on( 'change', rerenderIcons );
83
+ };
84
+
85
+ var rerenderIcons = function() {
86
+ var $familySelect = $is.find( 'select.siteorigin-widget-icon-family' );
87
+ var family = $familySelect.val();
88
+ var container = $is.find('.siteorigin-widget-icon-icons');
89
+
90
+ if(typeof iconWidgetCache[family] === 'undefined') {
91
+ return;
92
+ }
93
+
94
+ container.empty();
95
+
96
+ var iconFamily = iconWidgetCache[ family ];
97
+ var icons = iconFamily.icons;
98
+ var style;
99
+ if ( iconFamily.hasOwnProperty( 'styles' ) && iconFamily.styles ) {
100
+ style = $is.find( '.siteorigin-widget-icon-family-styles' ).val();
101
+ }
102
+
103
+ if( $('#'+'siteorigin-widget-font-'+family).length === 0) {
104
+
105
+ $("<link rel='stylesheet' type='text/css'>")
106
+ .attr('id', 'siteorigin-widget-font-' + family)
107
+ .attr('href', iconWidgetCache[family].style_uri)
108
+ .appendTo('head');
109
+ }
110
+
111
+ for ( var i in icons ) {
112
+ var iconData = icons[ i ];
113
+ var unicode = iconData.hasOwnProperty('unicode' ) ? iconData.unicode : iconData;
114
+ if ( iconData.hasOwnProperty( 'styles' ) && iconData.styles.indexOf( style ) === -1 ) {
115
+ continue;
116
+ }
117
+ var familyStyle = 'sow-icon-' + family + ( style ? ' ' + style : '' );
118
+ var familyValue = family + ( style ? '-' + style : '' ) + '-' + i;
119
+ var $icon = $('<div data-sow-icon="' + unicode + '"/>')
120
+ .attr('data-value', familyValue )
121
+ .addClass( familyStyle )
122
+ .addClass( 'siteorigin-widget-icon-icons-icon' )
123
+ .click(function(){
124
+ var $$ = $(this);
125
+
126
+ if( $$.hasClass('siteorigin-widget-active') ) {
127
+ // This is being unselected
128
+ $$.removeClass('siteorigin-widget-active');
129
+ $v.val( '' );
130
+
131
+ // Hide the button icon
132
+ $b.find('span').hide();
133
+
134
+ $remove.hide();
135
+ }
136
+ else {
137
+ // This is being selected
138
+ container.find('.siteorigin-widget-icon-icons-icon').removeClass('siteorigin-widget-active');
139
+ $$.addClass('siteorigin-widget-active');
140
+ $v.val( $$.data( 'value' ) );
141
+
142
+ // Also add this to the button
143
+ $b.find('span')
144
+ .show()
145
+ .attr( 'data-sow-icon', $$.attr('data-sow-icon') )
146
+ .attr( 'class', '' )
147
+ .addClass( familyStyle );
148
+
149
+ $remove.show();
150
+ }
151
+
152
+ $v.trigger( 'change', { isRendering: true });
153
+
154
+ // Hide the icon selector
155
+ $is.slideUp();
156
+ });
157
+
158
+ container.append( $icon );
159
+
160
+ if( $v.val() === familyValue ) {
161
+ // Add selected icon to the button.
162
+ $b.find( 'span' )
163
+ .show()
164
+ .attr( 'data-sow-icon', $icon.attr( 'data-sow-icon' ) )
165
+ .attr( 'class', '' )
166
+ .addClass( familyStyle );
167
+ $icon.addClass( 'siteorigin-widget-active' );
168
+ }
169
+ }
170
+
171
+ // Move a selected item to the first position
172
+ container.prepend( container.find('.siteorigin-widget-active') );
173
+
174
+ searchIcons();
175
+ };
176
+
177
+ // Create the function for changing the icon family and call it once
178
+ var changeIconFamily = function( init ){
179
+ // Fetch the family icons from the server
180
+ var family = $is.find('select.siteorigin-widget-icon-family').val();
181
+
182
+ var dataIcons = $is.find('select.siteorigin-widget-icon-family option:selected' ).data('icons');
183
+ if( dataIcons !== null ) {
184
+ iconWidgetCache[family] = dataIcons;
185
+ }
186
+
187
+ if(typeof family === 'undefined' || family === '') {
188
+ return;
189
+ }
190
+
191
+ if(typeof iconWidgetCache[family] === 'undefined') {
192
+ var $container = $is.find('.siteorigin-widget-icon-icons');
193
+ $container.addClass( 'loading' );
194
+
195
+ $.getJSON(
196
+ soWidgets.ajaxurl,
197
+ {
198
+ 'action' : 'siteorigin_widgets_get_icons',
199
+ 'family' : $is.find('select.siteorigin-widget-icon-family').val()
200
+ },
201
+ function(data) {
202
+ iconWidgetCache[family] = data;
203
+ renderStylesSelect( init );
204
+ $container.removeClass( 'loading' );
205
+ rerenderIcons();
206
+ }
207
+ );
208
+ }
209
+ else {
210
+ rerenderIcons();
211
+ }
212
+ };
213
+ changeIconFamily( true );
214
+
215
+ $is.find('select.siteorigin-widget-icon-family').change(function(){
216
+ $is.find('.siteorigin-widget-icon-icons').empty();
217
+ changeIconFamily();
218
+ });
219
+
220
+ $v.change( function ( event, data ) {
221
+ if ( ! ( data && data.isRendering ) ) {
222
+ rerenderIcons();
223
+ }
224
+ } );
225
+
226
+ $$.data( 'initialized', true );
227
+ } );
228
+
229
+ } )( jQuery );
base/inc/fields/js/image-radio-field.js CHANGED
@@ -1,18 +1,18 @@
1
- /* global jQuery, soWidgets */
2
-
3
- ( function($){
4
-
5
- $(document).on( 'sowsetupform', function(e) {
6
- var $form = $(e.target);
7
-
8
- $form.find( '.siteorigin-widget-field-type-image-radio' ).each( function(){
9
- var $$ = $( this );
10
- $$.find('input[type="radio"]:checked').parent().addClass('so-selected');
11
- $$.find('input[type="radio"]').on('change', function(){
12
- $$.find('input[type="radio"]').parent().removeClass('so-selected');
13
- $$.find('input[type="radio"]:checked').parent().addClass('so-selected');
14
- });
15
- } );
16
- });
17
-
18
- }( jQuery ) );
1
+ /* global jQuery, soWidgets */
2
+
3
+ ( function($){
4
+
5
+ $(document).on( 'sowsetupform', function(e) {
6
+ var $form = $(e.target);
7
+
8
+ $form.find( '.siteorigin-widget-field-type-image-radio' ).each( function(){
9
+ var $$ = $( this );
10
+ $$.find('input[type="radio"]:checked').parent().addClass('so-selected');
11
+ $$.find('input[type="radio"]').on('change', function(){
12
+ $$.find('input[type="radio"]').parent().removeClass('so-selected');
13
+ $$.find('input[type="radio"]:checked').parent().addClass('so-selected');
14
+ });
15
+ } );
16
+ });
17
+
18
+ }( jQuery ) );
base/inc/fields/js/media-field.js CHANGED
@@ -1,409 +1,409 @@
1
- /* global jQuery, soWidgets */
2
-
3
- ( function( $ ) {
4
-
5
- $(document).on( 'sowsetupformfield', '.siteorigin-widget-field-type-media', function(e) {
6
- var $field = $( this );
7
- var $media = $field.find('> .media-field-wrapper');
8
- var $inputField = $field.find( '.siteorigin-widget-input' ).not('.media-fallback-external');
9
-
10
- if ( $media.data( 'initialized' ) ) {
11
- return;
12
- }
13
-
14
- // Handle the media uploader
15
- $media.find( '.media-upload-button' ).click(function(e){
16
- e.preventDefault();
17
- if( typeof wp.media === 'undefined' ) {
18
- return;
19
- }
20
-
21
- var $$ = $(this);
22
- var frame = $(this ).data('frame');
23
-
24
- // If the media frame already exists, reopen it.
25
- if ( frame ) {
26
- frame.open();
27
- return false;
28
- }
29
-
30
- // Create the media frame.
31
- frame = wp.media( {
32
- // Set the title of the modal.
33
- title: $$.data('choose'),
34
-
35
- // Tell the modal to show only images.
36
- library: {
37
- type: $$.data('library').split(',').map(function(v){ return v.trim(); })
38
- },
39
-
40
- // Customize the submit button.
41
- button: {
42
- // Set the text of the button.
43
- text: $$.data('update'),
44
- // Tell the button not to close the modal, since we're
45
- // going to refresh the page when the image is selected.
46
- close: false
47
- }
48
- } );
49
-
50
- // Store the frame
51
- $$.data('frame', frame);
52
-
53
- // When an image is selected, run a callback.
54
- frame.on( 'select', function() {
55
- // Grab the selected attachment.
56
- var attachment = frame.state().get('selection').first().attributes;
57
-
58
- $field.find('.current .title' ).html(attachment.title);
59
- $inputField.val(attachment.id);
60
- $inputField.trigger( 'change', { silent: true } );
61
-
62
- var $thumbnail = $field.find( '.current .thumbnail' );
63
-
64
- if(typeof attachment.sizes !== 'undefined'){
65
- if(typeof attachment.sizes.thumbnail !== 'undefined'){
66
- $thumbnail.attr('src', attachment.sizes.thumbnail.url).fadeIn();
67
- }
68
- else {
69
- $thumbnail.attr('src', attachment.sizes.full.url).fadeIn();
70
- }
71
- }
72
- else{
73
- $thumbnail.attr('src', attachment.icon).fadeIn();
74
- }
75
-
76
- $field.find('.media-remove-button').removeClass('remove-hide');
77
-
78
- frame.close();
79
- } );
80
-
81
- // Finally, open the modal.
82
- frame.open();
83
- });
84
-
85
- $media.find('.current' )
86
- .mouseenter(function(){
87
- var t = $(this ).find('.title' );
88
- if( t.html() !== ''){
89
- t.fadeIn('fast');
90
- }
91
- })
92
- .mouseleave(function(){
93
- $(this ).find('.title' ).clearQueue().fadeOut('fast');
94
- });
95
-
96
- $field.find('a.media-remove-button' )
97
- .click( function( e ){
98
- e.preventDefault();
99
- $field.find('.current .title' ).html('');
100
- $inputField.val('');
101
- $inputField.trigger( 'change', { silent: true } );
102
- $field.find('.current .thumbnail' ).fadeOut('fast');
103
- $(this).addClass('remove-hide');
104
- } );
105
-
106
- // Everything for the dialog
107
- var dialog;
108
-
109
- var reflowDialog = function() {
110
- if( ! dialog ) return;
111
-
112
- var results = dialog.find('.so-widgets-image-results');
113
- if( results.length === 0 ) return;
114
-
115
- var width = results.width(),
116
- perRow = Math.floor( width / 276 ),
117
- spare = ( width - perRow * 276 ),
118
- resultWidth = spare / perRow + 260;
119
-
120
- results.find( '.so-widgets-result-image' ).css( {
121
- 'width' : resultWidth,
122
- 'height' : resultWidth / 1.4
123
- } );
124
- };
125
- $(window).resize( reflowDialog );
126
-
127
- var setupDialog = function(){
128
- if( ! dialog ) {
129
- // Create the dialog
130
- dialog = $( $('#so-widgets-bundle-tpl-image-search-dialog').html().trim() ).appendTo( 'body' );
131
- dialog.find( '.close' ).click( function(){
132
- dialog.hide();
133
- } );
134
-
135
- var results = dialog.find( '.so-widgets-image-results' );
136
-
137
- var fetchImages = function( query, page ){
138
- dialog.find( '.so-widgets-results-loading' ).fadeIn('fast');
139
- dialog.find( '.so-widgets-results-loading strong' ).html(
140
- dialog.find( '.so-widgets-results-loading strong' ).data( 'loading' )
141
- );
142
- dialog.find( '.so-widgets-results-more' ).hide();
143
-
144
- $.get(
145
- ajaxurl,
146
- {
147
- 'action' : 'so_widgets_image_search',
148
- 'q' : query,
149
- 'page' : page,
150
- '_sononce' : dialog.find('input[name="_sononce"]').val()
151
- },
152
- function( response ){
153
- if( response.error ) {
154
- alert( response.message );
155
- return;
156
- }
157
-
158
- results.removeClass( 'so-loading' );
159
- $.each( response.items, function( i, r ){
160
- var result = $( $('#so-widgets-bundle-tpl-image-search-result').html().trim() )
161
- .appendTo( results )
162
- .addClass( 'source-' + r.source );
163
- var img = result.find('.so-widgets-result-image');
164
-
165
- // Preload the image
166
- img.css( 'background-image', 'url(' + r.thumbnail + ')' );
167
- img.data( 'thumbnail', r.thumbnail );
168
- img.data( 'preview', r.preview );
169
-
170
- if( r.url ) {
171
- img.attr( {
172
- 'href': r.url,
173
- 'target': '_blank'
174
- } );
175
- }
176
-
177
- if( r.full_url ) {
178
- img.data( {
179
- 'full_url' : r.full_url,
180
- 'import_signature' : r.import_signature
181
- } );
182
- img.attr( 'href', r.full_url );
183
- }
184
-
185
- if( r.source === 'shutterstock' ) {
186
- img.append( $('#so-widgets-bundle-tpl-image-search-result-sponsored').html() );
187
- }
188
- } );
189
-
190
- if( page === 1 ) {
191
- dialog.find('#so-widgets-image-search-suggestions ul').empty();
192
- $.each( response.keywords, function( i, r ){
193
- dialog.find('#so-widgets-image-search-suggestions').show();
194
- dialog.find('#so-widgets-image-search-suggestions ul').append(
195
- $('<li></li>') . append( $('<a href="#"></a>').html( r ).data( 'keyword', r ) )
196
- );
197
- } );
198
- }
199
-
200
- dialog.find( '.so-widgets-results-loading' ).fadeOut('fast');
201
-
202
- reflowDialog();
203
- dialog
204
- .find( '.so-widgets-results-more' ).show()
205
- .find( 'button' ).data( { 'query': query, 'page' : page+1 } );
206
- }
207
- );
208
-
209
- };
210
-
211
- // Setup the search
212
- dialog.find('#so-widgets-image-search-form').submit( function( e ){
213
- e.preventDefault();
214
-
215
- // Perform the search
216
- var q = dialog.find('.so-widgets-search-input').val();
217
- results.empty();
218
-
219
- if( q !== '' ) {
220
- // Send the query to the server
221
- fetchImages( q, 1 );
222
- }
223
- } );
224
-
225
- // Clicking on the related search buttons
226
- dialog.on( 'click', '.so-keywords-list a', function( e ){
227
- e.preventDefault();
228
- var $$ = $(this).blur();
229
- dialog.find('.so-widgets-search-input').val( $$.data( 'keyword' ) );
230
- dialog.find('#so-widgets-image-search-form').submit();
231
- } );
232
-
233
- // Clicking on the more button
234
- dialog.find('.so-widgets-results-more button').click( function(){
235
- var $$ = $(this);
236
- fetchImages( $$.data( 'query' ), $$.data( 'page' ) );
237
- } );
238
-
239
- var hoverTimeout;
240
-
241
- // Clicking on an image to import it
242
- dialog.on( 'click', '.so-widgets-result-image', function( e ){
243
- var $$ = $(this);
244
- if( ! $$.data( 'full_url' ) ) {
245
- return;
246
- }
247
-
248
- e.preventDefault();
249
-
250
- if( confirm( dialog.data('confirm-import') ) ) {
251
- dialog.addClass( 'so-widgets-importing' );
252
-
253
- var postId = $( '#post_ID' ).val();
254
- if( postId === null ) {
255
- postId = '';
256
- }
257
-
258
- // Send the message to import the URL
259
- $.get(
260
- ajaxurl,
261
- {
262
- 'action' : 'so_widgets_image_import',
263
- 'full_url' : $$.data( 'full_url' ),
264
- 'import_signature' : $$.data( 'import_signature' ),
265
- 'post_id' : postId,
266
- '_sononce' : dialog.find('input[name="_sononce"]').val()
267
- },
268
- function( response ) {
269
- dialog.find('#so-widgets-image-search-frame').removeClass( 'so-widgets-importing' );
270
-
271
- if( response.error === false ) {
272
- // This was a success
273
- dialog.hide();
274
- dialog.find( '.so-widgets-results-loading' ).hide();
275
- $inputField.val( response.attachment_id ).trigger('change', { silent: true } );
276
- $field.find('.current .thumbnail' ).attr('src', response.thumb ).fadeIn();
277
-
278
- $field.find('.media-remove-button').removeClass('remove-hide');
279
- }
280
- else {
281
- alert( response.message );
282
- dialog.find( '.so-widgets-results-loading' ).hide();
283
- }
284
- }
285
- );
286
-
287
- // Clear the dialog
288
- dialog.find( '.so-widgets-results-loading' ).fadeIn('fast');
289
- dialog.find( '.so-widgets-results-loading strong' ).html(
290
- dialog.find( '.so-widgets-results-loading strong' ).data( 'importing' )
291
- );
292
- dialog.find( '.so-widgets-results-more' ).hide();
293
- dialog.find('#so-widgets-image-search-frame').addClass( 'so-widgets-importing' );
294
- }
295
- } );
296
-
297
- // Hovering over an image to preview it
298
- var previewWindow = dialog.find('.so-widgets-preview-window');
299
- dialog
300
- .on( 'mouseenter', '.so-widgets-result-image', function(){
301
- var $$ = $(this),
302
- preview = $$.data('preview');
303
-
304
- clearTimeout( hoverTimeout );
305
-
306
- hoverTimeout = setTimeout( function(){
307
- // Scale the preview sizes
308
- var scalePreviewX = 1, scalePreviewY = 1;
309
- if( preview[1] > $( window ).outerWidth() *0.33 ) {
310
- scalePreviewX = $( window ).outerWidth() *0.33 / preview[1];
311
- }
312
- if( preview[2] > $( window ).outerHeight() *0.5 ) {
313
- scalePreviewY = $( window ).outerHeight() *0.5 / preview[2];
314
- }
315
- var scalePreview = Math.min( scalePreviewX, scalePreviewY );
316
- // Never upscale
317
- if( scalePreview > 1 ) {
318
- scalePreview = 1;
319
- }
320
-
321
- previewWindow.show()
322
- .find('.so-widgets-preview-window-inside')
323
- .css( {
324
- 'background-image' : 'url(' + $$.data('thumbnail') + ')',
325
- 'width' : preview[1] * scalePreview,
326
- 'height' : preview[2] * scalePreview
327
- } )
328
- .append( $( '<img />' ).attr( 'src', preview[0] ) );
329
-
330
- dialog.trigger('mousemove');
331
- }, 1000 );
332
-
333
- } )
334
- .on( 'mouseleave', '.so-widgets-result-image', function(){
335
- previewWindow.hide().find('img').remove();
336
- clearTimeout( hoverTimeout );
337
- } );
338
-
339
- var lastX, lastY;
340
- dialog.on( 'mousemove', function( e ){
341
- if( e.clientX ) lastX = e.clientX;
342
- if( e.clientY ) lastY = e.clientY;
343
-
344
- if( previewWindow.is( ':visible' ) ) {
345
- var ph = previewWindow.outerHeight(),
346
- pw = previewWindow.outerWidth(),
347
- wh = $( window ).outerHeight(),
348
- ww = $( window ).outerWidth();
349
-
350
-
351
- // Calculate the top position
352
- var top = lastY - ph/2;
353
- top = Math.max( top, 10 );
354
- top = Math.min( top, wh - 10 - ph );
355
-
356
- // Calculate the left position
357
- var left = (lastX < ww/2) ? lastX + 15 : lastX - 15 - pw;
358
-
359
- // Figure out where the preview needs to go
360
- previewWindow.css({
361
- 'top': top,
362
- 'left': left
363
- });
364
-
365
- }
366
- } );
367
- }
368
-
369
- dialog.show();
370
- dialog.find( '.so-widgets-search-input' ).focus();
371
- };
372
-
373
- // Handle displaying the image search dialog
374
- $media.find( '.find-image-button' ).click( function(e){
375
- e.preventDefault();
376
- setupDialog();
377
- } );
378
-
379
- $inputField.change( function ( event, data ) {
380
- if ( ! ( data && data.silent ) ) {
381
- var newVal = $inputField.val();
382
- if ( newVal) {
383
- var $thumbnail = $field.find( '.current .thumbnail' );
384
- var attachment = wp.media.attachment( newVal );
385
- attachment.fetch().done( function () {
386
- if ( attachment.has( 'sizes' ) ) {
387
- var sizes = attachment.get( 'sizes' );
388
- if ( typeof sizes.thumbnail !== 'undefined' ) {
389
- $thumbnail.attr( 'src', sizes.thumbnail.url ).fadeIn();
390
- }
391
- else {
392
- $thumbnail.attr( 'src', sizes.full.url ).fadeIn();
393
- }
394
- }
395
- else {
396
- $thumbnail.attr( 'src', attachment.get('icon') ).fadeIn();
397
- }
398
- $field.find('.media-remove-button').removeClass('remove-hide');
399
- } );
400
- } else {
401
- $field.find( 'a.media-remove-button' ).click();
402
- }
403
- }
404
- } );
405
-
406
- $media.data( 'initialized', true );
407
- });
408
-
409
- } )( jQuery );
1
+ /* global jQuery, soWidgets */
2
+
3
+ ( function( $ ) {
4
+
5
+ $(document).on( 'sowsetupformfield', '.siteorigin-widget-field-type-media', function(e) {
6
+ var $field = $( this );
7
+ var $media = $field.find('> .media-field-wrapper');
8
+ var $inputField = $field.find( '.siteorigin-widget-input' ).not('.media-fallback-external');
9
+
10
+ if ( $media.data( 'initialized' ) ) {
11
+ return;
12
+ }
13
+
14
+ // Handle the media uploader
15
+ $media.find( '.media-upload-button' ).click(function(e){
16
+ e.preventDefault();
17
+ if( typeof wp.media === 'undefined' ) {
18
+ return;
19
+ }
20
+
21
+ var $$ = $(this);
22
+ var frame = $(this ).data('frame');
23
+
24
+ // If the media frame already exists, reopen it.
25
+ if ( frame ) {
26
+ frame.open();
27
+ return false;
28
+ }
29
+
30
+ // Create the media frame.
31
+ frame = wp.media( {
32
+ // Set the title of the modal.
33
+ title: $$.data('choose'),
34
+
35
+ // Tell the modal to show only images.
36
+ library: {
37
+ type: $$.data('library').split(',').map(function(v){ return v.trim(); })
38
+ },
39
+
40
+ // Customize the submit button.
41
+ button: {
42
+ // Set the text of the button.
43
+ text: $$.data('update'),
44
+ // Tell the button not to close the modal, since we're
45
+ // going to refresh the page when the image is selected.
46
+ close: false
47
+ }
48
+ } );
49
+
50
+ // Store the frame
51
+ $$.data('frame', frame);
52
+
53
+ // When an image is selected, run a callback.
54
+ frame.on( 'select', function() {
55
+ // Grab the selected attachment.
56
+ var attachment = frame.state().get('selection').first().attributes;
57
+
58
+ $field.find('.current .title' ).html(attachment.title);
59
+ $inputField.val(attachment.id);
60
+ $inputField.trigger( 'change', { silent: true } );
61
+
62
+ var $thumbnail = $field.find( '.current .thumbnail' );
63
+
64
+ if(typeof attachment.sizes !== 'undefined'){
65
+ if(typeof attachment.sizes.thumbnail !== 'undefined'){
66
+ $thumbnail.attr('src', attachment.sizes.thumbnail.url).fadeIn();
67
+ }
68
+ else {
69
+ $thumbnail.attr('src', attachment.sizes.full.url).fadeIn();
70
+ }
71
+ }
72
+ else{
73
+ $thumbnail.attr('src', attachment.icon).fadeIn();
74
+ }
75
+
76
+ $field.find('.media-remove-button').removeClass('remove-hide');
77
+
78
+ frame.close();
79
+ } );
80
+
81
+ // Finally, open the modal.
82
+ frame.open();
83
+ });
84
+
85
+ $media.find('.current' )
86
+ .mouseenter(function(){
87
+ var t = $(this ).find('.title' );
88
+ if( t.html() !== ''){
89
+ t.fadeIn('fast');
90
+ }
91
+ })
92
+ .mouseleave(function(){
93
+ $(this ).find('.title' ).clearQueue().fadeOut('fast');
94
+ });
95
+
96
+ $field.find('a.media-remove-button' )
97
+ .click( function( e ){
98
+ e.preventDefault();
99
+ $field.find('.current .title' ).html('');
100
+ $inputField.val('');
101
+ $inputField.trigger( 'change', { silent: true } );
102
+ $field.find('.current .thumbnail' ).fadeOut('fast');
103
+ $(this).addClass('remove-hide');
104
+ } );
105
+
106
+ // Everything for the dialog
107
+ var dialog;
108
+
109
+ var reflowDialog = function() {
110
+ if( ! dialog ) return;
111
+
112
+ var results = dialog.find('.so-widgets-image-results');
113
+ if( results.length === 0 ) return;
114
+
115
+ var width = results.width(),
116
+ perRow = Math.floor( width / 276 ),
117
+ spare = ( width - perRow * 276 ),
118
+ resultWidth = spare / perRow + 260;
119
+
120
+ results.find( '.so-widgets-result-image' ).css( {
121
+ 'width' : resultWidth,
122
+ 'height' : resultWidth / 1.4
123
+ } );
124
+ };
125
+ $(window).resize( reflowDialog );
126
+
127
+ var setupDialog = function(){
128
+ if( ! dialog ) {
129
+ // Create the dialog
130
+ dialog = $( $('#so-widgets-bundle-tpl-image-search-dialog').html().trim() ).appendTo( 'body' );
131
+ dialog.find( '.close' ).click( function(){
132
+ dialog.hide();
133
+ } );
134
+
135
+ var results = dialog.find( '.so-widgets-image-results' );
136
+
137
+ var fetchImages = function( query, page ){
138
+ dialog.find( '.so-widgets-results-loading' ).fadeIn('fast');
139
+ dialog.find( '.so-widgets-results-loading strong' ).html(
140
+ dialog.find( '.so-widgets-results-loading strong' ).data( 'loading' )
141
+ );
142
+ dialog.find( '.so-widgets-results-more' ).hide();
143
+
144
+ $.get(
145
+ ajaxurl,
146
+ {
147
+ 'action' : 'so_widgets_image_search',
148
+ 'q' : query,
149
+ 'page' : page,
150
+ '_sononce' : dialog.find('input[name="_sononce"]').val()
151
+ },
152
+ function( response ){
153
+ if( response.error ) {
154
+ alert( response.message );
155
+ return;
156
+ }
157
+
158
+ results.removeClass( 'so-loading' );
159
+ $.each( response.items, function( i, r ){
160
+ var result = $( $('#so-widgets-bundle-tpl-image-search-result').html().trim() )
161
+ .appendTo( results )
162
+ .addClass( 'source-' + r.source );
163
+ var img = result.find('.so-widgets-result-image');
164
+
165
+ // Preload the image
166
+ img.css( 'background-image', 'url(' + r.thumbnail + ')' );
167
+ img.data( 'thumbnail', r.thumbnail );
168
+ img.data( 'preview', r.preview );
169
+
170
+ if( r.url ) {
171
+ img.attr( {
172
+ 'href': r.url,
173
+ 'target': '_blank'
174
+ } );
175
+ }
176
+
177
+ if( r.full_url ) {
178
+ img.data( {
179
+ 'full_url' : r.full_url,
180
+ 'import_signature' : r.import_signature
181
+ } );
182
+ img.attr( 'href', r.full_url );
183
+ }
184
+
185
+ if( r.source === 'shutterstock' ) {
186
+ img.append( $('#so-widgets-bundle-tpl-image-search-result-sponsored').html() );
187
+ }
188
+ } );
189
+
190
+ if( page === 1 ) {
191
+ dialog.find('#so-widgets-image-search-suggestions ul').empty();
192
+ $.each( response.keywords, function( i, r ){
193
+ dialog.find('#so-widgets-image-search-suggestions').show();
194
+ dialog.find('#so-widgets-image-search-suggestions ul').append(
195
+ $('<li></li>') . append( $('<a href="#"></a>').html( r ).data( 'keyword', r ) )
196
+ );
197
+ } );
198
+ }
199
+
200
+ dialog.find( '.so-widgets-results-loading' ).fadeOut('fast');
201
+
202
+ reflowDialog();
203
+ dialog
204
+ .find( '.so-widgets-results-more' ).show()
205
+ .find( 'button' ).data( { 'query': query, 'page' : page+1 } );
206
+ }
207
+ );
208
+
209
+ };
210
+
211
+ // Setup the search
212
+ dialog.find('#so-widgets-image-search-form').submit( function( e ){
213
+ e.preventDefault();
214
+
215
+ // Perform the search
216
+ var q = dialog.find('.so-widgets-search-input').val();
217
+ results.empty();
218
+
219
+ if( q !== '' ) {
220
+ // Send the query to the server
221
+ fetchImages( q, 1 );
222
+ }
223
+ } );
224
+
225
+ // Clicking on the related search buttons
226
+ dialog.on( 'click', '.so-keywords-list a', function( e ){
227
+ e.preventDefault();
228
+ var $$ = $(this).blur();
229
+ dialog.find('.so-widgets-search-input').val( $$.data( 'keyword' ) );
230
+ dialog.find('#so-widgets-image-search-form').submit();
231
+ } );
232
+
233
+ // Clicking on the more button
234
+ dialog.find('.so-widgets-results-more button').click( function(){
235
+ var $$ = $(this);
236
+ fetchImages( $$.data( 'query' ), $$.data( 'page' ) );
237
+ } );
238
+
239
+ var hoverTimeout;
240
+
241
+ // Clicking on an image to import it
242
+ dialog.on( 'click', '.so-widgets-result-image', function( e ){
243
+ var $$ = $(this);
244
+ if( ! $$.data( 'full_url' ) ) {
245
+ return;
246
+ }
247
+
248
+ e.preventDefault();
249
+
250
+ if( confirm( dialog.data('confirm-import') ) ) {
251
+ dialog.addClass( 'so-widgets-importing' );
252
+
253
+ var postId = $( '#post_ID' ).val();
254
+ if( postId === null ) {
255
+ postId = '';
256
+ }
257
+
258
+ // Send the message to import the URL
259
+ $.get(
260
+ ajaxurl,
261
+ {
262
+ 'action' : 'so_widgets_image_import',
263
+ 'full_url' : $$.data( 'full_url' ),
264
+ 'import_signature' : $$.data( 'import_signature' ),
265
+ 'post_id' : postId,
266
+ '_sononce' : dialog.find('input[name="_sononce"]').val()
267
+ },
268
+ function( response ) {
269
+ dialog.find('#so-widgets-image-search-frame').removeClass( 'so-widgets-importing' );
270
+
271
+ if( response.error === false ) {
272
+ // This was a success
273
+ dialog.hide();
274
+ dialog.find( '.so-widgets-results-loading' ).hide();
275
+ $inputField.val( response.attachment_id ).trigger('change', { silent: true } );
276
+ $field.find('.current .thumbnail' ).attr('src', response.thumb ).fadeIn();
277
+
278
+ $field.find('.media-remove-button').removeClass('remove-hide');
279
+ }
280
+ else {
281
+ alert( response.message );
282
+ dialog.find( '.so-widgets-results-loading' ).hide();
283
+ }
284
+ }
285
+ );
286
+
287
+ // Clear the dialog
288
+ dialog.find( '.so-widgets-results-loading' ).fadeIn('fast');
289
+ dialog.find( '.so-widgets-results-loading strong' ).html(
290
+ dialog.find( '.so-widgets-results-loading strong' ).data( 'importing' )
291
+ );
292
+ dialog.find( '.so-widgets-results-more' ).hide();
293
+ dialog.find('#so-widgets-image-search-frame').addClass( 'so-widgets-importing' );
294
+ }
295
+ } );
296
+
297
+ // Hovering over an image to preview it
298
+ var previewWindow = dialog.find('.so-widgets-preview-window');
299
+ dialog
300
+ .on( 'mouseenter', '.so-widgets-result-image', function(){
301
+ var $$ = $(this),
302
+ preview = $$.data('preview');
303
+
304
+ clearTimeout( hoverTimeout );
305
+
306
+ hoverTimeout = setTimeout( function(){
307
+ // Scale the preview sizes
308
+ var scalePreviewX = 1, scalePreviewY = 1;
309
+ if( preview[1] > $( window ).outerWidth() *0.33 ) {
310
+ scalePreviewX = $( window ).outerWidth() *0.33 / preview[1];
311
+ }
312
+ if( preview[2] > $( window ).outerHeight() *0.5 ) {
313
+ scalePreviewY = $( window ).outerHeight() *0.5 / preview[2];
314
+ }
315
+ var scalePreview = Math.min( scalePreviewX, scalePreviewY );
316
+ // Never upscale
317
+ if( scalePreview > 1 ) {
318
+ scalePreview = 1;
319
+ }
320
+
321
+ previewWindow.show()
322
+ .find('.so-widgets-preview-window-inside')
323
+ .css( {
324
+ 'background-image' : 'url(' + $$.data('thumbnail') + ')',
325
+ 'width' : preview[1] * scalePreview,
326
+ 'height' : preview[2] * scalePreview
327
+ } )
328
+ .append( $( '<img />' ).attr( 'src', preview[0] ) );
329
+
330
+ dialog.trigger('mousemove');
331
+ }, 1000 );
332
+
333
+ } )
334
+ .on( 'mouseleave', '.so-widgets-result-image', function(){
335
+ previewWindow.hide().find('img').remove();
336
+ clearTimeout( hoverTimeout );
337
+ } );
338
+
339
+ var lastX, lastY;
340
+ dialog.on( 'mousemove', function( e ){
341
+ if( e.clientX ) lastX = e.clientX;
342
+ if( e.clientY ) lastY = e.clientY;
343
+
344
+ if( previewWindow.is( ':visible' ) ) {
345
+ var ph = previewWindow.outerHeight(),
346
+ pw = previewWindow.outerWidth(),
347
+ wh = $( window ).outerHeight(),
348
+ ww = $( window ).outerWidth();
349
+
350
+
351
+ // Calculate the top position
352
+ var top = lastY - ph/2;
353
+ top = Math.max( top, 10 );
354
+ top = Math.min( top, wh - 10 - ph );
355
+
356
+ // Calculate the left position
357
+ var left = (lastX < ww/2) ? lastX + 15 : lastX - 15 - pw;
358
+
359
+ // Figure out where the preview needs to go
360
+ previewWindow.css({
361
+ 'top': top,
362
+ 'left': left
363
+ });
364
+
365
+ }
366
+ } );
367
+ }
368
+
369
+ dialog.show();
370
+ dialog.find( '.so-widgets-search-input' ).focus();
371
+ };
372
+
373
+ // Handle displaying the image search dialog
374
+ $media.find( '.find-image-button' ).click( function(e){
375
+ e.preventDefault();
376
+ setupDialog();
377
+ } );
378
+
379
+ $inputField.change( function ( event, data ) {
380
+ if ( ! ( data && data.silent ) ) {
381
+ var newVal = $inputField.val();
382
+ if ( newVal) {
383
+ var $thumbnail = $field.find( '.current .thumbnail' );
384
+ var attachment = wp.media.attachment( newVal );
385
+ attachment.fetch().done( function () {
386
+ if ( attachment.has( 'sizes' ) ) {
387
+ var sizes = attachment.get( 'sizes' );
388
+ if ( typeof sizes.thumbnail !== 'undefined' ) {
389
+ $thumbnail.attr( 'src', sizes.thumbnail.url ).fadeIn();
390
+ }
391
+ else {
392
+ $thumbnail.attr( 'src', sizes.full.url ).fadeIn();
393
+ }
394
+ }
395
+ else {
396
+ $thumbnail.attr( 'src', attachment.get('icon') ).fadeIn();
397
+ }
398
+ $field.find('.media-remove-button').removeClass('remove-hide');
399
+ } );
400
+ } else {
401
+ $field.find( 'a.media-remove-button' ).click();
402
+ }
403
+ }
404
+ } );
405
+
406
+ $media.data( 'initialized', true );
407
+ });
408
+
409
+ } )( jQuery );
base/inc/fields/js/multi-measurement-field.js CHANGED
@@ -1,57 +1,57 @@
1
- /* global jQuery */
2
-
3
- (function( $ ) {
4
- $( document ).on( 'sowsetupformfield', '.siteorigin-widget-field-type-multi-measurement', function ( e ) {
5
-
6
- var valField = $( this ).find( 'input[type="hidden"][class="siteorigin-widget-input"]' );
7
- var separator = valField.data( 'separator' );
8
- var autoFillEnabled = valField.data( 'autofill' );
9
- var values = valField.val() === '' ? [] : valField.val().split( separator );
10
- var $valInputs = $( this ).find( '.sow-multi-measurement-input' );
11
- var $inputContainers = $( this ).find( '.sow-multi-measurement-input-container' );
12
-
13
- var updateValue = function ( $element ) {
14
- var vals = valField.val() === '' ? [] : valField.val().split( separator );
15
- var $unitInput = $element.find( '+ .sow-multi-measurement-select-unit' );
16
- var index = $valInputs.index( $element );
17
- vals[ index ] = $element.val() + ( $element.val() === '' ? '' : $unitInput.val() );
18
- valField.val( vals.join( separator ) );
19
- };
20
-
21
- $valInputs.each( function ( index, element ) {
22
- if ( values.length > index ) {
23
- var valueResult = values[ index ].match( /(\d+\.?\d*)([a-z%]+)*/ );
24
- if ( valueResult && valueResult.length ) {
25
- var amount = valueResult[ 1 ];
26
- var unit = valueResult[ 2 ];
27
- $( element ).val( amount );
28
- $( element ).find( '+ .sow-multi-measurement-select-unit' ).val( unit );
29
- }
30
- } else {
31
- updateValue( $( element ) );
32
- }
33
- } );
34
-
35
- $inputContainers.change( function ( event ) {
36
- var $valInput = $( event.currentTarget ).find( '> .sow-multi-measurement-input' );
37
- var doAutofill = autoFillEnabled;
38
- if ( autoFillEnabled ) {
39
- $valInputs.each( function ( index, element ) {
40
- // Only want to autofill if it has been enabled and no other inputs have values.
41
- if ( $( element ).attr( 'id' ) !== $valInput.eq( 0 ).attr( 'id' ) ) {
42
- doAutofill = doAutofill && !( $( element ).val() );
43
- }
44
- } );
45
- }
46
- if ( doAutofill ) {
47
- $valInputs.each( function( index, element ) {
48
- $( element ).val( $valInput.val() );
49
- updateValue( $( element ) );
50
- } );
51
- } else {
52
- updateValue( $valInput );
53
- }
54
- } );
55
-
56
- } );
57
- })( jQuery );
1
+ /* global jQuery */
2
+
3
+ (function( $ ) {
4
+ $( document ).on( 'sowsetupformfield', '.siteorigin-widget-field-type-multi-measurement', function ( e ) {
5
+
6
+ var valField = $( this ).find( 'input[type="hidden"][class="siteorigin-widget-input"]' );
7
+ var separator = valField.data( 'separator' );
8
+ var autoFillEnabled = valField.data( 'autofill' );
9
+ var values = valField.val() === '' ? [] : valField.val().split( separator );
10
+ var $valInputs = $( this ).find( '.sow-multi-measurement-input' );
11
+ var $inputContainers = $( this ).find( '.sow-multi-measurement-input-container' );
12
+
13
+ var updateValue = function ( $element ) {
14
+ var vals = valField.val() === '' ? [] : valField.val().split( separator );
15
+ var $unitInput = $element.find( '+ .sow-multi-measurement-select-unit' );
16
+ var index = $valInputs.index( $element );
17
+ vals[ index ] = $element.val() + ( $element.val() === '' ? '' : $unitInput.val() );
18
+ valField.val( vals.join( separator ) );
19
+ };
20
+
21
+ $valInputs.each( function ( index, element ) {
22
+ if ( values.length > index ) {
23
+ var valueResult = values[ index ].match( /(\d+\.?\d*)([a-z%]+)*/ );
24
+ if ( valueResult && valueResult.length ) {
25
+ var amount = valueResult[ 1 ];
26
+ var unit = valueResult[ 2 ];
27
+ $( element ).val( amount );
28
+ $( element ).find( '+ .sow-multi-measurement-select-unit' ).val( unit );
29
+ }
30
+ } else {
31
+ updateValue( $( element ) );
32
+ }
33
+ } );
34
+
35
+ $inputContainers.change( function ( event ) {
36
+ var $valInput = $( event.currentTarget ).find( '> .sow-multi-measurement-input' );
37
+ var doAutofill = autoFillEnabled;
38
+ if ( autoFillEnabled ) {
39
+ $valInputs.each( function ( index, element ) {
40
+ // Only want to autofill if it has been enabled and no other inputs have values.
41
+ if ( $( element ).attr( 'id' ) !== $valInput.eq( 0 ).attr( 'id' ) ) {
42
+ doAutofill = doAutofill && !( $( element ).val() );
43
+ }
44
+ } );
45
+ }
46
+ if ( doAutofill ) {
47
+ $valInputs.each( function( index, element ) {
48
+ $( element ).val( $valInput.val() );
49
+ updateValue( $( element ) );
50
+ } );
51
+ } else {
52
+ updateValue( $valInput );
53
+ }
54
+ } );
55
+
56
+ } );
57
+ })( jQuery );
base/inc/fields/js/tinymce-field.js CHANGED
@@ -1,145 +1,145 @@
1
- /* global tinymce, switchEditors */
2
-
3
- (function ( $ ) {
4
- var setup = function( $field ) {
5
-
6
- if ( $field.data( 'initialized' ) ) {
7
- return;
8
- }
9
-
10
- var wpEditor = wp.oldEditor ? wp.oldEditor : wp.editor;
11
- if ( wpEditor && wpEditor.hasOwnProperty( 'autop' ) ) {
12
- wp.editor.autop = wpEditor.autop;
13
- wp.editor.removep = wpEditor.removep;
14
- wp.editor.initialize = wpEditor.initialize
15
- }
16
-
17
- var $container = $field.find( '.siteorigin-widget-tinymce-container' );
18
- var settings = $container.data( 'editorSettings' );
19
- var $wpautopToggleField;
20
- if ( settings.wpautopToggleField ) {
21
- var $widgetForm = $container.closest( '.siteorigin-widget-form' );
22
- $wpautopToggleField = $widgetForm.find( settings.wpautopToggleField );
23
- settings.tinymce.wpautop = $wpautopToggleField.is( ':checked' );
24
- }
25
- var $textarea = $container.find( 'textarea' );
26
- var id = $textarea.attr( 'id' );
27
- var setupEditor = function ( editor ) {
28
- editor.on( 'change',
29
- function () {
30
- var ed = window.tinymce.get( id );
31
- ed.save();
32
- $textarea.trigger( 'change' );
33
- }
34
- );
35
- if ( $wpautopToggleField ) {
36
- $wpautopToggleField.off( 'change' );
37
- $wpautopToggleField.on( 'change', function () {
38
- wp.editor.remove( id );
39
- settings.tinymce.wpautop = $wpautopToggleField.is( ':checked' );
40
- wp.editor.initialize( id, settings );
41
- } );
42
- }
43
- };
44
-
45
- if ( settings.tinymce ) {
46
- settings.tinymce = $.extend( {}, settings.tinymce, { selector: '#' + id, setup: setupEditor } );
47
- }
48
- $( document ).on( 'wp-before-tinymce-init', function ( event, init ) {
49
- if ( init.selector === settings.tinymce.selector ) {
50
- var mediaButtons = $container.data( 'mediaButtons' );
51
- if ( $field.find( '.wp-media-buttons' ).length === 0 ) {
52
- $field.find( '.wp-editor-tabs' ).before( mediaButtons.html );
53
- }
54
- }
55
- } );
56
- $( document ).on( 'tinymce-editor-setup', function () {
57
- var $wpEditorWrap = $field.find( '.wp-editor-wrap' );
58
- if ( $wpEditorWrap.length > 0 && ! $wpEditorWrap.hasClass( settings.selectedEditor + '-active' ) ) {
59
- setTimeout( function () {
60
- window.switchEditors.go( id );
61
- }, 10 );
62
- }
63
- } );
64
-
65
- wpEditor.remove( id );
66
- if ( window.tinymce ) {
67
- window.tinymce.EditorManager.overrideDefaults( { base_url: settings.baseURL, suffix: settings.suffix } );
68
- }
69
- // Wait for textarea to be visible before initialization.
70
- if ( $textarea.is( ':visible' ) ) {
71
- wpEditor.initialize( id, settings );
72
- }
73
- else {
74
- var intervalId = setInterval( function () {
75
- if ( $textarea.is( ':visible' ) ) {
76
- wpEditor.initialize( id, settings );
77
- clearInterval( intervalId );
78
- }
79
- }, 500);
80
- }
81
-
82
- $field.on( 'click', function ( event ) {
83
- var $target = $( event.target );
84
- if ( ! $target.is( '.wp-switch-editor' ) ) {
85
- return;
86
- }
87
- var mode = $target.hasClass( 'switch-tmce' ) ? 'tmce' : 'html';
88
- if ( mode === 'tmce' ) {
89
- var editor = window.tinymce.get( id );
90
- // Quick bit of sanitization to prevent catastrophic backtracking in TinyMCE HTML parser regex
91
- if ( editor !== null ) {
92
- var content = $textarea.val();
93
- if ( content.search( '<' ) !== -1 && content.search( '>' ) === -1) {
94
- content = content.replace( /</g, '' );
95
- $textarea.val( content );
96
- }
97
- editor.setContent(window.switchEditors.wpautop(content));
98
- }
99
- }
100
- settings.selectedEditor = mode;
101
- $field.find( '.siteorigin-widget-tinymce-selected-editor' ).val( mode );
102
- } );
103
-
104
- $field.data( 'initialized', true );
105
- };
106
-
107
- $( document ).on( 'sowsetupformfield', '.siteorigin-widget-field-type-tinymce', function () {
108
- var $field = $( this );
109
- var $parentRepeaterItem = $field.closest( '.siteorigin-widget-field-repeater-item-form' );
110
-
111
- if ( $parentRepeaterItem.length > 0 ) {
112
- if ( $parentRepeaterItem.is( ':visible' ) ) {
113
- setup( $field );
114
- }
115
- else {
116
- $parentRepeaterItem.on('slideToggleOpenComplete', function onSlideToggleComplete() {
117
- if ( $parentRepeaterItem.is( ':visible' ) ) {
118
- setup( $field );
119
- $parentRepeaterItem.off( 'slideToggleOpenComplete' );
120
- }
121
- });
122
- }
123
- }
124
- else {
125
- setup( $field );
126
- }
127
- });
128
-
129
- $( document ).on( 'sortstop', function ( event, ui ) {
130
- var $form;
131
- if ( ui.item.is( '.siteorigin-widget-field-repeater-item' ) ) {
132
- $form = ui.item.find( '> .siteorigin-widget-field-repeater-item-form' );
133
- }
134
- else {
135
- $form = ui.item.find('.siteorigin-widget-form');
136
- }
137
-
138
- $form.find( '.siteorigin-widget-field-type-tinymce' ).each( function () {
139
- $( this ).data( 'initialized', null );
140
- setup( $( this ) );
141
- } );
142
-
143
- });
144
-
145
- })( jQuery );
1
+ /* global tinymce, switchEditors */
2
+
3
+ (function ( $ ) {
4
+ var setup = function( $field ) {
5
+
6
+ if ( $field.data( 'initialized' ) ) {
7
+ return;
8
+ }
9
+
10
+ var wpEditor = wp.oldEditor ? wp.oldEditor : wp.editor;
11
+ if ( wpEditor && wpEditor.hasOwnProperty( 'autop' ) ) {
12
+ wp.editor.autop = wpEditor.autop;
13
+ wp.editor.removep = wpEditor.removep;
14
+ wp.editor.initialize = wpEditor.initialize
15
+ }
16
+
17
+ var $container = $field.find( '.siteorigin-widget-tinymce-container' );
18
+ var settings = $container.data( 'editorSettings' );
19
+ var $wpautopToggleField;
20
+ if ( settings.wpautopToggleField ) {
21
+ var $widgetForm = $container.closest( '.siteorigin-widget-form' );
22
+ $wpautopToggleField = $widgetForm.find( settings.wpautopToggleField );
23
+ settings.tinymce.wpautop = $wpautopToggleField.is( ':checked' );
24
+ }
25
+ var $textarea = $container.find( 'textarea' );
26
+ var id = $textarea.attr( 'id' );
27
+ var setupEditor = function ( editor ) {
28
+ editor.on( 'change',
29
+ function () {
30
+ var ed = window.tinymce.get( id );
31
+ ed.save();
32
+ $textarea.trigger( 'change' );
33
+ }
34
+ );
35
+ if ( $wpautopToggleField ) {
36
+ $wpautopToggleField.off( 'change' );
37
+ $wpautopToggleField.on( 'change', function () {
38
+ wp.editor.remove( id );
39
+ settings.tinymce.wpautop = $wpautopToggleField.is( ':checked' );
40
+ wp.editor.initialize( id, settings );
41
+ } );
42
+ }
43
+ };
44
+
45
+ if ( settings.tinymce ) {
46
+ settings.tinymce = $.extend( {}, settings.tinymce, { selector: '#' + id, setup: setupEditor } );
47
+ }
48
+ $( document ).on( 'wp-before-tinymce-init', function ( event, init ) {
49
+ if ( init.selector === settings.tinymce.selector ) {
50
+ var mediaButtons = $container.data( 'mediaButtons' );
51
+ if ( $field.find( '.wp-media-buttons' ).length === 0 ) {
52
+ $field.find( '.wp-editor-tabs' ).before( mediaButtons.html );
53
+ }
54
+ }
55
+ } );
56
+ $( document ).on( 'tinymce-editor-setup', function () {
57
+ var $wpEditorWrap = $field.find( '.wp-editor-wrap' );
58
+ if ( $wpEditorWrap.length > 0 && ! $wpEditorWrap.hasClass( settings.selectedEditor + '-active' ) ) {
59
+ setTimeout( function () {
60
+ window.switchEditors.go( id );
61
+ }, 10 );
62
+ }
63
+ } );
64
+
65
+ wpEditor.remove( id );
66
+ if ( window.tinymce ) {
67
+ window.tinymce.EditorManager.overrideDefaults( { base_url: settings.baseURL, suffix: settings.suffix } );
68
+ }
69
+ // Wait for textarea to be visible before initialization.
70
+ if ( $textarea.is( ':visible' ) ) {
71
+ wpEditor.initialize( id, settings );
72
+ }
73
+ else {
74
+ var intervalId = setInterval( function () {
75
+ if ( $textarea.is( ':visible' ) ) {
76
+ wpEditor.initialize( id, settings );
77
+ clearInterval( intervalId );
78
+ }
79
+ }, 500);
80
+ }
81
+
82
+ $field.on( 'click', function ( event ) {
83
+ var $target = $( event.target );
84
+ if ( ! $target.is( '.wp-switch-editor' ) ) {
85
+ return;
86
+ }
87
+ var mode = $target.hasClass( 'switch-tmce' ) ? 'tmce' : 'html';
88
+ if ( mode === 'tmce' ) {
89
+ var editor = window.tinymce.get( id );
90
+ // Quick bit of sanitization to prevent catastrophic backtracking in TinyMCE HTML parser regex
91
+ if ( editor !== null ) {
92
+ var content = $textarea.val();
93
+ if ( content.search( '<' ) !== -1 && content.search( '>' ) === -1) {
94
+ content = content.replace( /</g, '' );
95
+ $textarea.val( content );
96
+ }
97
+ editor.setContent(window.switchEditors.wpautop(content));
98
+ }
99
+ }
100
+ settings.selectedEditor = mode;
101
+ $field.find( '.siteorigin-widget-tinymce-selected-editor' ).val( mode );
102
+ } );
103
+
104
+ $field.data( 'initialized', true );
105
+ };
106
+
107
+ $( document ).on( 'sowsetupformfield', '.siteorigin-widget-field-type-tinymce', function () {
108
+ var $field = $( this );
109
+ var $parentRepeaterItem = $field.closest( '.siteorigin-widget-field-repeater-item-form' );
110
+
111
+ if ( $parentRepeaterItem.length > 0 ) {
112
+ if ( $parentRepeaterItem.is( ':visible' ) ) {
113
+ setup( $field );
114
+ }
115
+ else {
116
+ $parentRepeaterItem.on('slideToggleOpenComplete', function onSlideToggleComplete() {
117
+ if ( $parentRepeaterItem.is( ':visible' ) ) {
118
+ setup( $field );
119
+ $parentRepeaterItem.off( 'slideToggleOpenComplete' );
120
+ }
121
+ });
122
+ }
123
+ }
124
+ else {
125
+ setup( $field );
126
+ }
127
+ });
128
+
129
+ $( document ).on( 'sortstop', function ( event, ui ) {
130
+ var $form;
131
+ if ( ui.item.is( '.siteorigin-widget-field-repeater-item' ) ) {
132
+ $form = ui.item.find( '> .siteorigin-widget-field-repeater-item-form' );
133
+ }
134
+ else {
135
+ $form = ui.item.find('.siteorigin-widget-form');
136
+ }
137
+
138
+ $form.find( '.siteorigin-widget-field-type-tinymce' ).each( function () {
139
+ $( this ).data( 'initialized', null );
140
+ setup( $( this ) );
141
+ } );
142
+
143
+ });
144
+
145
+ })( jQuery );
base/inc/fields/multi-measurement.class.php CHANGED
@@ -1,122 +1,122 @@
1
- <?php
2
-
3
- /**
4
- * Class SiteOrigin_Widget_Field_Multi_Measurement
5
- */
6
- class SiteOrigin_Widget_Field_Multi_Measurement extends SiteOrigin_Widget_Field_Text_Input_Base {
7
-
8
- /**
9
- * Configuration of the measurements to be taken. Should be in the form:
10
- * `array(
11
- * 'padding_left' => array(
12
- * 'label' => __( 'Padding left', 'so-widgets-bundle' ),
13
- * 'units' => array( 'px', 'rem', 'em', '%' ),
14
- * ),
15
- * 'padding_right' => __( 'Padding right', 'so-widgets-bundle' ),
16
- * 'padding_bottom' => __( 'Padding bottom', 'so-widgets-bundle' ),
17
- * 'padding_top' => __( 'Padding top', 'so-widgets-bundle' ),
18
- * )`
19
- *
20
- * The 'units' property is optional and defaults to the list returned by `siteorigin_widgets_get_measurements_list`.
21
- *
22
- * @access protected
23
- * @var array
24
- */
25
- protected $measurements;
26
-
27
- /**
28
- * String separator for the measurements. Default is an empty space.
29
- *
30
- * @access protected
31
- * @var string
32
- */
33
- protected $separator;
34
-
35
- /**
36
- * Whether to automatically fill the rest of the inputs when the first value is entered.
37
- * Default is false.
38
- *
39
- * @access protected
40
- * @var boolean
41
- */
42
- protected $autofill;
43
-
44
- protected function get_default_options() {
45
- return array(
46
- 'separator' => ' ',
47
- 'autofill' => false,
48
- );
49
- }
50
-
51
- protected function render_field( $value, $instance ) {
52
- ?>
53
- <div class="sow-multi-measurement-container">
54
- <?php
55
- foreach ( $this->measurements as $name => $measurement_config ) {
56
-
57
- if ( is_array( $measurement_config ) ) {
58
- $label = empty( $measurement_config['label'] ) ? '' : $measurement_config['label'];
59
- } else {
60
- $label = $measurement_config;
61
- }
62
- $default_measurements = siteorigin_widgets_get_measurements_list();
63
- $units = empty( $measurement_config['units'] ) ?
64
- $default_measurements :
65
- $measurement_config['units'];
66
- if ( empty( $units ) ) {
67
- $units = array( 'px' );
68
- }
69
- $input_id = $this->element_id . '-' . $name;
70
- ?>
71
- <div class="sow-multi-measurement-input-container">
72
- <label for="<?php echo esc_attr( $input_id ) ?>"><?php echo esc_html( $label ) ?></label>
73
- <input id="<?php echo esc_attr( $input_id ) ?>" type="text" class="sow-multi-measurement-input">
74
- <select class="sow-multi-measurement-select-unit">
75
- <?php foreach ( (array) $units as $unit ):?>
76
- <option value="<?php echo esc_attr( $unit ) ?>"><?php echo esc_html( $unit ) ?></option>
77
- <?php endforeach?>
78
- </select>
79
- <div class="clear"></div>
80
- </div>
81
- <?php
82
- }
83
- ?>
84
- </div>
85
- <input type="hidden"
86
- class="siteorigin-widget-input"
87
- value="<?php echo esc_attr( $value ) ?>"
88
- name="<?php echo esc_attr( $this->element_name ) ?>"
89
- data-autofill="<?php echo empty( $this->autofill ) ? 'false' : 'true'; ?>"
90
- data-separator="<?php echo esc_attr( $this->separator ) ?>"/><?php
91
- }
92
-
93
- public function enqueue_scripts() {
94
- wp_enqueue_style( 'so-multi-measurement-field', plugin_dir_url( __FILE__ ) . 'css/multi-measurement-field.css', array(),
95
- SOW_BUNDLE_VERSION );
96
- wp_enqueue_script( 'so-multi-measurement-field',
97
- plugin_dir_url( __FILE__ ) . 'js/multi-measurement-field' . SOW_BUNDLE_JS_SUFFIX . '.js', array( 'jquery' ),
98
- SOW_BUNDLE_VERSION );
99
- }
100
-
101
- protected function sanitize_field_input( $value, $instance ) {
102
- if ( empty( $value ) ) {
103
- return $value;
104
- }
105
-
106
- $values = explode( $this->separator, $value );
107
- $any_values = false;
108
- foreach ( $values as $index => $measurement ) {
109
- $any_values = $any_values || ! empty( $measurement );
110
- preg_match('/(\d+\.?\d*)([a-z%]+)*/', $measurement, $matches);
111
-
112
- $num_matches = count( $matches );
113
-
114
- $val = $num_matches > 1 ? $matches[1] : '0';
115
- $unit = $num_matches > 2 ? $matches[2] : 'px';
116
- $measurement = $val . $unit;
117
- $values[ $index ] = $measurement;
118
- }
119
- // If all values are empty, just return an empty string.
120
- return $any_values ? implode( $this->separator, $values ) : '';
121
- }
122
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class SiteOrigin_Widget_Field_Multi_Measurement
5
+ */
6
+ class SiteOrigin_Widget_Field_Multi_Measurement extends SiteOrigin_Widget_Field_Text_Input_Base {
7
+
8
+ /**
9
+ * Configuration of the measurements to be taken. Should be in the form:
10
+ * `array(
11
+ * 'padding_left' => array(
12
+ * 'label' => __( 'Padding left', 'so-widgets-bundle' ),
13
+ * 'units' => array( 'px', 'rem', 'em', '%' ),
14
+ * ),
15
+ * 'padding_right' => __( 'Padding right', 'so-widgets-bundle' ),
16
+ * 'padding_bottom' => __( 'Padding bottom', 'so-widgets-bundle' ),
17
+ * 'padding_top' => __( 'Padding top', 'so-widgets-bundle' ),
18
+ * )`
19
+ *
20
+ * The 'units' property is optional and defaults to the list returned by `siteorigin_widgets_get_measurements_list`.
21
+ *
22
+ * @access protected
23
+ * @var array
24
+ */
25
+ protected $measurements;
26
+
27
+ /**
28
+ * String separator for the measurements. Default is an empty space.
29
+ *
30
+ * @access protected
31
+ * @var string
32
+ */
33
+ protected $separator;
34
+
35
+ /**
36
+ * Whether to automatically fill the rest of the inputs when the first value is entered.
37
+ * Default is false.
38
+ *
39
+ * @access protected
40
+ * @var boolean
41
+ */
42
+ protected $autofill;
43
+
44
+ protected function get_default_options() {
45
+ return array(
46
+ 'separator' => ' ',
47
+ 'autofill' => false,
48
+ );
49
+ }
50
+
51
+ protected function render_field( $value, $instance ) {
52
+ ?>
53
+ <div class="sow-multi-measurement-container">
54
+ <?php
55
+ foreach ( $this->measurements as $name => $measurement_config ) {
56
+
57
+ if ( is_array( $measurement_config ) ) {
58
+ $label = empty( $measurement_config['label'] ) ? '' : $measurement_config['label'];
59
+ } else {
60
+ $label = $measurement_config;
61
+ }
62
+ $default_measurements = siteorigin_widgets_get_measurements_list();
63
+ $units = empty( $measurement_config['units'] ) ?
64
+ $default_measurements :
65
+ $measurement_config['units'];
66
+ if ( empty( $units ) ) {
67
+ $units = array( 'px' );
68
+ }
69
+ $input_id = $this->element_id . '-' . $name;
70
+ ?>
71
+ <div class="sow-multi-measurement-input-container">
72
+ <label for="<?php echo esc_attr( $input_id ) ?>"><?php echo esc_html( $label ) ?></label>
73
+ <input id="<?php echo esc_attr( $input_id ) ?>" type="text" class="sow-multi-measurement-input">
74
+ <select class="sow-multi-measurement-select-unit">
75
+ <?php foreach ( (array) $units as $unit ):?>
76
+ <option value="<?php echo esc_attr( $unit ) ?>"><?php echo esc_html( $unit ) ?></option>
77
+ <?php endforeach?>
78
+ </select>
79
+ <div class="clear"></div>
80
+ </div>
81
+ <?php
82
+ }
83
+ ?>
84
+ </div>
85
+ <input type="hidden"
86
+ class="siteorigin-widget-input"
87
+ value="<?php echo esc_attr( $value ) ?>"
88
+ name="<?php echo esc_attr( $this->element_name ) ?>"
89
+ data-autofill="<?php echo empty( $this->autofill ) ? 'false' : 'true'; ?>"
90
+ data-separator="<?php echo esc_attr( $this->separator ) ?>"/><?php
91
+ }
92
+
93
+ public function enqueue_scripts() {
94
+ wp_enqueue_style( 'so-multi-measurement-field', plugin_dir_url( __FILE__ ) . 'css/multi-measurement-field.css', array(),
95
+ SOW_BUNDLE_VERSION );
96
+ wp_enqueue_script( 'so-multi-measurement-field',
97
+ plugin_dir_url( __FILE__ ) . 'js/multi-measurement-field' . SOW_BUNDLE_JS_SUFFIX . '.js', array( 'jquery' ),
98
+ SOW_BUNDLE_VERSION );
99
+ }
100
+
101
+ protected function sanitize_field_input( $value, $instance ) {
102
+ if ( empty( $value ) ) {
103
+ return $value;
104
+ }
105
+
106
+ $values = explode( $this->separator, $value );
107
+ $any_values = false;
108
+ foreach ( $values as $index => $measurement ) {
109
+ $any_values = $any_values || ! empty( $measurement );
110
+ preg_match('/(\d+\.?\d*)([a-z%]+)*/', $measurement, $matches);
111
+
112
+ $num_matches = count( $matches );
113
+
114
+ $val = $num_matches > 1 ? $matches[1] : '0';
115
+ $unit = $num_matches > 2 ? $matches[2] : 'px';
116
+ $measurement = $val . $unit;
117
+ $values[ $index ] = $measurement;
118
+ }
119
+ // If all values are empty, just return an empty string.
120
+ return $any_values ? implode( $this->separator, $values ) : '';
121
+ }
122
+ }
base/inc/fields/order.class.php CHANGED
@@ -1,61 +1,61 @@
1
- <?php
2
-
3
- /**
4
- * Class SiteOrigin_Widget_Field_Order
5
- */
6
- class SiteOrigin_Widget_Field_Order extends SiteOrigin_Widget_Field_Base {
7
-
8
- protected $options;
9
-
10
- protected function render_field( $value, $instance ) {
11
-
12
- $value = $this->sanitize_field_input( $value, $instance );
13
-
14
- if( ! empty( $this->options ) && ! empty( $value ) ) {
15
- ?><div class="siteorigin-widget-order-items"><?php
16
- foreach( $value as $key ) {
17
- ?>
18
- <div class="siteorigin-widget-order-item" data-value="<?php echo esc_attr( $key ) ?>">
19
- <?php echo esc_html( $this->options[ $key ] ) ?>
20
- </div>
21
- <?php
22
- }
23
- ?></div><?php
24
- }
25
-
26
- ?>
27
- <input
28
- type="hidden"
29
- name="<?php echo esc_attr( $this->element_name ) ?>"
30
- id="<?php echo esc_attr( $this->element_id ) ?>"
31
- class="siteorigin-widget-input"
32
- value="<?php echo esc_attr( implode( ',', $value ) ) ?>">
33
- <?php
34
-
35
- }
36
-
37
- protected function sanitize_field_input( $value, $instance ) {
38
- if( is_string( $value ) ) {
39
- $value = explode(',', $value);
40
- $value = array_map( 'trim', $value );
41
- }
42
-
43
- if ( ! is_array( $value ) ) {
44
- $value = array();
45
- }
46
-
47
- foreach( $value as $i => $k ) {
48
- if( empty( $this->options[$k] ) ) {
49
- unset( $value[ $i ] );
50
- }
51
- }
52
-
53
- return $value;
54
- }
55
-
56
- public function enqueue_scripts() {
57
- wp_enqueue_script( 'so-order-field', plugin_dir_url(__FILE__) . 'js/order-field' . SOW_BUNDLE_JS_SUFFIX . '.js', array( 'jquery', 'jquery-ui-sortable' ), SOW_BUNDLE_VERSION );
58
- wp_enqueue_style( 'so-order-field', plugin_dir_url(__FILE__) . 'css/order-field.css', array( ), SOW_BUNDLE_VERSION );
59
- }
60
-
61
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class SiteOrigin_Widget_Field_Order
5
+ */
6
+ class SiteOrigin_Widget_Field_Order extends SiteOrigin_Widget_Field_Base {
7
+
8
+ protected $options;
9
+
10
+ protected function render_field( $value, $instance ) {
11
+
12
+ $value = $this->sanitize_field_input( $value, $instance );
13
+
14
+ if( ! empty( $this->options ) && ! empty( $value ) ) {
15
+ ?><div class="siteorigin-widget-order-items"><?php
16
+ foreach( $value as $key ) {
17
+ ?>
18
+ <div class="siteorigin-widget-order-item" data-value="<?php echo esc_attr( $key ) ?>">
19
+ <?php echo esc_html( $this->options[ $key ] ) ?>
20
+ </div>
21
+ <?php
22
+ }
23
+ ?></div><?php
24
+ }
25
+
26
+ ?>
27
+ <input
28
+ type="hidden"
29
+ name="<?php echo esc_attr( $this->element_name ) ?>"
30
+ id="<?php echo esc_attr( $this->element_id ) ?>"
31
+ class="siteorigin-widget-input"
32
+ value="<?php echo esc_attr( implode( ',', $value ) ) ?>">
33
+ <?php
34
+
35
+ }
36
+
37
+ protected function sanitize_field_input( $value, $instance ) {
38
+ if( is_string( $value ) ) {
39
+ $value = explode(',', $value);
40
+ $value = array_map( 'trim', $value );
41
+ }
42
+
43
+ if ( ! is_array( $value ) ) {
44
+ $value = array();
45
+ }
46
+
47
+ foreach( $value as $i => $k ) {
48
+ if( empty( $this->options[$k] ) ) {
49
+ unset( $value[ $i ] );
50
+ }
51
+ }
52
+
53
+ return $value;
54
+ }
55
+
56
+ public function enqueue_scripts() {
57
+ wp_enqueue_script( 'so-order-field', plugin_dir_url(__FILE__) . 'js/order-field' . SOW_BUNDLE_JS_SUFFIX . '.js', array( 'jquery', 'jquery-ui-sortable' ), SOW_BUNDLE_VERSION );
58
+ wp_enqueue_style( 'so-order-field', plugin_dir_url(__FILE__) . 'css/order-field.css', array( ), SOW_BUNDLE_VERSION );
59
+ }
60
+
61
+ }
base/inc/fields/posts.class.php CHANGED
@@ -1,203 +1,203 @@
1
- <?php
2
-
3
- /**
4
- * Class SiteOrigin_Widget_Field_Posts
5
- */
6
- class SiteOrigin_Widget_Field_Posts extends SiteOrigin_Widget_Field_Container_Base {
7
-
8
- /**
9
- * An array of post types to use in the query for posts when the 'Select Content' button is clicked.
10
- *
11
- * @access protected
12
- * @var array
13
- */
14
- protected $post_types;
15
-
16
- public function __construct( $base_name, $element_id, $element_name, $field_options, SiteOrigin_Widget $for_widget, $parent_container = array() ) {
17
- parent::__construct( $base_name, $element_id, $element_name, $field_options, $for_widget, $parent_container );
18
-
19
- $types = get_post_types( array( 'public' => true ), 'objects' );
20
- $type_options = array();
21
-
22
- if ( empty( $this->post_types ) || in_array( '_all', $this->post_types ) ) {
23
- $type_options['_all'] = __( 'All', 'so-widgets-bundle' );
24
- }
25
-
26
- foreach ( $types as $id => $type ) {
27
- if ( empty( $this->post_types ) || in_array( $id, $this->post_types ) ) {
28
- $type_options[ $id ] = $type->labels->name;
29
- }
30
- }
31
-
32
- $this->fields = array(
33
-
34
- 'post_type' => array(
35
- 'type' => 'select',
36
- 'label' => __( 'Post type', 'so-widgets-bundle' ),
37
- 'multiple' => true,
38
- 'options' => $type_options,
39
- 'default' => 'post'
40
- ),
41
-
42
- 'post__in' => array(
43
- 'type' => 'autocomplete',
44
- 'label' => __( 'Post in', 'so-widgets-bundle' ),
45
- 'source' => 'posts',
46
- ),
47
-
48
- 'tax_query' => array(
49
- 'type' => 'autocomplete',
50
- 'label' => __( 'Taxonomies', 'so-widgets-bundle' ),
51
- 'source' => 'terms',
52
- 'description' => __( 'Taxonomies are groups such as categories, tags, posts and products.', 'so-widgets-bundle' ),
53
- ),
54
-
55
- 'date_type' => array(
56
- 'type' => 'radio',
57
- 'label' => __( 'Date selection type', 'so-widgets-bundle' ),
58
- 'options' => array(
59
- 'specific' => __( 'Specific', 'so-widgets-bundle' ),
60
- 'relative' => __( 'Relative', 'so-widgets-bundle' ),
61
- ),
62
- 'description' => __( 'Select a range between specific dates or relative to the current date.', 'so-widgets-bundle' ),
63
- 'default' => 'specific',
64
- 'state_emitter' => array(
65
- 'callback' => 'select',
66
- 'args' => array( 'date_type' )
67
- ),
68
- ),
69
-
70
- 'date_query' => array(
71
- 'type' => 'date-range',
72
- 'label' => __( 'Dates', 'so-widgets-bundle' ),
73
- 'date_type' => 'specific',
74
- 'state_handler' => array(
75
- 'date_type[specific]' => array('show'),
76
- '_else[date_type]' => array('hide'),
77
- ),
78
- ),
79
-
80
- 'date_query_relative' => array(
81
- 'type' => 'date-range',
82
- 'label' => __( 'Dates', 'so-widgets-bundle' ),
83
- 'date_type' => 'relative',
84
- 'state_handler' => array(
85
- 'date_type[relative]' => array('show'),
86
- '_else[date_type]' => array('hide'),
87
- ),
88
- ),
89
-
90
- 'orderby' => array(
91
- 'type' => 'select',
92
- 'label' => __( 'Order by', 'so-widgets-bundle' ),
93
- 'options' => array(
94
- 'none' => __( 'No order', 'so-widgets-bundle' ),
95
- 'ID' => __( 'Post ID', 'so-widgets-bundle' ),
96
- 'author' => __( 'Author', 'so-widgets-bundle' ),
97
- 'title' => __( 'Title', 'so-widgets-bundle' ),
98
- 'date' => __( 'Published date', 'so-widgets-bundle' ),
99
- 'modified' => __( 'Modified date', 'so-widgets-bundle' ),
100
- 'parent' => __( 'By parent', 'so-widgets-bundle' ),
101
- 'rand' => __( 'Random order', 'so-widgets-bundle' ),
102
- 'comment_count' => __( 'Comment count', 'so-widgets-bundle' ),
103
- 'menu_order' => __( 'Menu order', 'so-widgets-bundle' ),
104
- 'meta_value' => __( 'By meta value', 'so-widgets-bundle' ),
105
- 'meta_value_num' => __( 'By numeric meta value', 'so-widgets-bundle' ),
106
- 'post__in' => __( 'By include order', 'so-widgets-bundle' ),
107
- ),
108
- 'default' => 'date',
109
- ),
110
-
111
- 'order' => array(
112
- 'type' => 'radio',
113
- 'label' => __( 'Order direction', 'so-widgets-bundle' ),
114
- 'options' => array(
115
- 'ASC' => __( 'Ascending', 'so-widgets-bundle' ),
116
- 'DESC' => __( 'Descending', 'so-widgets-bundle' ),
117
- ),
118
- 'default' => 'DESC',
119
- ),
120
-
121
- 'posts_per_page' => array(
122
- 'type' => 'number',
123
- 'label' => __( 'Posts per page', 'so-widgets-bundle' ),
124
- ),
125
-
126
- 'sticky' => array(
127
- 'type' => 'select',
128
- 'label' => __( 'Sticky posts', 'so-widgets-bundle' ),
129
- 'options' => array(
130
- '' => __( 'Default', 'so-widgets-bundle' ),
131
- 'ignore' => __( 'Ignore sticky', 'so-widgets-bundle' ),
132
- 'exclude' => __( 'Exclude sticky', 'so-widgets-bundle' ),
133
- 'only' => __( 'Only sticky', 'so-widgets-bundle' ),
134
- ),
135
- ),
136
-
137
- 'additional' => array(
138
- 'type' => 'text',
139
- 'label' => __( 'Additional', 'so-widgets-bundle' ),
140
- 'description' => __( 'Additional query arguments. See <a href="http://codex.wordpress.org/Function_Reference/query_posts" target="_blank" rel="noopener noreferrer">query_posts</a>.', 'so-widgets-bundle' ),
141
- ),
142
- );
143
- }
144
-
145
- protected function render_field_label( $value, $instance ) {
146
- ?><div class="posts-container-label-wrapper<?php if ( $this->state == 'open' ) {
147
- echo ' siteorigin-widget-section-visible';
148
- } ?>"><?php
149
- parent::render_field_label( $value, $instance );
150
- ?><span class="sow-current-count"><?php echo esc_html( siteorigin_widget_post_selector_count_posts( $value ) )?></span>
151
- </div><?php
152
- }
153
-
154
- protected function render_field( $value, $instance ) {
155
- $value = wp_parse_args( $value );
156
-
157
- if( !empty( $value['post_type'] ) ) {
158
- $value['post_type'] = strpos( $value['post_type'], ',' ) !== false ? explode( ',', $value['post_type'] ) : $value['post_type'];
159
- }
160
-
161
- if ( $this->collapsible ) {
162
- ?><div class="siteorigin-widget-section <?php if ( $this->state == 'closed' ) {
163
- echo 'siteorigin-widget-section-hide';
164
- } ?>"><?php
165
- }
166
-
167
- $this->create_and_render_sub_fields( $value, array( 'name' => $this->base_name, 'type' => 'composite' ) );
168
-
169
- if ( $this->collapsible ) {
170
- ?></div><?php
171
- }
172
- }
173
-
174
- public function enqueue_scripts() {
175
- wp_enqueue_script(
176
- 'so-posts-selector-field',
177
- plugin_dir_url( __FILE__ ) . 'js/posts-field' . SOW_BUNDLE_JS_SUFFIX . '.js',
178
- array( 'jquery' ),
179
- SOW_BUNDLE_VERSION,
180
- true
181
- );
182
- }
183
-
184
- protected function sanitize_field_input( $value, $instance ) {
185
- // Special handling for the 'additional' args field.
186
- if ( ! empty( $value['additional'] ) ) {
187
- $value['additional'] = urlencode( $value['additional'] );
188
- }
189
- $value = parent::sanitize_field_input( $value, $instance );
190
- $result = '';
191
- foreach ( $value as $key => $item ) {
192
- if ( ! empty( $item ) ) {
193
- if ( is_array( $item ) ) {
194
- $item = implode( ',', $item );
195
- }
196
- $result .= ( empty( $result ) ? '' : '&' ) . $key . '=' . $item;
197
- }
198
- }
199
-
200
- return $result;
201
- }
202
-
203
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class SiteOrigin_Widget_Field_Posts
5
+ */
6
+ class SiteOrigin_Widget_Field_Posts extends SiteOrigin_Widget_Field_Container_Base {
7
+
8
+ /**
9
+ * An array of post types to use in the query for posts when the 'Select Content' button is clicked.
10
+ *
11
+ * @access protected
12
+ * @var array
13
+ */
14
+ protected $post_types;
15
+
16
+ public function __construct( $base_name, $element_id, $element_name, $field_options, SiteOrigin_Widget $for_widget, $parent_container = array() ) {
17
+ parent::__construct( $base_name, $element_id, $element_name, $field_options, $for_widget, $parent_container );
18
+
19
+ $types = get_post_types( array( 'public' => true ), 'objects' );
20
+ $type_options = array();
21
+
22
+ if ( empty( $this->post_types ) || in_array( '_all', $this->post_types ) ) {
23
+ $type_options['_all'] = __( 'All', 'so-widgets-bundle' );
24
+ }
25
+
26
+ foreach ( $types as $id => $type ) {
27
+ if ( empty( $this->post_types ) || in_array( $id, $this->post_types ) ) {
28
+ $type_options[ $id ] = $type->labels->name;
29
+ }
30
+ }
31
+
32
+ $this->fields = array(
33
+
34
+ 'post_type' => array(
35
+ 'type' => 'select',
36
+ 'label' => __( 'Post type', 'so-widgets-bundle' ),
37
+ 'multiple' => true,
38
+ 'options' => $type_options,
39
+ 'default' => 'post'
40
+ ),
41
+
42
+ 'post__in' => array(
43
+ 'type' => 'autocomplete',
44
+ 'label' => __( 'Post in', 'so-widgets-bundle' ),
45
+ 'source' => 'posts',
46
+ ),
47
+
48
+ 'tax_query' => array(
49
+ 'type' => 'autocomplete',
50
+ 'label' => __( 'Taxonomies', 'so-widgets-bundle' ),
51
+ 'source' => 'terms',
52
+ 'description' => __( 'Taxonomies are groups such as categories, tags, posts and products.', 'so-widgets-bundle' ),
53
+ ),
54
+
55
+ 'date_type' => array(
56
+ 'type' => 'radio',
57
+ 'label' => __( 'Date selection type', 'so-widgets-bundle' ),
58
+ 'options' => array(
59
+ 'specific' => __( 'Specific', 'so-widgets-bundle' ),
60
+ 'relative' => __( 'Relative', 'so-widgets-bundle' ),
61
+ ),
62
+ 'description' => __( 'Select a range between specific dates or relative to the current date.', 'so-widgets-bundle' ),
63
+ 'default' => 'specific',
64
+ 'state_emitter' => array(
65
+ 'callback' => 'select',
66
+ 'args' => array( 'date_type' )
67
+ ),
68
+ ),
69
+
70
+ 'date_query' => array(
71
+ 'type' => 'date-range',
72
+ 'label' => __( 'Dates', 'so-widgets-bundle' ),
73
+ 'date_type' => 'specific',
74
+ 'state_handler' => array(
75
+ 'date_type[specific]' => array('show'),
76
+ '_else[date_type]' => array('hide'),
77
+ ),
78
+ ),
79
+
80
+ 'date_query_relative' => array(
81
+ 'type' => 'date-range',
82
+ 'label' => __( 'Dates', 'so-widgets-bundle' ),
83
+ 'date_type' => 'relative',
84
+ 'state_handler' => array(
85
+ 'date_type[relative]' => array('show'),
86
+ '_else[date_type]' => array('hide'),
87
+ ),
88
+ ),
89
+
90
+ 'orderby' => array(
91
+ 'type' => 'select',
92
+ 'label' => __( 'Order by', 'so-widgets-bundle' ),
93
+ 'options' => array(
94
+ 'none' => __( 'No order', 'so-widgets-bundle' ),
95
+ 'ID' => __( 'Post ID', 'so-widgets-bundle' ),
96
+ 'author' => __( 'Author', 'so-widgets-bundle' ),
97
+ 'title' => __( 'Title', 'so-widgets-bundle' ),
98
+ 'date' => __( 'Published date', 'so-widgets-bundle' ),
99
+ 'modified' => __( 'Modified date', 'so-widgets-bundle' ),
100
+ 'parent' => __( 'By parent', 'so-widgets-bundle' ),
101
+ 'rand' => __( 'Random order', 'so-widgets-bundle' ),
102
+ 'comment_count' => __( 'Comment count', 'so-widgets-bundle' ),
103
+ 'menu_order' => __( 'Menu order', 'so-widgets-bundle' ),
104
+ 'meta_value' => __( 'By meta value', 'so-widgets-bundle' ),
105
+ 'meta_value_num' => __( 'By numeric meta value', 'so-widgets-bundle' ),
106
+ 'post__in' => __( 'By include order', 'so-widgets-bundle' ),
107
+ ),
108
+ 'default' => 'date',
109
+ ),
110
+
111
+ 'order' => array(
112
+ 'type' => 'radio',
113
+ 'label' => __( 'Order direction', 'so-widgets-bundle' ),
114
+ 'options' => array(
115
+ 'ASC' => __( 'Ascending', 'so-widgets-bundle' ),
116
+ 'DESC' => __( 'Descending', 'so-widgets-bundle' ),
117
+ ),
118
+ 'default' => 'DESC',
119
+ ),
120
+
121
+ 'posts_per_page' => array(
122
+ 'type' => 'number',
123
+ 'label' => __( 'Posts per page', 'so-widgets-bundle' ),
124
+ ),
125
+
126
+ 'sticky' => array(
127
+ 'type' => 'select',
128
+ 'label' => __( 'Sticky posts', 'so-widgets-bundle' ),
129
+ 'options' => array(
130
+ '' => __( 'Default', 'so-widgets-bundle' ),
131
+ 'ignore' => __( 'Ignore sticky', 'so-widgets-bundle' ),
132
+ 'exclude' => __( 'Exclude sticky', 'so-widgets-bundle' ),
133
+ 'only' => __( 'Only sticky', 'so-widgets-bundle' ),
134
+ ),
135
+ ),
136
+
137
+ 'additional' => array(
138
+ 'type' => 'text',
139
+ 'label' => __( 'Additional', 'so-widgets-bundle' ),
140
+ 'description' => __( 'Additional query arguments. See <a href="http://codex.wordpress.org/Function_Reference/query_posts" target="_blank" rel="noopener noreferrer">query_posts</a>.', 'so-widgets-bundle' ),
141
+ ),
142
+ );
143
+ }
144
+
145
+ protected function render_field_label( $value, $instance ) {
146
+ ?><div class="posts-container-label-wrapper<?php if ( $this->state == 'open' ) {
147
+ echo ' siteorigin-widget-section-visible';
148
+ } ?>"><?php
149
+ parent::render_field_label( $value, $instance );
150
+ ?><span class="sow-current-count"><?php echo esc_html( siteorigin_widget_post_selector_count_posts( $value ) )?></span>
151
+ </div><?php
152
+ }
153
+
154
+ protected function render_field( $value, $instance ) {
155
+ $value = wp_parse_args( $value );
156
+
157
+ if( !empty( $value['post_type'] ) ) {
158
+ $value['post_type'] = strpos( $value['post_type'], ',' ) !== false ? explode( ',', $value['post_type'] ) : $value['post_type'];
159
+ }
160
+
161
+ if ( $this->collapsible ) {
162
+ ?><div class="siteorigin-widget-section <?php if ( $this->state == 'closed' ) {
163
+ echo 'siteorigin-widget-section-hide';
164
+ } ?>"><?php
165
+ }
166
+
167
+ $this->create_and_render_sub_fields( $value, array( 'name' => $this->base_name, 'type' => 'composite' ) );
168
+
169
+ if ( $this->collapsible ) {
170
+ ?></div><?php
171
+ }
172
+ }
173
+
174
+ public function enqueue_scripts() {
175
+ wp_enqueue_script(
176
+ 'so-posts-selector-field',
177
+ plugin_dir_url( __FILE__ ) . 'js/posts-field' . SOW_BUNDLE_JS_SUFFIX . '.js',
178
+ array( 'jquery' ),
179
+ SOW_BUNDLE_VERSION,
180
+ true
181
+ );
182
+ }
183
+
184
+ protected function sanitize_field_input( $value, $instance ) {
185
+ // Special handling for the 'additional' args field.
186
+ if ( ! empty( $value['additional'] ) ) {
187
+ $value['additional'] = urlencode( $value['additional'] );
188
+ }
189
+ $value = parent::sanitize_field_input( $value, $instance );
190
+ $result = '';
191
+ foreach ( $value as $key => $item ) {
192
+ if ( ! empty( $item ) ) {
193
+ if ( is_array( $item ) ) {
194
+ $item = implode( ',', $item );
195
+ }
196
+ $result .= ( empty( $result ) ? '' : '&' ) . $key . '=' . $item;
197
+ }
198
+ }
199
+
200
+ return $result;
201
+ }
202
+
203
+ }
base/inc/fields/repeater.class.php CHANGED
@@ -1,128 +1,128 @@
1
- <?php
2
-
3
- /**
4
- * Class SiteOrigin_Widget_Field_Repeater
5
- */
6
- class SiteOrigin_Widget_Field_Repeater extends SiteOrigin_Widget_Field_Container_Base {
7
-
8
- /**
9
- * A default label for each repeated item.
10
- *
11
- * @access protected
12
- * @var string
13
- */
14
- protected $item_name;
15
- /**
16
- * This associative array describes how the repeater may retrieve the item labels from HTML elements as they are
17
- * updated. The options are:
18
- * - selector string A JQuery selector which is used to find an element from which to retrieve the item label.
19
- * - update_event string The JavaScript event on which to bind and update the item label.
20
- * - value_method string The JavaScript function which should be used to retrieve the item label from an element.
21
- *
22
- * @access protected
23
- * @var array
24
- */
25
- protected $item_label;
26
- /**
27
- * The maximum number of repeated items to display before adding a scrollbar to the repeater.
28
- *
29
- * @access protected
30
- * @var int
31
- */
32
- protected $scroll_count;
33
- /**
34
- * Whether or not items may be added to or removed from this repeater by user interaction.
35
- *
36
- * @access protected
37
- * @var bool
38
- */
39
- protected $readonly;
40
-
41
- protected function render_field( $value, $instance ) {
42
- if( !isset( $this->fields ) || empty( $this->fields ) ) return;
43
- $container = array( 'name' => $this->base_name, 'type' => 'repeater' );
44
- $item_label = isset( $this->item_label ) ? $this->item_label : null;
45
- if ( ! empty( $item_label ) ) {
46
- // convert underscore naming convention to camelCase for javascript and encode as json string
47
- $item_label = wp_parse_args( $item_label, array(
48
- 'update_event' => 'change',
49
- 'value_method' => 'val'
50
- ) );
51
- $item_label = siteorigin_widgets_underscores_to_camel_case( $item_label );
52
- $item_label = json_encode( $item_label );
53
- }
54
- if( empty( $this->item_name ) ) $this->item_name = __( 'Item', 'so-widgets-bundle' );
55
- ?>
56
- <div class="siteorigin-widget-field-repeater"
57
- data-item-name="<?php echo esc_attr( $this->item_name ) ?>"
58
- data-repeater-name="<?php echo esc_attr( $this->base_name ) ?>"
59
- data-element-name="<?php echo esc_attr( $this->element_name ) ?>"
60
- <?php echo ! empty( $item_label ) ? 'data-item-label="' . esc_attr( $item_label ) . '"' : '' ?>
61
- <?php echo ! empty( $this->scroll_count ) ? 'data-scroll-count="' . esc_attr( $this->scroll_count ) . '"' : '' ?>
62
- <?php if( ! empty( $this->readonly ) ) echo 'readonly' ?>>
63
- <div class="siteorigin-widget-field-repeater-top">
64
- <div class="siteorigin-widget-field-repeater-expand"></div>
65
- <h3><?php echo esc_html( $this->label ) ?></h3>
66
- </div>
67
- <div class="siteorigin-widget-field-repeater-items">
68
- <?php
69
- if( !empty( $value ) ) {
70
- foreach( $value as $v ) {
71
- ?>
72
- <div class="siteorigin-widget-field-repeater-item ui-draggable">
73
- <div class="siteorigin-widget-field-repeater-item-top">
74
- <div class="siteorigin-widget-field-expand"></div>
75
- <?php if( empty( $this->readonly ) ) : ?>
76
- <div class="siteorigin-widget-field-copy"></div>
77
- <div class="siteorigin-widget-field-remove"></div>
78
- <?php endif; ?>
79
- <h4><?php echo esc_html( $this->item_name ) ?></h4>
80
- </div>
81
- <div class="siteorigin-widget-field-repeater-item-form">
82
- <?php
83
- $this->create_and_render_sub_fields( $v, $container );
84
- ?>
85
- </div>
86
- </div>
87
- <?php
88
- }
89
- }
90
- ?>
91
- </div>
92
- <?php if( empty( $this->readonly ) ) : ?>
93
- <div class="siteorigin-widget-field-repeater-add"><?php esc_html_e( 'Add', 'so-widgets-bundle' ) ?></div>
94
- <?php endif; ?>
95
- <?php
96
- ob_start();
97
- $this->create_and_render_sub_fields( null, $container, true );
98
- $rpt_fields = ob_get_clean();
99
- $rpt_fields = preg_replace( '/\s+name\s*=\s*/', ' data-name=', $rpt_fields );
100
- ?>
101
- <div class="siteorigin-widget-field-repeater-item-html" style="display: none;">
102
- <?php echo $rpt_fields; ?>
103
- </div>
104
- </div>
105
- <?php
106
- }
107
-
108
- protected function render_field_label( $value, $instance ) {
109
- // Empty override. This field renders it's own label in the render_field() function.
110
- }
111
-
112
- /**
113
- * Go over the items in the repeater and sanitize each one using the container sanitization function.
114
- *
115
- * @param mixed $value
116
- *
117
- * @return array|mixed
118
- */
119
- function sanitize_field_input( $value, $instance ){
120
- if( empty($value) ) return array();
121
-
122
- foreach( $value as &$el ) {
123
- $el = parent::sanitize_field_input( $el, $instance );
124
- }
125
-
126
- return $value;
127
- }
128
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class SiteOrigin_Widget_Field_Repeater
5
+ */
6
+ class SiteOrigin_Widget_Field_Repeater extends SiteOrigin_Widget_Field_Container_Base {
7
+
8
+ /**
9
+ * A default label for each repeated item.
10
+ *
11
+ * @access protected
12
+ * @var string
13
+ */
14
+ protected $item_name;
15
+ /**
16
+ * This associative array describes how the repeater may retrieve the item labels from HTML elements as they are
17
+ * updated. The options are:
18
+ * - selector string A JQuery selector which is used to find an element from which to retrieve the item label.
19
+ * - update_event string The JavaScript event on which to bind and update the item label.
20
+ * - value_method string The JavaScript function which should be used to retrieve the item label from an element.
21
+ *
22
+ * @access protected
23
+ * @var array
24
+ */
25
+ protected $item_label;
26
+ /**
27
+ * The maximum number of repeated items to display before adding a scrollbar to the repeater.
28
+ *
29
+ * @access protected
30
+ * @var int
31
+ */
32
+ protected $scroll_count;
33
+ /**
34
+ * Whether or not items may be added to or removed from this repeater by user interaction.
35
+ *
36
+ * @access protected
37
+ * @var bool
38
+ */
39
+ protected $readonly;
40
+
41
+ protected function render_field( $value, $instance ) {
42
+ if( !isset( $this->fields ) || empty( $this->fields ) ) return;
43
+ $container = array( 'name' => $this->base_name, 'type' => 'repeater' );
44
+ $item_label = isset( $this->item_label ) ? $this->item_label : null;
45
+ if ( ! empty( $item_label ) ) {
46
+ // convert underscore naming convention to camelCase for javascript and encode as json string
47
+ $item_label = wp_parse_args( $item_label, array(
48
+ 'update_event' => 'change',
49
+ 'value_method' => 'val'
50
+ ) );
51
+ $item_label = siteorigin_widgets_underscores_to_camel_case( $item_label );
52
+ $item_label = json_encode( $item_label );
53
+ }
54
+ if( empty( $this->item_name ) ) $this->item_name = __( 'Item', 'so-widgets-bundle' );
55
+ ?>
56
+ <div class="siteorigin-widget-field-repeater"
57
+ data-item-name="<?php echo esc_attr( $this->item_name ) ?>"
58
+ data-repeater-name="<?php echo esc_attr( $this->base_name ) ?>"
59
+ data-element-name="<?php echo esc_attr( $this->element_name ) ?>"
60
+ <?php echo ! empty( $item_label ) ? 'data-item-label="' . esc_attr( $item_label ) . '"' : '' ?>
61
+ <?php echo ! empty( $this->scroll_count ) ? 'data-scroll-count="' . esc_attr( $this->scroll_count ) . '"' : '' ?>
62
+ <?php if( ! empty( $this->readonly ) ) echo 'readonly' ?>>
63
+ <div class="siteorigin-widget-field-repeater-top">
64
+ <div class="siteorigin-widget-field-repeater-expand"></div>
65
+ <h3><?php echo esc_html( $this->label ) ?></h3>
66
+ </div>
67
+ <div class="siteorigin-widget-field-repeater-items">
68
+ <?php
69
+ if( !empty( $value ) ) {
70
+ foreach( $value as $v ) {
71
+ ?>
72
+ <div class="siteorigin-widget-field-repeater-item ui-draggable">
73
+ <div class="siteorigin-widget-field-repeater-item-top">
74
+ <div class="siteorigin-widget-field-expand"></div>
75
+ <?php if( empty( $this->readonly ) ) : ?>
76
+ <div class="siteorigin-widget-field-copy"></div>
77
+ <div class="siteorigin-widget-field-remove"></div>
78
+ <?php endif; ?>
79
+ <h4><?php echo esc_html( $this->item_name ) ?></h4>
80
+ </div>
81
+ <div class="siteorigin-widget-field-repeater-item-form">
82
+ <?php
83
+ $this->create_and_render_sub_fields( $v, $container );
84
+ ?>
85
+ </div>
86
+ </div>
87
+ <?php
88
+ }
89
+ }
90
+ ?>
91
+ </div>
92
+ <?php if( empty( $this->readonly ) ) : ?>
93
+ <div class="siteorigin-widget-field-repeater-add"><?php esc_html_e( 'Add', 'so-widgets-bundle' ) ?></div>
94
+ <?php endif; ?>
95
+ <?php
96
+ ob_start();
97
+ $this->create_and_render_sub_fields( null, $container, true );
98
+ $rpt_fields = ob_get_clean();
99
+ $rpt_fields = preg_replace( '/\s+name\s*=\s*/', ' data-name=', $rpt_fields );
100
+ ?>
101
+ <div class="siteorigin-widget-field-repeater-item-html" style="display: none;">
102
+ <?php echo $rpt_fields; ?>
103
+ </div>
104
+ </div>
105
+ <?php
106
+ }
107
+
108
+ protected function render_field_label( $value, $instance ) {
109
+ // Empty override. This field renders it's own label in the render_field() function.
110
+ }
111
+
112
+ /**
113
+ * Go over the items in the repeater and sanitize each one using the container sanitization function.
114
+ *
115
+ * @param mixed $value
116
+ *
117
+ * @return array|mixed
118
+ */
119
+ function sanitize_field_input( $value, $instance ){
120
+ if( empty($value) ) return array();
121
+
122
+ foreach( $value as &$el ) {
123
+ $el = parent::sanitize_field_input( $el, $instance );
124
+ }
125
+
126
+ return $value;
127
+ }
128
+ }
base/inc/fields/section.class.php CHANGED
@@ -1,23 +1,23 @@
1
- <?php
2
-
3
- /**
4
- * Class SiteOrigin_Widget_Field_Section
5
- */
6
- class SiteOrigin_Widget_Field_Section extends SiteOrigin_Widget_Field_Container_Base {
7
-
8
- protected function render_field( $value, $instance ) {
9
- ?>
10
- <div class="siteorigin-widget-section <?php if( $this->state == 'closed' ) echo 'siteorigin-widget-section-hide'; ?>"><?php
11
- if ( !isset( $this->fields ) || empty($this->fields ) ) {
12
- echo '</div>';
13
- return;
14
- }
15
- $this->create_and_render_sub_fields( $value, array( 'name' => $this->base_name, 'type' => 'section' ) );
16
- ?>
17
- <input type="hidden"
18
- name="<?php echo esc_attr( $this->element_name . '[so_field_container_state]' ) ?>" id="<?php echo esc_attr( $this->element_id . '-so_field_container_state' ) ?>"
19
- class="siteorigin-widget-input siteorigin-widget-field-container-state" value="<?php echo esc_attr( $this->state ) ?>"/>
20
- </div><?php
21
- }
22
-
23
  }
1
+ <?php
2
+
3
+ /**
4
+ * Class SiteOrigin_Widget_Field_Section
5
+ */
6
+ class SiteOrigin_Widget_Field_Section extends SiteOrigin_Widget_Field_Container_Base {
7
+
8
+ protected function render_field( $value, $instance ) {
9
+ ?>
10
+ <div class="siteorigin-widget-section <?php if( $this->state == 'closed' ) echo 'siteorigin-widget-section-hide'; ?>"><?php
11
+ if ( !isset( $this->fields ) || empty($this->fields ) ) {
12
+ echo '</div>';
13
+ return;
14
+ }
15
+ $this->create_and_render_sub_fields( $value, array( 'name' => $this->base_name, 'type' => 'section' ) );
16
+ ?>
17
+ <input type="hidden"
18
+ name="<?php echo esc_attr( $this->element_name . '[so_field_container_state]' ) ?>" id="<?php echo esc_attr( $this->element_id . '-so_field_container_state' ) ?>"
19
+ class="siteorigin-widget-input siteorigin-widget-field-container-state" value="<?php echo esc_attr( $this->state ) ?>"/>
20
+ </div><?php
21
+ }
22
+
23
  }
base/inc/fields/slider.class.php CHANGED
@@ -1,50 +1,50 @@
1
- <?php
2
-
3
- /**
4
- * Class SiteOrigin_Widget_Field_Slider
5
- */
6
- class SiteOrigin_Widget_Field_Slider extends SiteOrigin_Widget_Field_Base {
7
-
8
- /**
9
- * The minimum value of the allowed range.
10
- *
11
- * @access protected
12
- * @var float
13
- */
14
- protected $min;
15
-
16
- /**
17
- * The maximum value of the allowed range.
18
- *
19
- * @access protected
20
- * @var float
21
- */
22
- protected $max;
23
-
24
- /**
25
- * The step size when moving in the range.
26
- *
27
- * @access protected
28
- * @var float
29
- */
30
- protected $step;
31
-
32
- protected function render_field( $value, $instance ) {
33
- ?>
34
- <div class="siteorigin-widget-slider-value"><?php echo ! empty( $value ) ? esc_html( $value ) : 0 ?></div>
35
- <div class="siteorigin-widget-slider-wrapper">
36
- <div class="siteorigin-widget-value-slider"></div>
37
- </div>
38
- <input type="number" class="siteorigin-widget-input" name="<?php echo esc_attr( $this->element_name ) ?>" id="<?php echo esc_attr( $this->element_id ) ?>"
39
- value="<?php echo !empty( $value ) ? esc_attr( $value ) : 0 ?>"
40
- min="<?php echo isset( $this->min ) ? floatval( $this->min ) : 0 ?>"
41
- max="<?php echo isset( $this->max ) ? floatval( $this->max ) : 100 ?>"
42
- step="<?php echo isset( $this->step ) ? floatval( $this->step ) : 1 ?>"/>
43
- <?php
44
- }
45
-
46
- protected function sanitize_field_input( $value, $instance ) {
47
- return (float) $value;
48
- }
49
-
50
  }
1
+ <?php
2
+
3
+ /**
4
+ * Class SiteOrigin_Widget_Field_Slider
5
+ */
6
+ class SiteOrigin_Widget_Field_Slider extends SiteOrigin_Widget_Field_Base {
7
+
8
+ /**
9
+ * The minimum value of the allowed range.
10
+ *
11
+ * @access protected
12
+ * @var float
13
+ */
14
+ protected $min;
15
+
16
+ /**
17
+ * The maximum value of the allowed range.
18
+ *
19
+ * @access protected
20
+ * @var float
21
+ */
22
+ protected $max;
23
+
24
+ /**
25
+ * The step size when moving in the range.
26
+ *
27
+ * @access protected
28
+ * @var float
29
+ */
30
+ protected $step;
31
+
32
+ protected function render_field( $value, $instance ) {
33
+ ?>
34
+ <div class="siteorigin-widget-slider-value"><?php echo ! empty( $value ) ? esc_html( $value ) : 0 ?></div>
35
+ <div class="siteorigin-widget-slider-wrapper">
36
+ <div class="siteorigin-widget-value-slider"></div>
37
+ </div>
38
+ <input type="number" class="siteorigin-widget-input" name="<?php echo esc_attr( $this->element_name ) ?>" id="<?php echo esc_attr( $this->element_id ) ?>"
39
+ value="<?php echo !empty( $value ) ? esc_attr( $value ) : 0 ?>"
40
+ min="<?php echo isset( $this->min ) ? floatval( $this->min ) : 0 ?>"
41
+ max="<?php echo isset( $this->max ) ? floatval( $this->max ) : 100 ?>"
42
+ step="<?php echo isset( $this->step ) ? floatval( $this->step ) : 1 ?>"/>
43
+ <?php
44
+ }
45
+
46
+ protected function sanitize_field_input( $value, $instance ) {
47
+ return (float) $value;
48
+ }
49
+
50
  }
base/inc/fields/tinymce.class.php CHANGED
@@ -1,561 +1,561 @@
1
- <?php
2
-
3
- class SiteOrigin_Widget_Field_TinyMCE extends SiteOrigin_Widget_Field_Text_Input_Base {
4
- /**
5
- * The number of visible rows in the textarea.
6
- *
7
- * @access protected
8
- * @var int
9
- */
10
- protected $rows = 10;
11
- /**
12
- * The editor initial height. Overrides rows if it is set.
13
- *
14
- * @access protected
15
- * @var int
16
- */
17
- protected $editor_height;
18
- /**
19
- * The editor to be displayed initially.
20
- *
21
- * @access protected
22
- * @var string
23
- */
24
- protected $default_editor = 'tinymce';
25
- /**
26
- * The last editor selected by the user.
27
- *
28
- * @access protected
29
- * @var string
30
- */
31
- protected $selected_editor;
32
- /**
33
- * An array of the buttons which will be rendered for the first toolbar of the TinyMCE editor.
34
- *
35
- * @access protected
36
- * @var array
37
- */
38
- protected $mce_buttons;
39
- /**
40
- * An array of the buttons which will be rendered for the second toolbar of the TinyMCE editor.
41
- *
42
- * @access protected
43
- * @var array
44
- */
45
- protected $mce_buttons_2;
46
- /**
47
- * An array of the buttons which will be rendered for the third toolbar of the TinyMCE editor.
48
- *
49
- * @access protected
50
- * @var array
51
- */
52
- protected $mce_buttons_3;
53
- /**
54
- * An array of the buttons which will be rendered for the fourth toolbar of the TinyMCE editor.
55
- *
56
- * @access protected
57
- * @var array
58
- */
59
- protected $mce_buttons_4;
60
- /**
61
- * An array of the buttons which will be rendered for the QuickTags editor.
62
- *
63
- * @access protected
64
- * @var array
65
- */
66
- protected $quicktags_buttons;
67
- /**
68
- * Whether to apply `wpautop` processing. (Adds paragraphs for double linebreaks) Default is true.
69
- *
70
- * @access protected
71
- * @var array
72
- */
73
- protected $wpautop;
74
- /**
75
- * An array of filter callbacks to apply to the set of buttons which will be rendered for the editor.
76
- *
77
- * @access protected
78
- * @var array
79
- */
80
- protected $button_filters;
81
- /**
82
- * An array of the included plugins to enable for the TinyMCE editor.
83
- *
84
- * @access protected
85
- * @var array
86
- */
87
- protected $mce_plugins;
88
- /**
89
- * An array of external plugins for the TinyMCE editor.
90
- *
91
- * @access protected
92
- * @var array
93
- */
94
- protected $mce_external_plugins;
95
- /**
96
- * Updated Editor JS API was introduced in WP 4.8 so need to check for compatibility with older versions.
97
- *
98
- * @access private
99
- * @var bool
100
- */
101
- private $wp_version_lt_4_8;
102
-
103
- protected function get_default_options() {
104
- return array(
105
- 'wpautop' => true,
106
- 'mce_buttons' => array(
107
- 'formatselect',
108
- 'bold',
109
- 'italic',
110
- 'bullist',
111
- 'numlist',
112
- 'blockquote',
113
- 'alignleft',
114
- 'aligncenter',
115
- 'alignright',
116
- 'link',
117
- 'unlink',
118
- 'wp_more',
119
- 'wp_adv',
120
- ),
121
- 'mce_buttons_2' => array(
122
- 'strikethrough',
123
- 'hr',
124
- 'forecolor',
125
- 'pastetext',
126
- 'removeformat',
127
- 'charmap',
128
- 'outdent',
129
- 'indent',
130
- 'undo',
131
- 'redo',
132
- 'wp_help',
133
- ),
134
- 'quicktags_buttons' => array(
135
- 'strong',
136
- 'em',
137
- 'link',
138
- 'block',
139
- 'del',
140
- 'ins',
141
- 'img',
142
- 'ul',
143
- 'ol',
144
- 'li',
145
- 'code',
146
- 'more',
147
- 'close',
148
- ),
149
- 'mce_plugins' => array(
150
- 'charmap',
151
- 'colorpicker',
152
- 'hr',
153
- 'lists',
154
- 'media',
155
- 'paste',
156
- 'tabfocus',
157
- 'textcolor',
158
- 'fullscreen',
159
- 'wordpress',
160
- 'wpautoresize',
161
- 'wpeditimage',
162
- 'wpemoji',
163
- 'wpgallery',
164
- 'wplink',
165
- 'wpdialogs',
166
- 'wptextpattern',
167
- 'wpview',
168
- ),
169
- 'mce_external_plugins' => array(),
170
- );
171
- }
172
-
173
- protected function initialize() {
174
- if ( ! is_admin() ) {
175
- return;
176
- }
177
-
178
- global $wp_version;
179
- $this->wp_version_lt_4_8 = version_compare( $wp_version, '4.8', '<' );
180
-
181
- if ( ! empty( $this->wp_version_lt_4_8 ) ) {
182
- add_filter( 'mce_buttons', array( $this, 'mce_buttons_filter' ), 10, 2 );
183
- add_filter( 'quicktags_settings', array( $this, 'quicktags_settings' ), 10, 2 );
184
- }
185
-
186
- if ( ! empty( $this->button_filters ) ) {
187
- foreach ( $this->button_filters as $filter_name => $filter ) {
188
- $is_valid_filter = preg_match(
189
- '/mce_buttons(?:_[1-4])?|quicktags_settings/', $filter_name
190
- ) && ! empty( $filter ) && is_callable( $filter );
191
- if ( $is_valid_filter ) {
192
- add_filter( $filter_name, array( $this, $filter_name ), 10, 2 );
193
- }
194
- }
195
- }
196
-
197
- if( class_exists( 'WC_Shortcodes_TinyMCE_Buttons' ) ) {
198
- if ( ! empty( $this->wp_version_lt_4_8 ) ) {
199
- $screen = get_current_screen();
200
- if( ! is_null( $screen ) && $screen->id != 'widgets' ) {
201
- add_filter( 'mce_external_plugins', array( $this, 'add_wpc_shortcodes_plugin' ), 15 );
202
- add_filter( 'mce_buttons', array( $this, 'register_wpc_shortcodes_button' ), 15 );
203
- }
204
- } else {
205
- $this->mce_external_plugins = $this->add_wpc_shortcodes_plugin( $this->mce_external_plugins );
206
- $this->mce_buttons = $this->register_wpc_shortcodes_button( $this->mce_buttons );
207
- }
208
- }
209
-
210
- if( class_exists( 'WC_Shortcodes_Admin' ) ) {
211
- if ( ! empty( $this->wp_version_lt_4_8 ) ) {
212
-
213
- $screen = get_current_screen();
214
- if( ! is_null( $screen ) && $screen->id != 'widgets' ) {
215
- add_filter( 'mce_external_plugins', array( $this, 'add_wc_shortcodes_plugin' ), 15 );
216
- add_filter( 'mce_buttons', array( $this, 'register_wc_shortcodes_button' ), 15 );
217
- }
218
- } else {
219
- $this->mce_external_plugins = $this->add_wc_shortcodes_plugin( $this->mce_external_plugins );
220
- $this->mce_buttons = $this->register_wc_shortcodes_button( $this->mce_buttons );
221
- }
222
- }
223
- }
224
-
225
- function add_wc_shortcodes_plugin( $plugins ) {
226
- if( isset( $plugins['woocommerce_shortcodes'] ) ) {
227
- return $plugins;
228
- }
229
- $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
230
- $editor_path = 'woocommerce-shortcodes/assets/js/editor' . $suffix . '.js';
231
- if( file_exists( WP_PLUGIN_DIR . '/' . $editor_path ) ) {
232
- $plugins['woocommerce_shortcodes'] = plugins_url( $editor_path );
233
- }
234
- return $plugins;
235
- }
236
-
237
- function register_wc_shortcodes_button( $buttons ) {
238
- if( ! in_array( 'woocommerce_shortcodes', $buttons ) ) {
239
- array_push( $buttons, '|', 'woocommerce_shortcodes' );
240
- }
241
- return $buttons;
242
- }
243
-
244
- function add_wpc_shortcodes_plugin( $plugins ) {
245
- if( ! isset( $plugins['wpc_shortcodes'] ) ) {
246
- $shortcodes_path = 'wc-shortcodes/includes/mce/js/shortcodes-tinymce-4.js';
247
- if ( file_exists( WP_PLUGIN_DIR . '/' . $shortcodes_path ) ) {
248
- $plugins['wpc_shortcodes'] = plugins_url( $shortcodes_path . '?ver=' . WC_SHORTCODES_VERSION );
249
- }
250
- }
251
-
252
- if( ! isset( $plugins['wpc_font_awesome'] ) ) {
253
- $fontawesome_path = 'wc-shortcodes/includes/mce/js/font-awesome-tinymce-4.js';
254
- if ( file_exists( WP_PLUGIN_DIR . '/' . $fontawesome_path ) ) {
255
- $plugins['wpc_font_awesome'] = plugins_url( $fontawesome_path . '?ver=' . WC_SHORTCODES_VERSION );
256
- }
257
- }
258
-
259
- return $plugins;
260
- }
261
-
262
- function register_wpc_shortcodes_button( $buttons ) {
263
- if( ! in_array( 'wpc_shortcodes_button', $buttons ) ) {
264
- array_push( $buttons, 'wpc_shortcodes_button' );
265
- }
266
- if( ! in_array( 'wpcfontAwesomeGlyphSelect', $buttons ) ) {
267
- array_push( $buttons, 'wpcfontAwesomeGlyphSelect' );
268
- }
269
-
270
- return $buttons;
271
- }
272
-
273
- /**
274
- * @param $name
275
- * @param $arguments
276
- * @return array|mixed
277
- */
278
- function __call( $name, $arguments ) {
279
- if ( preg_match( '/mce_buttons(?:_[1-4])?|quicktags_settings/', $name ) && !empty( $this->button_filters[$name] ) ) {
280
- $filter = $this->button_filters[$name];
281
- if ( !empty( $filter[0] ) && is_a( $filter[0], 'SiteOrigin_Widget' ) ) {
282
- $widget = $filter[0];
283
- $settings = !empty($arguments[0]) ? $arguments[0] : array();
284
- $editor_id = !empty($arguments[1]) ? $arguments[1] : '';
285
- if ( preg_match( '/widget-' . $widget->id_base . '-.*-' . $this->base_name . '/', $editor_id ) ) {
286
- return call_user_func( $filter, $settings, $editor_id );
287
- }
288
- else {
289
- return $settings;
290
- }
291
- }
292
- }
293
- }
294
-
295
- public function mce_buttons_filter( $buttons, $editor_id ) {
296
- if (($key = array_search('fullscreen', $buttons)) !== false) {
297
- unset($buttons[$key]);
298
- }
299
- return $buttons;
300
- }
301
-
302
- public function quicktags_settings( $settings, $editor_id ) {
303
- $settings['buttons'] = preg_replace( '/,fullscreen/', '', $settings['buttons'] );
304
- $settings['buttons'] = preg_replace( '/,dfw/', '', $settings['buttons'] );
305
- return $settings;
306
- }
307
-
308
- protected function get_input_classes() {
309
- $classes = parent::get_input_classes();
310
- $classes[] = 'wp-editor-area';
311
- $classes[] = 'wp-exclude-emoji';
312
- return $classes;
313
- }
314
-
315
- protected function render_before_field( $value, $instance ) {
316
- $selected_editor = $this->get_selected_editor( $instance );
317
- if( ! empty( $selected_editor ) ) {
318
- $this->selected_editor = $selected_editor;
319
- }
320
- else {
321
- $this->selected_editor = $this->default_editor;
322
- }
323
- parent::render_before_field( $value, $instance );
324
- }
325
-
326
- protected function render_field( $value, $instance ) {
327
-
328
- if ( $this->wp_version_lt_4_8 ) {
329
- $this->render_field_pre48( $value, $instance );
330
- return;
331
- }
332
-
333
- $user_can_richedit = user_can_richedit();
334
-
335
- $selected_editor = $user_can_richedit && in_array( $this->selected_editor, array( 'tinymce', 'tmce' ) ) ? 'tmce' : 'html';
336
-
337
- $settings = array(
338
- 'selectedEditor' => $selected_editor,
339
- );
340
-
341
- if ( $user_can_richedit ) {
342
-
343
- $tmce_settings = array(
344
- 'toolbar1' => apply_filters( 'mce_buttons', $this->mce_buttons, $this->element_id ),
345
- 'toolbar2' => apply_filters( 'mce_buttons_2', $this->mce_buttons_2, $this->element_id ),
346
- 'toolbar3' => apply_filters( 'mce_buttons_3',$this->mce_buttons_3, $this->element_id ),
347
- 'toolbar4' => apply_filters( 'mce_buttons_4',$this->mce_buttons_4, $this->element_id ),
348
- 'plugins' => array_unique( apply_filters( 'tiny_mce_plugins', $this->mce_plugins ) ),
349
- );
350
-
351
- foreach ( $tmce_settings as $name => $setting ) {
352
- $tmce_settings[ $name ] = is_array( $setting ) ? implode( ',', $setting ) : '';
353
- }
354
-
355
- $tmce_settings['external_plugins'] = array_unique( apply_filters( 'mce_external_plugins', $this->mce_external_plugins ) );
356
-
357
- $suffix = SCRIPT_DEBUG ? '' : '.min';
358
- $version = 'ver=' . get_bloginfo( 'version' );
359
- // Default stylesheets
360
- $mce_css = includes_url( "css/dashicons$suffix.css?$version" ) . ',' .
361
- includes_url( "js/tinymce/skins/wordpress/wp-content.css?$version" );
362
-
363
- $editor_styles = get_editor_stylesheets();
364
-
365
- if ( ! empty( $editor_styles ) ) {
366
- // Force urlencoding of commas.
367
- foreach ( $editor_styles as $key => $url ) {
368
- if ( strpos( $url, ',' ) !== false ) {
369
- $editor_styles[ $key ] = str_replace( ',', '%2C', $url );
370
- }
371
- }
372
-
373
- $mce_css .= ',' . implode( ',', $editor_styles );
374
- }
375
- $mce_css = trim( apply_filters( 'mce_css', $mce_css ), ' ,' );
376
- $tmce_settings['content_css'] = $mce_css;
377
-
378
- $settings['tinymce'] = array(
379
- 'wp_skip_init' => strpos( $this->element_id, '__i__' ) != false ||
380
- strpos( $this->element_id, '_id_' ) != false,
381
- 'wpautop' => ! empty( $this->wpautop ),
382
- );
383
-
384
- $tmce_settings = apply_filters( 'tiny_mce_before_init', $tmce_settings, $this->element_id );
385
-
386
- foreach ( $tmce_settings as $name => $setting ) {
387
- unset( $jdec );
388
- if ( ! empty( $tmce_settings[ $name ] ) ) {
389
- // Attempt to decode setting as JSON. For back compat with filters used by WP editor.
390
- if ( is_string( $setting ) ) {
391
- $jdec = json_decode( $setting, true );
392
- }
393
- $settings['tinymce'][ $name ] = empty( $jdec ) ? $setting : $jdec;
394
- }
395
- }
396
-
397
- $media_buttons = $this->render_media_buttons( $this->element_id );
398
- }
399
-
400
- $qt_settings = apply_filters(
401
- 'quicktags_settings',
402
- array( 'buttons' => $this->quicktags_buttons ),
403
- $this->element_id
404
- );
405
-
406
- $qt_settings['buttons'] = ! empty( $qt_settings['buttons'] ) ? $qt_settings['buttons'] : array();
407
- $qt_settings['buttons'] = is_array( $qt_settings['buttons'] ) ? implode( ',', $qt_settings['buttons'] ) : '';
408
-
409
- $settings['quicktags'] = array(
410
- 'buttons' => $qt_settings['buttons'],
411
- );
412
-
413
- $value = apply_filters( 'the_editor_content', $value, $this->selected_editor );
414
-
415
- if ( false !== stripos( $value, 'textarea' ) ) {
416
- $value = preg_replace( '%</textarea%i', '&lt;/textarea', $value );
417
- }
418
-
419
- $media_buttons = $this->render_media_buttons( $this->element_id );
420
-
421
- $settings['baseURL'] = includes_url( 'js/tinymce' );
422
- $settings['suffix'] = SCRIPT_DEBUG ? '' : '.min';
423
-
424
- ?><div class="siteorigin-widget-tinymce-container"
425
- <?php if ( ! empty( $media_buttons ) ) : ?>
426
- data-media-buttons="<?php echo esc_attr( json_encode( array( 'html' => $media_buttons ) ) ) ?>"
427
- <?php endif; ?>
428
- data-editor-settings="<?php echo esc_attr( json_encode( $settings ) ) ?>">
429
- <textarea id="<?php echo esc_attr( $this->element_id ) ?>"
430
- name="<?php echo esc_attr( $this->element_name ) ?>"
431
- <?php if ( isset( $this->editor_height ) ) : ?>
432
- style="height: <?php echo intval( $this->editor_height ) ?>px"
433
- <?php else : ?>
434
- rows="<?php echo esc_attr( $this->rows ) ?>"
435
- <?php endif; ?>
436
- <?php $this->render_data_attributes( $this->get_input_data_attributes() ) ?>
437
- <?php $this->render_CSS_classes( $this->get_input_classes() ) ?>
438
- <?php if ( ! empty( $this->placeholder ) ) echo 'placeholder="' . esc_attr( $this->placeholder ) . '"' ?>
439
- <?php if( ! empty( $this->readonly ) ) echo 'readonly' ?>><?php echo htmlentities( $value, ENT_QUOTES, 'UTF-8' ) ?></textarea>
440
- </div>
441
- <input type="hidden"
442
- name="<?php echo esc_attr( $this->for_widget->so_get_field_name( $this->base_name . '_selected_editor', $this->parent_container) ) ?>"
443
- class="siteorigin-widget-input siteorigin-widget-tinymce-selected-editor"
444
- value="<?php echo esc_attr( $this->selected_editor ) ?>"/>
445
- <?php
446
-
447
- }
448
-
449
- private function render_field_pre48( $value, $instance ) {
450
-
451
- $settings = array(
452
- 'textarea_name' => esc_attr( $this->element_name ),
453
- 'default_editor' => $this->selected_editor,
454
- 'textarea_rows' => $this->rows,
455
- 'editor_class' => 'siteorigin-widget-input',
456
- 'tinymce' => array(
457
- 'wp_skip_init' => strpos( $this->element_id, '__i__' ) != false || strpos( $this->element_id, '_id_' ) != false
458
- )
459
- );
460
- if( isset( $this->editor_height ) ) $settings['editor_height'] = $this->editor_height;
461
- preg_match( '/widget-(.+?)\[/', $this->element_name, $id_base_matches );
462
- $widget_id_base = empty($id_base_matches) || count($id_base_matches) < 2 ? '' : $id_base_matches[1];
463
- ?>
464
- <div class="siteorigin-widget-tinymce-container"
465
- data-mce-settings="<?php echo esc_attr( json_encode( $settings['tinymce'] ) ) ?>"
466
- data-qt-settings="<?php echo esc_attr( json_encode( array() ) ) ?>"
467
- data-widget-id-base="<?php echo esc_attr( $widget_id_base ) ?>"
468
- >
469
- <?php
470
- wp_editor( $value, esc_attr( $this->element_id ), $settings )
471
- ?>
472
- </div>
473
- <input type="hidden"
474
- name="<?php echo esc_attr( $this->for_widget->so_get_field_name( $this->base_name . '_selected_editor', $this->parent_container) ) ?>"
475
- class="siteorigin-widget-input siteorigin-widget-tinymce-selected-editor"
476
- value="<?php echo esc_attr( $this->selected_editor ) ?>"/>
477
- <?php
478
-
479
- if( $this->selected_editor == 'html' ) {
480
- remove_filter( 'the_editor_content', 'wp_htmledit_pre' );
481
- }
482
- if( $this->selected_editor == 'tinymce' ) {
483
- remove_filter( 'the_editor_content', 'wp_richedit_pre' );
484
- }
485
- }
486
-
487
- public function enqueue_scripts() {
488
-
489
- if ( $this->wp_version_lt_4_8 ) {
490
- $src = plugin_dir_url( __FILE__ ) . 'js/tinymce-field-pre48' . SOW_BUNDLE_JS_SUFFIX . '.js';
491
- $deps = array( 'jquery', 'editor', 'quicktags' );
492
- } else {
493
- wp_enqueue_editor();
494
- $src = plugin_dir_url( __FILE__ ) . 'js/tinymce-field' . SOW_BUNDLE_JS_SUFFIX . '.js';
495
- $deps = array( 'jquery' );
496
- }
497
-
498
- wp_enqueue_script( 'so-tinymce-field', $src, $deps, SOW_BUNDLE_VERSION );
499
- wp_enqueue_style(
500
- 'so-tinymce-field', plugin_dir_url( __FILE__ ) . 'css/tinymce-field.css', array(), SOW_BUNDLE_VERSION
501
- );
502
- }
503
-
504
- protected function sanitize_field_input( $value, $instance ) {
505
- $selected_editor = $this->get_selected_editor( $instance );
506
- if ( in_array( $selected_editor, array( 'tinymce', 'tmce' ) ) && ! empty( $this->wpautop ) ) {
507
- $value = wpautop( $value );
508
- }
509
- if( current_user_can( 'unfiltered_html' ) ) {
510
- $sanitized_value = $value;
511
- } else {
512
- $sanitized_value = wp_kses_post( $value );
513
- }
514
- $sanitized_value = balanceTags( $sanitized_value , true );
515
- return $sanitized_value;
516
- }
517
-
518
- public function sanitize_instance( $instance ) {
519
- $selected_editor_name = $this->get_selected_editor_field_name( $this->base_name );
520
- if( ! empty( $instance[ $selected_editor_name ] ) ) {
521
- $selected_editor = $instance[ $selected_editor_name ];
522
- $instance[ $selected_editor_name ] = in_array( $selected_editor, array( 'tinymce', 'tmce', 'quicktags', 'html' ) ) ? $selected_editor : $this->default_editor;
523
- }
524
- return $instance;
525
- }
526
-
527
- public function get_selected_editor( $instance ) {
528
- $selected_editor = null;
529
- $selected_editor_name = $this->get_selected_editor_field_name( $this->base_name );
530
- if( ! empty( $instance[ $selected_editor_name ] ) ) {
531
- $selected_editor = $instance[ $selected_editor_name ];
532
- }
533
-
534
- return $selected_editor;
535
- }
536
-
537
- public function get_selected_editor_field_name( $base_name ) {
538
- $v_name = $base_name;
539
- if( strpos($v_name, '][') !== false ) {
540
- // Remove this splitter
541
- $v_name = substr( $v_name, strrpos($v_name, '][') + 2 );
542
- }
543
- return $v_name . '_selected_editor';
544
- }
545
-
546
- private function render_media_buttons( $editor_id ) {
547
-
548
- ob_start();
549
- if ( ! function_exists( 'media_buttons' ) ) {
550
- include( ABSPATH . 'wp-admin/includes/media.php' );
551
- }
552
-
553
- echo '<div id="wp-' . esc_attr( $editor_id ) . '-media-buttons" class="wp-media-buttons">';
554
-
555
- do_action( 'media_buttons', $editor_id );
556
-
557
- echo "</div>\n";
558
-
559
- return ob_get_clean();
560
- }
561
- }
1
+ <?php
2
+
3
+ class SiteOrigin_Widget_Field_TinyMCE extends SiteOrigin_Widget_Field_Text_Input_Base {
4
+ /**
5
+ * The number of visible rows in the textarea.
6
+ *
7
+ * @access protected
8
+ * @var int
9
+ */
10
+ protected $rows = 10;
11
+ /**
12
+ * The editor initial height. Overrides rows if it is set.
13
+ *
14
+ * @access protected
15
+ * @var int
16
+ */
17
+ protected $editor_height;
18
+ /**
19
+ * The editor to be displayed initially.
20
+ *
21
+ * @access protected
22
+ * @var string
23
+ */
24
+ protected $default_editor = 'tinymce';
25
+ /**
26
+ * The last editor selected by the user.
27
+ *
28
+ * @access protected
29
+ * @var string
30
+ */
31
+ protected $selected_editor;
32
+ /**
33
+ * An array of the buttons which will be rendered for the first toolbar of the TinyMCE editor.
34
+ *
35
+ * @access protected
36
+ * @var array
37
+ */
38
+ protected $mce_buttons;
39
+ /**
40
+ * An array of the buttons which will be rendered for the second toolbar of the TinyMCE editor.
41
+ *
42
+ * @access protected
43
+ * @var array
44
+ */
45
+ protected $mce_buttons_2;
46
+ /**
47
+ * An array of the buttons which will be rendered for the third toolbar of the TinyMCE editor.
48
+ *
49
+ * @access protected
50
+ * @var array
51
+ */
52
+ protected $mce_buttons_3;
53
+ /**
54
+ * An array of the buttons which will be rendered for the fourth toolbar of the TinyMCE editor.
55
+ *
56
+ * @access protected
57
+ * @var array
58
+ */
59
+ protected $mce_buttons_4;
60
+ /**
61
+ * An array of the buttons which will be rendered for the QuickTags editor.
62
+ *
63
+ * @access protected
64
+ * @var array
65
+ */
66
+ protected $quicktags_buttons;
67
+ /**
68
+ * Whether to apply `wpautop` processing. (Adds paragraphs for double linebreaks) Default is true.
69
+ *
70
+ * @access protected
71
+ * @var array
72
+ */
73
+ protected $wpautop;
74
+ /**
75
+ * An array of filter callbacks to apply to the set of buttons which will be rendered for the editor.
76
+ *
77
+ * @access protected
78
+ * @var array
79
+ */
80
+ protected $button_filters;
81
+ /**
82
+ * An array of the included plugins to enable for the TinyMCE editor.
83
+ *
84
+ * @access protected
85
+ * @var array
86
+ */
87
+ protected $mce_plugins;
88
+ /**
89
+ * An array of external plugins for the TinyMCE editor.
90
+ *
91
+ * @access protected
92
+ * @var array
93
+ */
94
+ protected $mce_external_plugins;
95
+ /**
96
+ * Updated Editor JS API was introduced in WP 4.8 so need to check for compatibility with older versions.
97
+ *
98
+ * @access private
99
+ * @var bool
100
+ */
101
+ private $wp_version_lt_4_8;
102
+
103
+ protected function get_default_options() {
104
+ return array(
105
+ 'wpautop' => true,
106
+ 'mce_buttons' => array(
107
+ 'formatselect',
108
+ 'bold',
109
+ 'italic',
110
+ 'bullist',
111
+ 'numlist',
112
+ 'blockquote',
113
+ 'alignleft',
114
+ 'aligncenter',
115
+ 'alignright',
116
+ 'link',
117
+ 'unlink',
118
+ 'wp_more',
119
+ 'wp_adv',
120
+ ),
121
+ 'mce_buttons_2' => array(
122
+ 'strikethrough',
123
+ 'hr',
124
+ 'forecolor',
125
+ 'pastetext',
126
+ 'removeformat',
127
+ 'charmap',
128
+ 'outdent',
129
+ 'indent',
130
+ 'undo',
131
+ 'redo',
132
+ 'wp_help',
133
+ ),
134
+ 'quicktags_buttons' => array(
135
+ 'strong',
136
+ 'em',
137
+ 'link',
138
+ 'block',
139
+ 'del',
140
+ 'ins',
141
+ 'img',
142
+ 'ul',
143
+ 'ol',
144
+ 'li',
145
+ 'code',
146
+ 'more',
147
+ 'close',
148
+ ),
149
+ 'mce_plugins' => array(
150
+ 'charmap',
151
+ 'colorpicker',
152
+ 'hr',
153
+ 'lists',
154
+ 'media',
155
+ 'paste',
156
+ 'tabfocus',
157
+ 'textcolor',
158
+ 'fullscreen',
159
+ 'wordpress',
160
+ 'wpautoresize',
161
+ 'wpeditimage',
162
+ 'wpemoji',
163
+ 'wpgallery',
164
+ 'wplink',
165
+ 'wpdialogs',
166
+ 'wptextpattern',
167
+ 'wpview',
168
+ ),
169
+ 'mce_external_plugins' => array(),
170
+ );
171
+ }
172
+
173
+ protected function initialize() {
174
+ if ( ! is_admin() ) {
175
+ return;
176
+ }
177
+
178
+ global $wp_version;
179
+ $this->wp_version_lt_4_8 = version_compare( $wp_version, '4.8', '<' );
180
+
181
+ if ( ! empty( $this->wp_version_lt_4_8 ) ) {
182
+ add_filter( 'mce_buttons', array( $this, 'mce_buttons_filter' ), 10, 2 );
183
+ add_filter( 'quicktags_settings', array( $this, 'quicktags_settings' ), 10, 2 );
184
+ }
185
+
186
+ if ( ! empty( $this->button_filters ) ) {
187
+ foreach ( $this->button_filters as $filter_name => $filter ) {
188
+ $is_valid_filter = preg_match(
189
+ '/mce_buttons(?:_[1-4])?|quicktags_settings/', $filter_name
190
+ ) && ! empty( $filter ) && is_callable( $filter );
191
+ if ( $is_valid_filter ) {
192
+ add_filter( $filter_name, array( $this, $filter_name ), 10, 2 );
193
+ }
194
+ }
195
+ }
196
+
197
+ if( class_exists( 'WC_Shortcodes_TinyMCE_Buttons' ) ) {
198
+ if ( ! empty( $this->wp_version_lt_4_8 ) ) {
199
+ $screen = get_current_screen();
200
+ if( ! is_null( $screen ) && $screen->id != 'widgets' ) {
201
+ add_filter( 'mce_external_plugins', array( $this, 'add_wpc_shortcodes_plugin' ), 15 );
202
+ add_filter( 'mce_buttons', array( $this, 'register_wpc_shortcodes_button' ), 15 );
203
+ }
204
+ } else {
205
+ $this->mce_external_plugins = $this->add_wpc_shortcodes_plugin( $this->mce_external_plugins );
206
+ $this->mce_buttons = $this->register_wpc_shortcodes_button( $this->mce_buttons );
207
+ }
208
+ }
209
+
210
+ if( class_exists( 'WC_Shortcodes_Admin' ) ) {
211
+ if ( ! empty( $this->wp_version_lt_4_8 ) ) {
212
+
213
+ $screen = get_current_screen();
214
+ if( ! is_null( $screen ) && $screen->id != 'widgets' ) {
215
+ add_filter( 'mce_external_plugins', array( $this, 'add_wc_shortcodes_plugin' ), 15 );
216
+ add_filter( 'mce_buttons', array( $this, 'register_wc_shortcodes_button' ), 15 );
217
+ }
218
+ } else {
219
+ $this->mce_external_plugins = $this->add_wc_shortcodes_plugin( $this->mce_external_plugins );
220
+ $this->mce_buttons = $this->register_wc_shortcodes_button( $this->mce_buttons );
221
+ }
222
+ }
223
+ }
224
+
225
+ function add_wc_shortcodes_plugin( $plugins ) {
226
+ if( isset( $plugins['woocommerce_shortcodes'] ) ) {
227
+ return $plugins;
228
+ }
229
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
230
+ $editor_path = 'woocommerce-shortcodes/assets/js/editor' . $suffix . '.js';
231
+ if( file_exists( WP_PLUGIN_DIR . '/' . $editor_path ) ) {
232
+ $plugins['woocommerce_shortcodes'] = plugins_url( $editor_path );
233
+ }
234
+ return $plugins;
235
+ }
236
+
237
+ function register_wc_shortcodes_button( $buttons ) {
238
+ if( ! in_array( 'woocommerce_shortcodes', $buttons ) ) {
239
+ array_push( $buttons, '|', 'woocommerce_shortcodes' );
240
+ }
241
+ return $buttons;
242
+ }
243
+
244
+ function add_wpc_shortcodes_plugin( $plugins ) {
245
+ if( ! isset( $plugins['wpc_shortcodes'] ) ) {
246
+ $shortcodes_path = 'wc-shortcodes/includes/mce/js/shortcodes-tinymce-4.js';
247
+ if ( file_exists( WP_PLUGIN_DIR . '/' . $shortcodes_path ) ) {
248
+ $plugins['wpc_shortcodes'] = plugins_url( $shortcodes_path . '?ver=' . WC_SHORTCODES_VERSION );
249
+ }
250
+ }
251
+
252
+ if( ! isset( $plugins['wpc_font_awesome'] ) ) {
253
+ $fontawesome_path = 'wc-shortcodes/includes/mce/js/font-awesome-tinymce-4.js';
254
+ if ( file_exists( WP_PLUGIN_DIR . '/' . $fontawesome_path ) ) {
255
+ $plugins['wpc_font_awesome'] = plugins_url( $fontawesome_path . '?ver=' . WC_SHORTCODES_VERSION );
256
+ }
257
+ }
258
+
259
+ return $plugins;
260
+ }
261
+
262
+ function register_wpc_shortcodes_button( $buttons ) {
263
+ if( ! in_array( 'wpc_shortcodes_button', $buttons ) ) {
264
+ array_push( $buttons, 'wpc_shortcodes_button' );
265
+ }
266
+ if( ! in_array( 'wpcfontAwesomeGlyphSelect', $buttons ) ) {
267
+ array_push( $buttons, 'wpcfontAwesomeGlyphSelect' );
268
+ }
269
+
270
+ return $buttons;
271
+ }
272
+
273
+ /**
274
+ * @param $name
275
+ * @param $arguments
276
+ * @return array|mixed
277
+ */
278
+ function __call( $name, $arguments ) {
279
+ if ( preg_match( '/mce_buttons(?:_[1-4])?|quicktags_settings/', $name ) && !empty( $this->button_filters[$name] ) ) {
280
+ $filter = $this->button_filters[$name];
281
+ if ( !empty( $filter[0] ) && is_a( $filter[0], 'SiteOrigin_Widget' ) ) {
282
+ $widget = $filter[0];
283
+ $settings = !empty($arguments[0]) ? $arguments[0] : array();
284
+ $editor_id = !empty($arguments[1]) ? $arguments[1] : '';
285
+ if ( preg_match( '/widget-' . $widget->id_base . '-.*-' . $this->base_name . '/', $editor_id ) ) {
286
+ return call_user_func( $filter, $settings, $editor_id );
287
+ }
288
+ else {
289
+ return $settings;
290
+ }
291
+ }
292
+ }
293
+ }
294
+
295
+ public function mce_buttons_filter( $buttons, $editor_id ) {
296
+ if (($key = array_search('fullscreen', $buttons)) !== false) {
297
+ unset($buttons[$key]);
298
+ }
299
+ return $buttons;
300
+ }
301
+
302
+ public function quicktags_settings( $settings, $editor_id ) {
303
+ $settings['buttons'] = preg_replace( '/,fullscreen/', '', $settings['buttons'] );
304
+ $settings['buttons'] = preg_replace( '/,dfw/', '', $settings['buttons'] );
305
+ return $settings;
306
+ }
307
+
308
+ protected function get_input_classes() {
309
+ $classes = parent::get_input_classes();
310
+ $classes[] = 'wp-editor-area';
311
+ $classes[] = 'wp-exclude-emoji';
312
+ return $classes;
313
+ }
314
+
315
+ protected function render_before_field( $value, $instance ) {
316
+ $selected_editor = $this->get_selected_editor( $instance );
317
+ if( ! empty( $selected_editor ) ) {
318
+ $this->selected_editor = $selected_editor;
319
+ }
320
+ else {
321
+ $this->selected_editor = $this->default_editor;
322
+ }
323
+ parent::render_before_field( $value, $instance );
324
+ }
325
+
326
+ protected function render_field( $value, $instance ) {
327
+
328
+ if ( $this->wp_version_lt_4_8 ) {
329
+ $this->render_field_pre48( $value, $instance );
330
+ return;
331
+ }
332
+
333
+ $user_can_richedit = user_can_richedit();
334
+
335
+ $selected_editor = $user_can_richedit && in_array( $this->selected_editor, array( 'tinymce', 'tmce' ) ) ? 'tmce' : 'html';
336
+
337
+ $settings = array(
338
+ 'selectedEditor' => $selected_editor,
339
+ );
340
+
341
+ if ( $user_can_richedit ) {
342
+
343
+ $tmce_settings = array(
344
+ 'toolbar1' => apply_filters( 'mce_buttons', $this->mce_buttons, $this->element_id ),
345
+ 'toolbar2' => apply_filters( 'mce_buttons_2', $this->mce_buttons_2, $this->element_id ),
346
+ 'toolbar3' => apply_filters( 'mce_buttons_3',$this->mce_buttons_3, $this->element_id ),
347
+ 'toolbar4' => apply_filters( 'mce_buttons_4',$this->mce_buttons_4, $this->element_id ),
348
+ 'plugins' => array_unique( apply_filters( 'tiny_mce_plugins', $this->mce_plugins ) ),
349
+ );
350
+
351
+ foreach ( $tmce_settings as $name => $setting ) {
352
+ $tmce_settings[ $name ] = is_array( $setting ) ? implode( ',', $setting ) : '';
353
+ }
354
+
355
+ $tmce_settings['external_plugins'] = array_unique( apply_filters( 'mce_external_plugins', $this->mce_external_plugins ) );
356
+
357
+ $suffix = SCRIPT_DEBUG ? '' : '.min';
358
+ $version = 'ver=' . get_bloginfo( 'version' );
359
+ // Default stylesheets
360
+ $mce_css = includes_url( "css/dashicons$suffix.css?$version" ) . ',' .
361
+ includes_url( "js/tinymce/skins/wordpress/wp-content.css?$version" );
362
+
363
+ $editor_styles = get_editor_stylesheets();
364
+
365
+ if ( ! empty( $editor_styles ) ) {
366
+ // Force urlencoding of commas.
367
+ foreach ( $editor_styles as $key => $url ) {
368
+ if ( strpos( $url, ',' ) !== false ) {
369
+ $editor_styles[ $key ] = str_replace( ',', '%2C', $url );
370
+ }
371
+ }
372
+
373
+ $mce_css .= ',' . implode( ',', $editor_styles );
374
+ }
375
+ $mce_css = trim( apply_filters( 'mce_css', $mce_css ), ' ,' );
376
+ $tmce_settings['content_css'] = $mce_css;
377
+
378
+ $settings['tinymce'] = array(
379
+ 'wp_skip_init' => strpos( $this->element_id, '__i__' ) != false ||
380
+ strpos( $this->element_id, '_id_' ) != false,
381
+ 'wpautop' => ! empty( $this->wpautop ),
382
+ );
383
+
384
+ $tmce_settings = apply_filters( 'tiny_mce_before_init', $tmce_settings, $this->element_id );
385
+
386
+ foreach ( $tmce_settings as $name => $setting ) {
387
+ unset( $jdec );
388
+ if ( ! empty( $tmce_settings[ $name ] ) ) {
389
+ // Attempt to decode setting as JSON. For back compat with filters used by WP editor.
390
+ if ( is_string( $setting ) ) {
391
+ $jdec = json_decode( $setting, true );
392
+ }
393
+ $settings['tinymce'][ $name ] = empty( $jdec ) ? $setting : $jdec;
394
+ }
395
+ }
396
+
397
+ $media_buttons = $this->render_media_buttons( $this->element_id );
398
+ }
399
+
400
+ $qt_settings = apply_filters(
401
+ 'quicktags_settings',
402
+ array( 'buttons' => $this->quicktags_buttons ),
403
+ $this->element_id
404
+ );
405
+
406
+ $qt_settings['buttons'] = ! empty( $qt_settings['buttons'] ) ? $qt_settings['buttons'] : array();
407
+ $qt_settings['buttons'] = is_array( $qt_settings['buttons'] ) ? implode( ',', $qt_settings['buttons'] ) : '';
408
+
409
+ $settings['quicktags'] = array(
410
+ 'buttons' => $qt_settings['buttons'],
411
+ );
412
+
413
+ $value = apply_filters( 'the_editor_content', $value, $this->selected_editor );
414
+
415
+ if ( false !== stripos( $value, 'textarea' ) ) {
416
+ $value = preg_replace( '%</textarea%i', '&lt;/textarea', $value );
417
+ }
418
+
419
+ $media_buttons = $this->render_media_buttons( $this->element_id );
420
+
421
+ $settings['baseURL'] = includes_url( 'js/tinymce' );
422
+ $settings['suffix'] = SCRIPT_DEBUG ? '' : '.min';
423
+
424
+ ?><div class="siteorigin-widget-tinymce-container"
425
+ <?php if ( ! empty( $media_buttons ) ) : ?>
426
+ data-media-buttons="<?php echo esc_attr( json_encode( array( 'html' => $media_buttons ) ) ) ?>"
427
+ <?php endif; ?>
428
+ data-editor-settings="<?php echo esc_attr( json_encode( $settings ) ) ?>">
429
+ <textarea id="<?php echo esc_attr( $this->element_id ) ?>"
430
+ name="<?php echo esc_attr( $this->element_name ) ?>"
431
+ <?php if ( isset( $this->editor_height ) ) : ?>
432
+ style="height: <?php echo intval( $this->editor_height ) ?>px"
433
+ <?php else : ?>
434
+ rows="<?php echo esc_attr( $this->rows ) ?>"
435
+ <?php endif; ?>
436
+ <?php $this->render_data_attributes( $this->get_input_data_attributes() ) ?>
437
+ <?php $this->render_CSS_classes( $this->get_input_classes() ) ?>
438
+ <?php if ( ! empty( $this->placeholder ) ) echo 'placeholder="' . esc_attr( $this->placeholder ) . '"' ?>
439
+ <?php if( ! empty( $this->readonly ) ) echo 'readonly' ?>><?php echo htmlentities( $value, ENT_QUOTES, 'UTF-8' ) ?></textarea>
440
+ </div>
441
+ <input type="hidden"
442
+ name="<?php echo esc_attr( $this->for_widget->so_get_field_name( $this->base_name . '_selected_editor', $this->parent_container) ) ?>"
443
+ class="siteorigin-widget-input siteorigin-widget-tinymce-selected-editor"
444
+ value="<?php echo esc_attr( $this->selected_editor ) ?>"/>
445
+ <?php
446
+
447
+ }
448
+
449
+ private function render_field_pre48( $value, $instance ) {
450
+
451
+ $settings = array(
452
+ 'textarea_name' => esc_attr( $this->element_name ),
453
+ 'default_editor' => $this->selected_editor,
454
+ 'textarea_rows' => $this->rows,
455
+ 'editor_class' => 'siteorigin-widget-input',
456
+ 'tinymce' => array(
457
+ 'wp_skip_init' => strpos( $this->element_id, '__i__' ) != false || strpos( $this->element_id, '_id_' ) != false
458
+ )
459
+ );
460
+ if( isset( $this->editor_height ) ) $settings['editor_height'] = $this->editor_height;
461
+ preg_match( '/widget-(.+?)\[/', $this->element_name, $id_base_matches );
462
+ $widget_id_base = empty($id_base_matches) || count($id_base_matches) < 2 ? '' : $id_base_matches[1];
463
+ ?>
464
+ <div class="siteorigin-widget-tinymce-container"
465
+ data-mce-settings="<?php echo esc_attr( json_encode( $settings['tinymce'] ) ) ?>"
466
+ data-qt-settings="<?php echo esc_attr( json_encode( array() ) ) ?>"
467
+ data-widget-id-base="<?php echo esc_attr( $widget_id_base ) ?>"
468
+ >
469
+ <?php
470
+ wp_editor( $value, esc_attr( $this->element_id ), $settings )
471
+ ?>
472
+ </div>
473
+ <input type="hidden"
474
+ name="<?php echo esc_attr( $this->for_widget->so_get_field_name( $this->base_name . '_selected_editor', $this->parent_container) ) ?>"
475
+ class="siteorigin-widget-input siteorigin-widget-tinymce-selected-editor"
476
+ value="<?php echo esc_attr( $this->selected_editor ) ?>"/>
477
+ <?php
478
+
479
+ if( $this->selected_editor == 'html' ) {
480
+ remove_filter( 'the_editor_content', 'wp_htmledit_pre' );
481
+ }
482
+ if( $this->selected_editor == 'tinymce' ) {
483
+ remove_filter( 'the_editor_content', 'wp_richedit_pre' );
484
+ }
485
+ }
486
+
487
+ public function enqueue_scripts() {
488
+
489
+ if ( $this->wp_version_lt_4_8 ) {
490
+ $src = plugin_dir_url( __FILE__ ) . 'js/tinymce-field-pre48' . SOW_BUNDLE_JS_SUFFIX . '.js';
491
+ $deps = array( 'jquery', 'editor', 'quicktags' );
492
+ } else {
493
+ wp_enqueue_editor();
494
+ $src = plugin_dir_url( __FILE__ ) . 'js/tinymce-field' . SOW_BUNDLE_JS_SUFFIX . '.js';
495
+ $deps = array( 'jquery' );
496
+ }
497
+
498
+ wp_enqueue_script( 'so-tinymce-field', $src, $deps, SOW_BUNDLE_VERSION );
499
+ wp_enqueue_style(
500
+ 'so-tinymce-field', plugin_dir_url( __FILE__ ) . 'css/tinymce-field.css', array(), SOW_BUNDLE_VERSION
501
+ );
502
+ }
503
+
504
+ protected function sanitize_field_input( $value, $instance ) {
505
+ $selected_editor = $this->get_selected_editor( $instance );
506
+ if ( in_array( $selected_editor, array( 'tinymce', 'tmce' ) ) && ! empty( $this->wpautop ) ) {
507
+ $value = wpautop( $value );
508
+ }
509
+ if( current_user_can( 'unfiltered_html' ) ) {
510
+ $sanitized_value = $value;
511
+ } else {
512
+ $sanitized_value = wp_kses_post( $value );
513
+ }
514
+ $sanitized_value = balanceTags( $sanitized_value , true );
515
+ return $sanitized_value;
516
+ }
517
+
518
+ public function sanitize_instance( $instance ) {
519
+ $selected_editor_name = $this->get_selected_editor_field_name( $this->base_name );
520
+ if( ! empty( $instance[ $selected_editor_name ] ) ) {
521
+ $selected_editor = $instance[ $selected_editor_name ];
522
+ $instance[ $selected_editor_name ] = in_array( $selected_editor, array( 'tinymce', 'tmce', 'quicktags', 'html' ) ) ? $selected_editor : $this->default_editor;
523
+ }
524
+ return $instance;
525
+ }
526
+
527
+ public function get_selected_editor( $instance ) {
528
+ $selected_editor = null;
529
+ $selected_editor_name = $this->get_selected_editor_field_name( $this->base_name );
530
+ if( ! empty( $instance[ $selected_editor_name ] ) ) {
531
+ $selected_editor = $instance[ $selected_editor_name ];
532
+ }
533
+
534
+ return $selected_editor;
535
+ }
536
+
537
+ public function get_selected_editor_field_name( $base_name ) {
538
+ $v_name = $base_name;
539
+ if( strpos($v_name, '][') !== false ) {
540
+ // Remove this splitter
541
+ $v_name = substr( $v_name, strrpos($v_name, '][') + 2 );
542
+ }
543
+ return $v_name . '_selected_editor';
544
+ }
545
+
546
+ private function render_media_buttons( $editor_id ) {
547
+
548
+ ob_start();
549
+ if ( ! function_exists( 'media_buttons' ) ) {
550
+ include( ABSPATH . 'wp-admin/includes/media.php' );
551
+ }
552
+
553
+ echo '<div id="wp-' . esc_attr( $editor_id ) . '-media-buttons" class="wp-media-buttons">';
554
+
555
+ do_action( 'media_buttons', $editor_id );
556
+
557
+ echo "</div>\n";
558
+
559
+ return ob_get_clean();
560
+ }
561
+ }
base/inc/fields/widget.class.php CHANGED
@@ -1,71 +1,71 @@
1
- <?php
2
-
3
- /**
4
- * Class SiteOrigin_Widget_Field_Widget
5
- */
6
- class SiteOrigin_Widget_Field_Widget extends SiteOrigin_Widget_Field_Container_Base {
7
- /**
8
- * The class name of the widget to be included.
9
- *
10
- * @access protected
11
- * @var string
12
- */
13
- protected $class;
14
- /**
15
- * A filter for the widget's form fields. In some cases we may want to filter some fields out of a sub-widget form.
16
- *
17
- * @access protected
18
- * @var callable
19
- */
20
- protected $form_filter;
21
-
22
- public function __construct( $base_name, $element_id, $element_name, $field_options, SiteOrigin_Widget $for_widget, $parent_container = array() ) {
23
- parent::__construct( $base_name, $element_id, $element_name, $field_options, $for_widget, $parent_container );
24
-
25
- if( isset( $this->class ) ) {
26
- if( class_exists( $this->class ) ) {
27
- /* @var $sub_widget SiteOrigin_Widget */
28
- $sub_widget = new $this->class;
29
- if( is_a( $sub_widget, 'SiteOrigin_Widget' ) ) {
30
- if ( ! empty( $this->form_filter ) && is_callable( $this->form_filter ) ) {
31
- $this->fields = call_user_func( $this->form_filter, $sub_widget->form_options( $this->for_widget ) );
32
- } else {
33
- $this->fields = $sub_widget->form_options( $this->for_widget );
34
- }
35
- }
36
- }
37
- }
38
- }
39
-
40
- protected function render_field( $value, $instance ) {
41
-
42
- echo '<div class="siteorigin-widget-widget">';
43
- if ( $this->collapsible ) {
44
- ?><div class="siteorigin-widget-section <?php if( $this->state == 'closed' ) echo 'siteorigin-widget-section-hide'; ?>"><?php
45
- }
46
-
47
- if( ! class_exists( $this->class ) ) {
48
- printf( __( '%s does not exist', 'so-widgets-bundle' ), $this->class );
49
- if ( $this->collapsible ) {
50
- echo '</div>';
51
- }
52
- return;
53
- }
54
-
55
- /* @var $sub_widget SiteOrigin_Widget */
56
- $sub_widget = new $this->class;
57
- if( ! is_a( $sub_widget, 'SiteOrigin_Widget' ) ) {
58
- printf( __( '%s is not a SiteOrigin Widget', 'so-widgets-bundle' ), $this->class );
59
- if ( $this->collapsible ) {
60
- echo '</div>';
61
- }
62
- return;
63
- }
64
- $this->create_and_render_sub_fields( $value, array( 'name' => $this->base_name, 'type' => 'widget' ) );
65
- if ( $this->collapsible ) {
66
- ?></div><?php
67
- }
68
- echo '</div>';
69
- }
70
-
71
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class SiteOrigin_Widget_Field_Widget
5
+ */
6
+ class SiteOrigin_Widget_Field_Widget extends SiteOrigin_Widget_Field_Container_Base {
7
+ /**
8
+ * The class name of the widget to be included.
9
+ *
10
+ * @access protected
11
+ * @var string
12
+ */
13
+ protected $class;
14
+ /**
15
+ * A filter for the widget's form fields. In some cases we may want to filter some fields out of a sub-widget form.
16
+ *
17
+ * @access protected
18
+ * @var callable
19
+ */
20
+ protected $form_filter;
21
+
22
+ public function __construct( $base_name, $element_id, $element_name, $field_options, SiteOrigin_Widget $for_widget, $parent_container = array() ) {
23
+ parent::__construct( $base_name, $element_id, $element_name, $field_options, $for_widget, $parent_container );
24
+
25
+ if( isset( $this->class ) ) {
26
+ if( class_exists( $this->class ) ) {
27
+ /* @var $sub_widget SiteOrigin_Widget */
28
+ $sub_widget = new $this->class;
29
+ if( is_a( $sub_widget, 'SiteOrigin_Widget' ) ) {
30
+ if ( ! empty( $this->form_filter ) && is_callable( $this->form_filter ) ) {
31
+ $this->fields = call_user_func( $this->form_filter, $sub_widget->form_options( $this->for_widget ) );
32
+ } else {
33
+ $this->fields = $sub_widget->form_options( $this->for_widget );
34
+ }
35
+ }
36
+ }
37
+ }
38
+ }
39
+
40
+ protected function render_field( $value, $instance ) {
41
+
42
+ echo '<div class="siteorigin-widget-widget">';
43
+ if ( $this->collapsible ) {
44
+ ?><div class="siteorigin-widget-section <?php if( $this->state == 'closed' ) echo 'siteorigin-widget-section-hide'; ?>"><?php
45
+ }
46
+
47
+ if( ! class_exists( $this->class ) ) {
48
+ printf( __( '%s does not exist', 'so-widgets-bundle' ), $this->class );
49
+ if ( $this->collapsible ) {
50
+ echo '</div>';
51
+ }
52
+ return;
53
+ }
54
+
55
+ /* @var $sub_widget SiteOrigin_Widget */
56
+ $sub_widget = new $this->class;
57
+ if( ! is_a( $sub_widget, 'SiteOrigin_Widget' ) ) {
58
+ printf( __( '%s is not a SiteOrigin Widget', 'so-widgets-bundle' ), $this->class );
59
+ if ( $this->collapsible ) {
60
+ echo '</div>';
61
+ }
62
+ return;
63
+ }
64
+ $this->create_and_render_sub_fields( $value, array( 'name' => $this->base_name, 'type' => 'widget' ) );
65
+ if ( $this->collapsible ) {
66
+ ?></div><?php
67
+ }
68
+ echo '</div>';
69
+ }
70
+
71
+ }
base/inc/fonts.php CHANGED
@@ -1,4846 +1,4846 @@
1
- <?php
2
-
3
- return array(
4
- 'ABeeZee' =>
5
- array(
6
- 0 => 'regular',
7
- 1 => 'italic',
8
- ),
9
- 'Abel' =>
10
- array(
11
- 0 => 'regular',
12
- ),
13
- 'Abhaya Libre' =>
14
- array(
15
- 0 => 'regular',
16
- 1 => '500',
17
- 2 => '600',
18
- 3 => '700',
19
- 4 => '800',
20
- ),
21
- 'Abril Fatface' =>
22
- array(
23
- 0 => 'regular',
24
- ),
25
- 'Aclonica' =>
26
- array(
27
- 0 => 'regular',
28
- ),
29
- 'Acme' =>
30
- array(
31
- 0 => 'regular',
32
- ),
33
- 'Actor' =>
34
- array(
35
- 0 => 'regular',
36
- ),
37
- 'Adamina' =>
38
- array(
39
- 0 => 'regular',
40
- ),
41
- 'Advent Pro' =>
42
- array(
43
- 0 => '100',
44
- 1 => '200',
45
- 2 => '300',
46
- 3 => 'regular',
47
- 4 => '500',
48
- 5 => '600',
49
- 6 => '700',
50
- ),
51
- 'Aguafina Script' =>
52
- array(
53
- 0 => 'regular',
54
- ),
55
- 'Akronim' =>
56
- array(
57
- 0 => 'regular',
58
- ),
59
- 'Aladin' =>
60
- array(
61
- 0 => 'regular',
62
- ),
63
- 'Aldrich' =>
64
- array(
65
- 0 => 'regular',
66
- ),
67
- 'Alef' =>
68
- array(
69
- 0 => 'regular',
70
- 1 => '700',
71
- ),
72
- 'Alegreya' =>
73
- array(
74
- 0 => 'regular',
75
- 1 => 'italic',
76
- 2 => '500',
77
- 3 => '500italic',
78
- 4 => '700',
79
- 5 => '700italic',
80
- 6 => '800',
81
- 7 => '800italic',
82
- 8 => '900',
83
- 9 => '900italic',
84
- ),
85
- 'Alegreya SC' =>
86
- array(
87
- 0 => 'regular',
88
- 1 => 'italic',
89
- 2 => '500',
90
- 3 => '500italic',
91
- 4 => '700',
92
- 5 => '700italic',
93
- 6 => '800',
94
- 7 => '800italic',
95
- 8 => '900',
96
- 9 => '900italic',
97
- ),
98
- 'Alegreya Sans' =>
99
- array(
100
- 0 => '100',
101
- 1 => '100italic',
102
- 2 => '300',
103
- 3 => '300italic',
104
- 4 => 'regular',
105
- 5 => 'italic',
106
- 6 => '500',
107
- 7 => '500italic',
108
- 8 => '700',
109
- 9 => '700italic',
110
- 10 => '800',
111
- 11 => '800italic',
112
- 12 => '900',
113
- 13 => '900italic',
114
- ),
115
- 'Alegreya Sans SC' =>
116
- array(
117
- 0 => '100',
118
- 1 => '100italic',
119
- 2 => '300',
120
- 3 => '300italic',
121
- 4 => 'regular',
122
- 5 => 'italic',
123
- 6 => '500',
124
- 7 => '500italic',
125
- 8 => '700',
126
- 9 => '700italic',
127
- 10 => '800',
128
- 11 => '800italic',
129
- 12 => '900',
130
- 13 => '900italic',
131
- ),
132
- 'Alex Brush' =>
133
- array(
134
- 0 => 'regular',
135
- ),
136
- 'Alfa Slab One' =>
137
- array(
138
- 0 => 'regular',
139
- ),
140
- 'Alice' =>
141
- array(
142
- 0 => 'regular',
143
- ),
144
- 'Alike' =>
145
- array(
146
- 0 => 'regular',
147
- ),
148
- 'Alike Angular' =>
149
- array(
150
- 0 => 'regular',
151
- ),
152
- 'Allan' =>
153
- array(
154
- 0 => 'regular',
155
- 1 => '700',
156
- ),
157
- 'Allerta' =>
158
- array(
159
- 0 => 'regular',
160
- ),
161
- 'Allerta Stencil' =>
162
- array(
163
- 0 => 'regular',
164
- ),
165
- 'Allura' =>
166
- array(
167
- 0 => 'regular',
168
- ),
169
- 'Almendra' =>
170
- array(
171
- 0 => 'regular',
172
- 1 => 'italic',
173
- 2 => '700',
174
- 3 => '700italic',
175
- ),
176
- 'Almendra Display' =>
177
- array(
178
- 0 => 'regular',
179
- ),
180
- 'Almendra SC' =>
181
- array(
182
- 0 => 'regular',
183
- ),
184
- 'Amarante' =>
185
- array(
186
- 0 => 'regular',
187
- ),
188
- 'Amaranth' =>
189
- array(
190
- 0 => 'regular',
191
- 1 => 'italic',
192
- 2 => '700',
193
- 3 => '700italic',
194
- ),
195
- 'Amatic SC' =>
196
- array(
197
- 0 => 'regular',
198
- 1 => '700',
199
- ),
200
- 'Amethysta' =>
201
- array(
202
- 0 => 'regular',
203
- ),
204
- 'Amiko' =>
205
- array(
206
- 0 => 'regular',
207
- 1 => '600',
208
- 2 => '700',
209
- ),
210
- 'Amiri' =>
211
- array(
212
- 0 => 'regular',
213
- 1 => 'italic',
214
- 2 => '700',
215
- 3 => '700italic',
216
- ),
217
- 'Amita' =>
218
- array(
219
- 0 => 'regular',
220
- 1 => '700',
221
- ),
222
- 'Anaheim' =>
223
- array(
224
- 0 => 'regular',
225
- ),
226
- 'Andada' =>
227
- array(
228
- 0 => 'regular',
229
- ),
230
- 'Andika' =>
231
- array(
232
- 0 => 'regular',
233
- ),
234
- 'Angkor' =>
235
- array(
236
- 0 => 'regular',
237
- ),
238
- 'Annie Use Your Telescope' =>
239
- array(
240
- 0 => 'regular',
241
- ),
242
- 'Anonymous Pro' =>
243
- array(
244
- 0 => 'regular',
245
- 1 => 'italic',
246
- 2 => '700',
247
- 3 => '700italic',
248
- ),
249
- 'Antic' =>
250
- array(
251
- 0 => 'regular',
252
- ),
253
- 'Antic Didone' =>
254
- array(
255
- 0 => 'regular',
256
- ),
257
- 'Antic Slab' =>
258
- array(
259
- 0 => 'regular',
260
- ),
261
- 'Anton' =>
262
- array(
263
- 0 => 'regular',
264
- ),
265
- 'Arapey' =>
266
- array(
267
- 0 => 'regular',
268
- 1 => 'italic',
269
- ),
270
- 'Arbutus' =>
271
- array(
272
- 0 => 'regular',
273
- ),
274
- 'Arbutus Slab' =>
275
- array(
276
- 0 => 'regular',
277
- ),
278
- 'Architects Daughter' =>
279
- array(
280
- 0 => 'regular',
281
- ),
282
- 'Archivo' =>
283
- array(
284
- 0 => 'regular',
285
- 1 => 'italic',
286
- 2 => '500',
287
- 3 => '500italic',
288
- 4 => '600',
289
- 5 => '600italic',
290
- 6 => '700',
291
- 7 => '700italic',
292
- ),
293
- 'Archivo Black' =>
294
- array(
295
- 0 => 'regular',
296
- ),
297
- 'Archivo Narrow' =>
298
- array(
299
- 0 => 'regular',
300
- 1 => 'italic',
301
- 2 => '500',
302
- 3 => '500italic',
303
- 4 => '600',
304
- 5 => '600italic',
305
- 6 => '700',
306
- 7 => '700italic',
307
- ),
308
- 'Aref Ruqaa' =>
309
- array(
310
- 0 => 'regular',
311
- 1 => '700',
312
- ),
313
- 'Arima Madurai' =>
314
- array(
315
- 0 => '100',
316
- 1 => '200',
317
- 2 => '300',
318
- 3 => 'regular',
319
- 4 => '500',
320
- 5 => '700',
321
- 6 => '800',
322
- 7 => '900',
323
- ),
324
- 'Arimo' =>
325
- array(
326
- 0 => 'regular',
327
- 1 => 'italic',
328
- 2 => '700',
329
- 3 => '700italic',
330
- ),
331
- 'Arizonia' =>
332
- array(
333
- 0 => 'regular',
334
- ),
335
- 'Armata' =>
336
- array(
337
- 0 => 'regular',
338
- ),
339
- 'Arsenal' =>
340
- array(
341
- 0 => 'regular',
342
- 1 => 'italic',
343
- 2 => '700',
344
- 3 => '700italic',
345
- ),
346
- 'Artifika' =>
347
- array(
348
- 0 => 'regular',
349
- ),
350
- 'Arvo' =>
351
- array(
352
- 0 => 'regular',
353
- 1 => 'italic',
354
- 2 => '700',
355
- 3 => '700italic',
356
- ),
357
- 'Arya' =>
358
- array(
359
- 0 => 'regular',
360
- 1 => '700',
361
- ),
362
- 'Asap' =>
363
- array(
364
- 0 => 'regular',
365
- 1 => 'italic',
366
- 2 => '500',
367
- 3 => '500italic',
368
- 4 => '600',
369
- 5 => '600italic',
370
- 6 => '700',
371
- 7 => '700italic',
372
- ),
373
- 'Asap Condensed' =>
374
- array(
375
- 0 => 'regular',
376
- 1 => 'italic',
377
- 2 => '500',
378
- 3 => '500italic',
379
- 4 => '600',
380
- 5 => '600italic',
381
- 6 => '700',
382
- 7 => '700italic',
383
- ),
384
- 'Asar' =>
385
- array(
386
- 0 => 'regular',
387
- ),
388
- 'Asset' =>
389
- array(
390
- 0 => 'regular',
391
- ),
392
- 'Assistant' =>
393
- array(
394
- 0 => '200',
395
- 1 => '300',
396
- 2 => 'regular',
397
- 3 => '600',
398
- 4 => '700',
399
- 5 => '800',
400
- ),
401
- 'Astloch' =>
402
- array(
403
- 0 => 'regular',
404
- 1 => '700',
405
- ),
406
- 'Asul' =>
407
- array(
408
- 0 => 'regular',
409
- 1 => '700',
410
- ),
411
- 'Athiti' =>
412
- array(
413
- 0 => '200',
414
- 1 => '300',
415
- 2 => 'regular',
416
- 3 => '500',
417
- 4 => '600',
418
- 5 => '700',
419
- ),
420
- 'Atma' =>
421
- array(
422
- 0 => '300',
423
- 1 => 'regular',
424
- 2 => '500',
425
- 3 => '600',
426
- 4 => '700',
427
- ),
428
- 'Atomic Age' =>
429
- array(
430
- 0 => 'regular',
431
- ),
432
- 'Aubrey' =>
433
- array(
434
- 0 => 'regular',
435
- ),
436
- 'Audiowide' =>
437
- array(
438
- 0 => 'regular',
439
- ),
440
- 'Autour One' =>
441
- array(
442
- 0 => 'regular',
443
- ),
444
- 'Average' =>
445
- array(
446
- 0 => 'regular',
447
- ),
448
- 'Average Sans' =>
449
- array(
450
- 0 => 'regular',
451
- ),
452
- 'Averia Gruesa Libre' =>
453
- array(
454
- 0 => 'regular',
455
- ),
456
- 'Averia Libre' =>
457
- array(
458
- 0 => '300',
459
- 1 => '300italic',
460
- 2 => 'regular',
461
- 3 => 'italic',
462
- 4 => '700',
463
- 5 => '700italic',
464
- ),
465
- 'Averia Sans Libre' =>
466
- array(
467
- 0 => '300',
468
- 1 => '300italic',
469
- 2 => 'regular',
470
- 3 => 'italic',
471
- 4 => '700',
472
- 5 => '700italic',
473
- ),
474
- 'Averia Serif Libre' =>
475
- array(
476
- 0 => '300',
477
- 1 => '300italic',
478
- 2 => 'regular',
479
- 3 => 'italic',
480
- 4 => '700',
481
- 5 => '700italic',
482
- ),
483
- 'Bad Script' =>
484
- array(
485
- 0 => 'regular',
486
- ),
487
- 'Bahiana' =>
488
- array(
489
- 0 => 'regular',
490
- ),
491
- 'Baloo' =>
492
- array(
493
- 0 => 'regular',
494
- ),
495
- 'Baloo Bhai' =>
496
- array(
497
- 0 => 'regular',
498
- ),
499
- 'Baloo Bhaijaan' =>
500
- array(
501
- 0 => 'regular',
502
- ),
503
- 'Baloo Bhaina' =>
504
- array(
505
- 0 => 'regular',
506
- ),
507
- 'Baloo Chettan' =>
508
- array(
509
- 0 => 'regular',
510
- ),
511
- 'Baloo Da' =>
512
- array(
513
- 0 => 'regular',
514
- ),
515
- 'Baloo Paaji' =>
516
- array(
517
- 0 => 'regular',
518
- ),
519
- 'Baloo Tamma' =>
520
- array(
521
- 0 => 'regular',
522
- ),
523
- 'Baloo Tammudu' =>
524
- array(
525
- 0 => 'regular',
526
- ),
527
- 'Baloo Thambi' =>
528
- array(
529
- 0 => 'regular',
530
- ),
531
- 'Balthazar' =>
532
- array(
533
- 0 => 'regular',
534
- ),
535
- 'Bangers' =>
536
- array(
537
- 0 => 'regular',
538
- ),
539
- 'Barlow' =>
540
- array(
541
- 0 => '100',
542
- 1 => '100italic',
543
- 2 => '200',
544
- 3 => '200italic',
545
- 4 => '300',
546
- 5 => '300italic',
547
- 6 => 'regular',
548
- 7 => 'italic',
549
- 8 => '500',
550
- 9 => '500italic',
551
- 10 => '600',
552
- 11 => '600italic',
553
- 12 => '700',
554
- 13 => '700italic',
555
- 14 => '800',
556
- 15 => '800italic',
557
- 16 => '900',
558
- 17 => '900italic',
559
- ),
560
- 'Barlow Condensed' =>
561
- array(
562
- 0 => '100',
563
- 1 => '100italic',
564
- 2 => '200',
565
- 3 => '200italic',
566
- 4 => '300',
567
- 5 => '300italic',
568
- 6 => 'regular',
569
- 7 => 'italic',
570
- 8 => '500',
571
- 9 => '500italic',
572
- 10 => '600',
573
- 11 => '600italic',
574
- 12 => '700',
575
- 13 => '700italic',
576
- 14 => '800',
577
- 15 => '800italic',
578
- 16 => '900',
579
- 17 => '900italic',
580
- ),
581
- 'Barlow Semi Condensed' =>
582
- array(
583
- 0 => '100',
584
- 1 => '100italic',
585
- 2 => '200',
586
- 3 => '200italic',
587
- 4 => '300',
588
- 5 => '300italic',
589
- 6 => 'regular',
590
- 7 => 'italic',
591
- 8 => '500',
592
- 9 => '500italic',
593
- 10 => '600',
594
- 11 => '600italic',
595
- 12 => '700',
596
- 13 => '700italic',
597
- 14 => '800',
598
- 15 => '800italic',
599
- 16 => '900',
600
- 17 => '900italic',
601
- ),
602
- 'Barrio' =>
603
- array(
604
- 0 => 'regular',
605
- ),
606
- 'Basic' =>
607
- array(
608
- 0 => 'regular',
609
- ),
610
- 'Battambang' =>
611
- array(
612
- 0 => 'regular',
613
- 1 => '700',
614
- ),
615
- 'Baumans' =>
616
- array(
617
- 0 => 'regular',
618
- ),
619
- 'Bayon' =>
620
- array(
621
- 0 => 'regular',
622
- ),
623
- 'Belgrano' =>
624
- array(
625
- 0 => 'regular',
626
- ),
627
- 'Bellefair' =>
628
- array(
629
- 0 => 'regular',
630
- ),
631
- 'Belleza' =>
632
- array(
633
- 0 => 'regular',
634
- ),
635
- 'BenchNine' =>
636
- array(
637
- 0 => '300',
638
- 1 => 'regular',
639
- 2 => '700',
640
- ),
641
- 'Bentham' =>
642
- array(
643
- 0 => 'regular',
644
- ),
645
- 'Berkshire Swash' =>
646
- array(
647
- 0 => 'regular',
648
- ),
649
- 'Bevan' =>
650
- array(
651
- 0 => 'regular',
652
- ),
653
- 'Bigelow Rules' =>
654
- array(
655
- 0 => 'regular',
656
- ),
657
- 'Bigshot One' =>
658
- array(
659
- 0 => 'regular',
660
- ),
661
- 'Bilbo' =>
662
- array(
663
- 0 => 'regular',
664
- ),
665
- 'Bilbo Swash Caps' =>
666
- array(
667
- 0 => 'regular',
668
- ),
669
- 'BioRhyme' =>
670
- array(
671
- 0 => '200',
672
- 1 => '300',
673
- 2 => 'regular',
674
- 3 => '700',
675
- 4 => '800',
676
- ),
677
- 'BioRhyme Expanded' =>
678
- array(
679
- 0 => '200',
680
- 1 => '300',
681
- 2 => 'regular',
682
- 3 => '700',
683
- 4 => '800',
684
- ),
685
- 'Biryani' =>
686
- array(
687
- 0 => '200',
688
- 1 => '300',
689
- 2 => 'regular',
690
- 3 => '600',
691
- 4 => '700',
692
- 5 => '800',
693
- 6 => '900',
694
- ),
695
- 'Bitter' =>
696
- array(
697
- 0 => 'regular',
698
- 1 => 'italic',
699
- 2 => '700',
700
- ),
701
- 'Black Ops One' =>
702
- array(
703
- 0 => 'regular',
704
- ),
705
- 'Bokor' =>
706
- array(
707
- 0 => 'regular',
708
- ),
709
- 'Bonbon' =>
710
- array(
711
- 0 => 'regular',
712
- ),
713
- 'Boogaloo' =>
714
- array(
715
- 0 => 'regular',
716
- ),
717
- 'Bowlby One' =>
718
- array(
719
- 0 => 'regular',
720
- ),
721
- 'Bowlby One SC' =>
722
- array(
723
- 0 => 'regular',
724
- ),
725
- 'Brawler' =>
726
- array(
727
- 0 => 'regular',
728
- ),
729
- 'Bree Serif' =>
730
- array(
731
- 0 => 'regular',
732
- ),
733
- 'Bubblegum Sans' =>
734
- array(
735
- 0 => 'regular',
736
- ),
737
- 'Bubbler One' =>
738
- array(
739
- 0 => 'regular',
740
- ),
741
- 'Buda' =>
742
- array(
743
- 0 => '300',
744
- ),
745
- 'Buenard' =>
746
- array(
747
- 0 => 'regular',
748
- 1 => '700',
749
- ),
750
- 'Bungee' =>
751
- array(
752
- 0 => 'regular',
753
- ),
754
- 'Bungee Hairline' =>
755
- array(
756
- 0 => 'regular',
757
- ),
758
- 'Bungee Inline' =>
759
- array(
760
- 0 => 'regular',
761
- ),
762
- 'Bungee Outline' =>
763
- array(
764
- 0 => 'regular',
765
- ),
766
- 'Bungee Shade' =>
767
- array(
768
- 0 => 'regular',
769
- ),
770
- 'Butcherman' =>
771
- array(
772
- 0 => 'regular',
773
- ),
774
- 'Butterfly Kids' =>
775
- array(
776
- 0 => 'regular',
777
- ),
778
- 'Cabin' =>
779
- array(
780
- 0 => 'regular',
781
- 1 => 'italic',
782
- 2 => '500',
783
- 3 => '500italic',
784
- 4 => '600',
785
- 5 => '600italic',
786
- 6 => '700',
787
- 7 => '700italic',
788
- ),
789
- 'Cabin Condensed' =>
790
- array(
791
- 0 => 'regular',
792
- 1 => '500',
793
- 2 => '600',
794
- 3 => '700',
795
- ),
796
- 'Cabin Sketch' =>
797
- array(
798
- 0 => 'regular',
799
- 1 => '700',
800
- ),
801
- 'Caesar Dressing' =>
802
- array(
803
- 0 => 'regular',
804
- ),
805
- 'Cagliostro' =>
806
- array(
807
- 0 => 'regular',
808
- ),
809
- 'Cairo' =>
810
- array(
811
- 0 => '200',
812
- 1 => '300',
813
- 2 => 'regular',
814
- 3 => '600',
815
- 4 => '700',
816
- 5 => '900',
817
- ),
818
- 'Calligraffitti' =>
819
- array(
820
- 0 => 'regular',
821
- ),
822
- 'Cambay' =>
823
- array(
824
- 0 => 'regular',
825
- 1 => 'italic',
826
- 2 => '700',
827
- 3 => '700italic',
828
- ),
829
- 'Cambo' =>
830
- array(
831
- 0 => 'regular',
832
- ),
833
- 'Candal' =>
834
- array(
835
- 0 => 'regular',
836
- ),
837
- 'Cantarell' =>
838
- array(
839
- 0 => 'regular',
840
- 1 => 'italic',
841
- 2 => '700',
842
- 3 => '700italic',
843
- ),
844
- 'Cantata One' =>
845
- array(
846
- 0 => 'regular',
847
- ),
848
- 'Cantora One' =>
849
- array(
850
- 0 => 'regular',
851
- ),
852
- 'Capriola' =>
853
- array(
854
- 0 => 'regular',
855
- ),
856
- 'Cardo' =>
857
- array(
858
- 0 => 'regular',
859
- 1 => 'italic',
860
- 2 => '700',
861
- ),
862
- 'Carme' =>
863
- array(
864
- 0 => 'regular',
865
- ),
866
- 'Carrois Gothic' =>
867
- array(
868
- 0 => 'regular',
869
- ),
870
- 'Carrois Gothic SC' =>
871
- array(
872
- 0 => 'regular',
873
- ),
874
- 'Carter One' =>
875
- array(
876
- 0 => 'regular',
877
- ),
878
- 'Catamaran' =>
879
- array(
880
- 0 => '100',
881
- 1 => '200',
882
- 2 => '300',
883
- 3 => 'regular',
884
- 4 => '500',
885
- 5 => '600',
886
- 6 => '700',
887
- 7 => '800',
888
- 8 => '900',
889
- ),
890
- 'Caudex' =>
891
- array(
892
- 0 => 'regular',
893
- 1 => 'italic',
894
- 2 => '700',
895
- 3 => '700italic',
896
- ),
897
- 'Caveat' =>
898
- array(
899
- 0 => 'regular',
900
- 1 => '700',
901
- ),
902
- 'Caveat Brush' =>
903
- array(
904
- 0 => 'regular',
905
- ),
906
- 'Cedarville Cursive' =>
907
- array(
908
- 0 => 'regular',
909
- ),
910
- 'Ceviche One' =>
911
- array(
912
- 0 => 'regular',
913
- ),
914
- 'Changa' =>
915
- array(
916
- 0 => '200',
917
- 1 => '300',
918
- 2 => 'regular',
919
- 3 => '500',
920
- 4 => '600',
921
- 5 => '700',
922
- 6 => '800',
923
- ),
924
- 'Changa One' =>
925
- array(
926
- 0 => 'regular',
927
- 1 => 'italic',
928
- ),
929
- 'Chango' =>
930
- array(
931
- 0 => 'regular',
932
- ),
933
- 'Chathura' =>
934
- array(
935
- 0 => '100',
936
- 1 => '300',
937
- 2 => 'regular',
938
- 3 => '700',
939
- 4 => '800',
940
- ),
941
- 'Chau Philomene One' =>
942
- array(
943
- 0 => 'regular',
944
- 1 => 'italic',
945
- ),
946
- 'Chela One' =>
947
- array(
948
- 0 => 'regular',
949
- ),
950
- 'Chelsea Market' =>
951
- array(
952
- 0 => 'regular',
953
- ),
954
- 'Chenla' =>
955
- array(
956
- 0 => 'regular',
957
- ),
958
- 'Cherry Cream Soda' =>
959
- array(
960
- 0 => 'regular',
961
- ),
962
- 'Cherry Swash' =>
963
- array(
964
- 0 => 'regular',
965
- 1 => '700',
966
- ),
967
- 'Chewy' =>
968
- array(
969
- 0 => 'regular',
970
- ),
971
- 'Chicle' =>
972
- array(
973
- 0 => 'regular',
974
- ),
975
- 'Chivo' =>
976
- array(
977
- 0 => '300',
978
- 1 => '300italic',
979
- 2 => 'regular',
980
- 3 => 'italic',
981
- 4 => '700',
982
- 5 => '700italic',
983
- 6 => '900',
984
- 7 => '900italic',
985
- ),
986
- 'Chonburi' =>
987
- array(
988
- 0 => 'regular',
989
- ),
990
- 'Cinzel' =>
991
- array(
992
- 0 => 'regular',
993
- 1 => '700',
994
- 2 => '900',
995
- ),
996
- 'Cinzel Decorative' =>
997
- array(
998
- 0 => 'regular',
999
- 1 => '700',
1000
- 2 => '900',
1001
- ),
1002
- 'Clicker Script' =>
1003
- array(
1004
- 0 => 'regular',
1005
- ),
1006
- 'Coda' =>
1007
- array(
1008
- 0 => 'regular',
1009
- 1 => '800',
1010
- ),
1011
- 'Coda Caption' =>
1012
- array(
1013
- 0 => '800',
1014
- ),
1015
- 'Codystar' =>
1016
- array(
1017
- 0 => '300',
1018
- 1 => 'regular',
1019
- ),
1020
- 'Coiny' =>
1021
- array(
1022
- 0 => 'regular',
1023
- ),
1024
- 'Combo' =>
1025
- array(
1026
- 0 => 'regular',
1027
- ),
1028
- 'Comfortaa' =>
1029
- array(
1030
- 0 => '300',
1031
- 1 => 'regular',
1032
- 2 => '700',
1033
- ),
1034
- 'Coming Soon' =>
1035
- array(
1036
- 0 => 'regular',
1037
- ),
1038
- 'Concert One' =>
1039
- array(
1040
- 0 => 'regular',
1041
- ),
1042
- 'Condiment' =>
1043
- array(
1044
- 0 => 'regular',
1045
- ),
1046
- 'Content' =>
1047
- array(
1048
- 0 => 'regular',
1049
- 1 => '700',
1050
- ),
1051
- 'Contrail One' =>
1052
- array(
1053
- 0 => 'regular',
1054
- ),
1055
- 'Convergence' =>
1056
- array(
1057
- 0 => 'regular',
1058
- ),
1059
- 'Cookie' =>
1060
- array(
1061
- 0 => 'regular',
1062
- ),
1063
- 'Copse' =>
1064
- array(
1065
- 0 => 'regular',
1066
- ),
1067
- 'Corben' =>
1068
- array(
1069
- 0 => 'regular',
1070
- 1 => '700',
1071
- ),
1072
- 'Cormorant' =>
1073
- array(
1074
- 0 => '300',
1075
- 1 => '300italic',
1076
- 2 => 'regular',
1077
- 3 => 'italic',
1078
- 4 => '500',
1079
- 5 => '500italic',
1080
- 6 => '600',
1081
- 7 => '600italic',
1082
- 8 => '700',
1083
- 9 => '700italic',
1084
- ),
1085
- 'Cormorant Garamond' =>
1086
- array(
1087
- 0 => '300',
1088
- 1 => '300italic',
1089
- 2 => 'regular',
1090
- 3 => 'italic',
1091
- 4 => '500',
1092
- 5 => '500italic',
1093
- 6 => '600',
1094
- 7 => '600italic',
1095
- 8 => '700',
1096
- 9 => '700italic',
1097
- ),
1098
- 'Cormorant Infant' =>
1099
- array(
1100
- 0 => '300',
1101
- 1 => '300italic',
1102
- 2 => 'regular',
1103
- 3 => 'italic',
1104
- 4 => '500',
1105
- 5 => '500italic',
1106
- 6 => '600',
1107
- 7 => '600italic',
1108
- 8 => '700',
1109
- 9 => '700italic',
1110
- ),
1111
- 'Cormorant SC' =>
1112
- array(
1113
- 0 => '300',
1114
- 1 => 'regular',
1115
- 2 => '500',
1116
- 3 => '600',
1117
- 4 => '700',
1118
- ),
1119
- 'Cormorant Unicase' =>
1120
- array(
1121
- 0 => '300',
1122
- 1 => 'regular',
1123
- 2 => '500',
1124
- 3 => '600',
1125
- 4 => '700',
1126
- ),
1127
- 'Cormorant Upright' =>
1128
- array(
1129
- 0 => '300',
1130
- 1 => 'regular',
1131
- 2 => '500',
1132
- 3 => '600',
1133
- 4 => '700',
1134
- ),
1135
- 'Courgette' =>
1136
- array(
1137
- 0 => 'regular',
1138
- ),
1139
- 'Cousine' =>
1140
- array(
1141
- 0 => 'regular',
1142
- 1 => 'italic',
1143
- 2 => '700',
1144
- 3 => '700italic',
1145
- ),
1146
- 'Coustard' =>
1147
- array(
1148
- 0 => 'regular',
1149
- 1 => '900',
1150
- ),
1151
- 'Covered By Your Grace' =>
1152
- array(
1153
- 0 => 'regular',
1154
- ),
1155
- 'Crafty Girls' =>
1156
- array(
1157
- 0 => 'regular',
1158
- ),
1159
- 'Creepster' =>
1160
- array(
1161
- 0 => 'regular',
1162
- ),
1163
- 'Crete Round' =>
1164
- array(
1165
- 0 => 'regular',
1166
- 1 => 'italic',
1167
- ),
1168
- 'Crimson Text' =>
1169
- array(
1170
- 0 => 'regular',
1171
- 1 => 'italic',
1172
- 2 => '600',
1173
- 3 => '600italic',
1174
- 4 => '700',
1175
- 5 => '700italic',
1176
- ),
1177
- 'Croissant One' =>
1178
- array(
1179
- 0 => 'regular',
1180
- ),
1181
- 'Crushed' =>
1182
- array(
1183
- 0 => 'regular',
1184
- ),
1185
- 'Cuprum' =>
1186
- array(
1187
- 0 => 'regular',
1188
- 1 => 'italic',
1189
- 2 => '700',
1190
- 3 => '700italic',
1191
- ),
1192
- 'Cutive' =>
1193
- array(
1194
- 0 => 'regular',
1195
- ),
1196
- 'Cutive Mono' =>
1197
- array(
1198
- 0 => 'regular',
1199
- ),
1200
- 'Damion' =>
1201
- array(
1202
- 0 => 'regular',
1203
- ),
1204
- 'Dancing Script' =>
1205
- array(
1206
- 0 => 'regular',
1207
- 1 => '700',
1208
- ),
1209
- 'Dangrek' =>
1210
- array(
1211
- 0 => 'regular',
1212
- ),
1213
- 'David Libre' =>
1214
- array(
1215
- 0 => 'regular',
1216
- 1 => '500',
1217
- 2 => '700',
1218
- ),
1219
- 'Dawning of a New Day' =>
1220
- array(
1221
- 0 => 'regular',
1222
- ),
1223
- 'Days One' =>
1224
- array(
1225
- 0 => 'regular',
1226
- ),
1227
- 'Dekko' =>
1228
- array(
1229
- 0 => 'regular',
1230
- ),
1231
- 'Delius' =>
1232
- array(
1233
- 0 => 'regular',
1234
- ),
1235
- 'Delius Swash Caps' =>
1236
- array(
1237
- 0 => 'regular',
1238
- ),
1239
- 'Delius Unicase' =>
1240
- array(
1241
- 0 => 'regular',
1242
- 1 => '700',
1243
- ),
1244
- 'Della Respira' =>
1245
- array(
1246
- 0 => 'regular',
1247
- ),
1248
- 'Denk One' =>
1249
- array(
1250
- 0 => 'regular',
1251
- ),
1252
- 'Devonshire' =>
1253
- array(
1254
- 0 => 'regular',
1255
- ),
1256
- 'Dhurjati' =>
1257
- array(
1258
- 0 => 'regular',
1259
- ),
1260
- 'Didact Gothic' =>
1261
- array(
1262
- 0 => 'regular',
1263
- ),
1264
- 'Diplomata' =>
1265
- array(
1266
- 0 => 'regular',
1267
- ),
1268
- 'Diplomata SC' =>
1269
- array(
1270
- 0 => 'regular',
1271
- ),
1272
- 'Domine' =>
1273
- array(
1274
- 0 => 'regular',
1275
- 1 => '700',
1276
- ),
1277
- 'Donegal One' =>
1278
- array(
1279
- 0 => 'regular',
1280
- ),
1281
- 'Doppio One' =>
1282
- array(
1283
- 0 => 'regular',
1284
- ),
1285
- 'Dorsa' =>
1286
- array(
1287
- 0 => 'regular',
1288
- ),
1289
- 'Dosis' =>
1290
- array(
1291
- 0 => '200',
1292
- 1 => '300',
1293
- 2 => 'regular',
1294
- 3 => '500',
1295
- 4 => '600',
1296
- 5 => '700',
1297
- 6 => '800',
1298
- ),
1299
- 'Dr Sugiyama' =>
1300
- array(
1301
- 0 => 'regular',
1302
- ),
1303
- 'Duru Sans' =>
1304
- array(
1305
- 0 => 'regular',
1306
- ),
1307
- 'Dynalight' =>
1308
- array(
1309
- 0 => 'regular',
1310
- ),
1311
- 'EB Garamond' =>
1312
- array(
1313
- 0 => 'regular',
1314
- 1 => 'italic',
1315
- 2 => '500',
1316
- 3 => '500italic',
1317
- 4 => '600',
1318
- 5 => '600italic',
1319
- 6 => '700',
1320
- 7 => '700italic',
1321
- 8 => '800',
1322
- 9 => '800italic',
1323
- ),
1324
- 'Eagle Lake' =>
1325
- array(
1326
- 0 => 'regular',
1327
- ),
1328
- 'Eater' =>
1329
- array(
1330
- 0 => 'regular',
1331
- ),
1332
- 'Economica' =>
1333
- array(
1334
- 0 => 'regular',
1335
- 1 => 'italic',
1336
- 2 => '700',
1337
- 3 => '700italic',
1338
- ),
1339
- 'Eczar' =>
1340
- array(
1341
- 0 => 'regular',
1342
- 1 => '500',
1343
- 2 => '600',
1344
- 3 => '700',
1345
- 4 => '800',
1346
- ),
1347
- 'El Messiri' =>
1348
- array(
1349
- 0 => 'regular',
1350
- 1 => '500',
1351
- 2 => '600',
1352
- 3 => '700',
1353
- ),
1354
- 'Electrolize' =>
1355
- array(
1356
- 0 => 'regular',
1357
- ),
1358
- 'Elsie' =>
1359
- array(
1360
- 0 => 'regular',
1361
- 1 => '900',
1362
- ),
1363
- 'Elsie Swash Caps' =>
1364
- array(
1365
- 0 => 'regular',
1366
- 1 => '900',
1367
- ),
1368
- 'Emblema One' =>
1369
- array(
1370
- 0 => 'regular',
1371
- ),
1372
- 'Emilys Candy' =>
1373
- array(
1374
- 0 => 'regular',
1375
- ),
1376
- 'Encode Sans' =>
1377
- array(
1378
- 0 => '100',
1379
- 1 => '200',
1380
- 2 => '300',
1381
- 3 => 'regular',
1382
- 4 => '500',
1383
- 5 => '600',
1384
- 6 => '700',
1385
- 7 => '800',
1386
- 8 => '900',
1387
- ),
1388
- 'Encode Sans Condensed' =>
1389
- array(
1390
- 0 => '100',
1391
- 1 => '200',
1392
- 2 => '300',
1393
- 3 => 'regular',
1394
- 4 => '500',
1395
- 5 => '600',
1396
- 6 => '700',
1397
- 7 => '800',
1398
- 8 => '900',
1399
- ),
1400
- 'Encode Sans Expanded' =>
1401
- array(
1402
- 0 => '100',
1403
- 1 => '200',
1404
- 2 => '300',
1405
- 3 => 'regular',
1406
- 4 => '500',
1407
- 5 => '600',
1408
- 6 => '700',
1409
- 7 => '800',
1410
- 8 => '900',
1411
- ),
1412
- 'Encode Sans Semi Condensed' =>
1413
- array(
1414
- 0 => '100',
1415
- 1 => '200',
1416
- 2 => '300',
1417
- 3 => 'regular',
1418
- 4 => '500',
1419
- 5 => '600',
1420
- 6 => '700',
1421
- 7 => '800',
1422
- 8 => '900',
1423
- ),
1424
- 'Encode Sans Semi Expanded' =>
1425
- array(
1426
- 0 => '100',
1427
- 1 => '200',
1428
- 2 => '300',
1429
- 3 => 'regular',
1430
- 4 => '500',
1431
- 5 => '600',
1432
- 6 => '700',
1433
- 7 => '800',
1434
- 8 => '900',
1435
- ),
1436
- 'Engagement' =>
1437
- array(
1438
- 0 => 'regular',
1439
- ),
1440
- 'Englebert' =>
1441
- array(
1442
- 0 => 'regular',
1443
- ),
1444
- 'Enriqueta' =>
1445
- array(
1446
- 0 => 'regular',
1447
- 1 => '700',
1448
- ),
1449
- 'Erica One' =>
1450
- array(
1451
- 0 => 'regular',
1452
- ),
1453
- 'Esteban' =>
1454
- array(
1455
- 0 => 'regular',
1456
- ),
1457
- 'Euphoria Script' =>
1458
- array(
1459
- 0 => 'regular',
1460
- ),
1461
- 'Ewert' =>
1462
- array(
1463
- 0 => 'regular',
1464
- ),
1465
- 'Exo' =>
1466
- array(
1467
- 0 => '100',
1468
- 1 => '100italic',
1469
- 2 => '200',
1470
- 3 => '200italic',
1471
- 4 => '300',
1472
- 5 => '300italic',
1473
- 6 => 'regular',
1474
- 7 => 'italic',
1475
- 8 => '500',
1476
- 9 => '500italic',
1477
- 10 => '600',
1478
- 11 => '600italic',
1479
- 12 => '700',
1480
- 13 => '700italic',
1481
- 14 => '800',
1482
- 15 => '800italic',
1483
- 16 => '900',
1484
- 17 => '900italic',
1485
- ),
1486
- 'Exo 2' =>
1487
- array(
1488
- 0 => '100',
1489
- 1 => '100italic',
1490
- 2 => '200',
1491
- 3 => '200italic',
1492
- 4 => '300',
1493
- 5 => '300italic',
1494
- 6 => 'regular',
1495
- 7 => 'italic',
1496
- 8 => '500',
1497
- 9 => '500italic',
1498
- 10 => '600',
1499
- 11 => '600italic',
1500
- 12 => '700',
1501
- 13 => '700italic',
1502
- 14 => '800',
1503
- 15 => '800italic',
1504
- 16 => '900',
1505
- 17 => '900italic',
1506
- ),
1507
- 'Expletus Sans' =>
1508
- array(
1509
- 0 => 'regular',
1510
- 1 => 'italic',
1511
- 2 => '500',
1512
- 3 => '500italic',
1513
- 4 => '600',
1514
- 5 => '600italic',
1515
- 6 => '700',
1516
- 7 => '700italic',
1517
- ),
1518
- 'Fanwood Text' =>
1519
- array(
1520
- 0 => 'regular',
1521
- 1 => 'italic',
1522
- ),
1523
- 'Farsan' =>
1524
- array(
1525
- 0 => 'regular',
1526
- ),
1527
- 'Fascinate' =>
1528
- array(
1529
- 0 => 'regular',
1530
- ),
1531
- 'Fascinate Inline' =>
1532
- array(
1533
- 0 => 'regular',
1534
- ),
1535
- 'Faster One' =>
1536
- array(
1537
- 0 => 'regular',
1538
- ),
1539
- 'Fasthand' =>
1540
- array(
1541
- 0 => 'regular',
1542
- ),
1543
- 'Fauna One' =>
1544
- array(
1545
- 0 => 'regular',
1546
- ),
1547
- 'Faustina' =>
1548
- array(
1549
- 0 => 'regular',
1550
- 1 => 'italic',
1551
- 2 => '500',
1552
- 3 => '500italic',
1553
- 4 => '600',
1554
- 5 => '600italic',
1555
- 6 => '700',
1556
- 7 => '700italic',
1557
- ),
1558
- 'Federant' =>
1559
- array(
1560
- 0 => 'regular',
1561
- ),
1562
- 'Federo' =>
1563
- array(
1564
- 0 => 'regular',
1565
- ),
1566
- 'Felipa' =>
1567
- array(
1568
- 0 => 'regular',
1569
- ),
1570
- 'Fenix' =>
1571
- array(
1572
- 0 => 'regular',
1573
- ),
1574
- 'Finger Paint' =>
1575
- array(
1576
- 0 => 'regular',
1577
- ),
1578
- 'Fira Mono' =>
1579
- array(
1580
- 0 => 'regular',
1581
- 1 => '500',
1582
- 2 => '700',
1583
- ),
1584
- 'Fira Sans' =>
1585
- array(
1586
- 0 => '100',
1587
- 1 => '100italic',
1588
- 2 => '200',
1589
- 3 => '200italic',
1590
- 4 => '300',
1591
- 5 => '300italic',
1592
- 6 => 'regular',
1593
- 7 => 'italic',
1594
- 8 => '500',
1595
- 9 => '500italic',
1596
- 10 => '600',
1597
- 11 => '600italic',
1598
- 12 => '700',
1599
- 13 => '700italic',
1600
- 14 => '800',
1601
- 15 => '800italic',
1602
- 16 => '900',
1603
- 17 => '900italic',
1604
- ),
1605
- 'Fira Sans Condensed' =>
1606
- array(
1607
- 0 => '100',
1608
- 1 => '100italic',
1609
- 2 => '200',
1610
- 3 => '200italic',
1611
- 4 => '300',
1612
- 5 => '300italic',
1613
- 6 => 'regular',
1614
- 7 => 'italic',
1615
- 8 => '500',
1616
- 9 => '500italic',
1617
- 10 => '600',
1618
- 11 => '600italic',
1619
- 12 => '700',
1620
- 13 => '700italic',
1621
- 14 => '800',
1622
- 15 => '800italic',
1623
- 16 => '900',
1624
- 17 => '900italic',
1625
- ),
1626
- 'Fira Sans Extra Condensed' =>
1627
- array(
1628
- 0 => '100',
1629
- 1 => '100italic',
1630
- 2 => '200',
1631
- 3 => '200italic',
1632
- 4 => '300',
1633
- 5 => '300italic',
1634
- 6 => 'regular',
1635
- 7 => 'italic',
1636
- 8 => '500',
1637
- 9 => '500italic',
1638
- 10 => '600',
1639
- 11 => '600italic',
1640
- 12 => '700',
1641
- 13 => '700italic',
1642
- 14 => '800',
1643
- 15 => '800italic',
1644
- 16 => '900',
1645
- 17 => '900italic',
1646
- ),
1647
- 'Fjalla One' =>
1648
- array(
1649
- 0 => 'regular',
1650
- ),
1651
- 'Fjord One' =>
1652
- array(
1653
- 0 => 'regular',
1654
- ),
1655
- 'Flamenco' =>
1656
- array(
1657
- 0 => '300',
1658
- 1 => 'regular',
1659
- ),
1660
- 'Flavors' =>
1661
- array(
1662
- 0 => 'regular',
1663
- ),
1664
- 'Fondamento' =>
1665
- array(
1666
- 0 => 'regular',
1667
- 1 => 'italic',
1668
- ),
1669
- 'Fontdiner Swanky' =>
1670
- array(
1671
- 0 => 'regular',
1672
- ),
1673
- 'Forum' =>
1674
- array(
1675
- 0 => 'regular',
1676
- ),
1677
- 'Francois One' =>
1678
- array(
1679
- 0 => 'regular',
1680
- ),
1681
- 'Frank Ruhl Libre' =>
1682
- array(
1683
- 0 => '300',
1684
- 1 => 'regular',
1685
- 2 => '500',
1686
- 3 => '700',
1687
- 4 => '900',
1688
- ),
1689
- 'Freckle Face' =>
1690
- array(
1691
- 0 => 'regular',
1692
- ),
1693
- 'Fredericka the Great' =>
1694
- array(
1695
- 0 => 'regular',
1696
- ),
1697
- 'Fredoka One' =>
1698
- array(
1699
- 0 => 'regular',
1700
- ),
1701
- 'Freehand' =>
1702
- array(
1703
- 0 => 'regular',
1704
- ),
1705
- 'Fresca' =>
1706
- array(
1707
- 0 => 'regular',
1708
- ),
1709
- 'Frijole' =>
1710
- array(
1711
- 0 => 'regular',
1712
- ),
1713
- 'Fruktur' =>
1714
- array(
1715
- 0 => 'regular',
1716
- ),
1717
- 'Fugaz One' =>
1718
- array(
1719
- 0 => 'regular',
1720
- ),
1721
- 'GFS Didot' =>
1722
- array(
1723
- 0 => 'regular',
1724
- ),
1725
- 'GFS Neohellenic' =>
1726
- array(
1727
- 0 => 'regular',
1728
- 1 => 'italic',
1729
- 2 => '700',
1730
- 3 => '700italic',
1731
- ),
1732
- 'Gabriela' =>
1733
- array(
1734
- 0 => 'regular',
1735
- ),
1736
- 'Gafata' =>
1737
- array(
1738
- 0 => 'regular',
1739
- ),
1740
- 'Galada' =>
1741
- array(
1742
- 0 => 'regular',
1743
- ),
1744
- 'Galdeano' =>
1745
- array(
1746
- 0 => 'regular',
1747
- ),
1748
- 'Galindo' =>
1749
- array(
1750
- 0 => 'regular',
1751
- ),
1752
- 'Gentium Basic' =>
1753
- array(
1754
- 0 => 'regular',
1755
- 1 => 'italic',
1756
- 2 => '700',
1757
- 3 => '700italic',
1758
- ),
1759
- 'Gentium Book Basic' =>
1760
- array(
1761
- 0 => 'regular',
1762
- 1 => 'italic',
1763
- 2 => '700',
1764
- 3 => '700italic',
1765
- ),
1766
- 'Geo' =>
1767
- array(
1768
- 0 => 'regular',
1769
- 1 => 'italic',
1770
- ),
1771
- 'Geostar' =>
1772
- array(
1773
- 0 => 'regular',
1774
- ),
1775
- 'Geostar Fill' =>
1776
- array(
1777
- 0 => 'regular',
1778
- ),
1779
- 'Germania One' =>
1780
- array(
1781
- 0 => 'regular',
1782
- ),
1783
- 'Gidugu' =>
1784
- array(
1785
- 0 => 'regular',
1786
- ),
1787
- 'Gilda Display' =>
1788
- array(
1789
- 0 => 'regular',
1790
- ),
1791
- 'Give You Glory' =>
1792
- array(
1793
- 0 => 'regular',
1794
- ),
1795
- 'Glass Antiqua' =>
1796
- array(
1797
- 0 => 'regular',
1798
- ),
1799
- 'Glegoo' =>
1800
- array(
1801
- 0 => 'regular',
1802
- 1 => '700',
1803
- ),
1804
- 'Gloria Hallelujah' =>
1805
- array(
1806
- 0 => 'regular',
1807
- ),
1808
- 'Goblin One' =>
1809
- array(
1810
- 0 => 'regular',
1811
- ),
1812
- 'Gochi Hand' =>
1813
- array(
1814
- 0 => 'regular',
1815
- ),
1816
- 'Gorditas' =>
1817
- array(
1818
- 0 => 'regular',
1819
- 1 => '700',
1820
- ),
1821
- 'Goudy Bookletter 1911' =>
1822
- array(
1823
- 0 => 'regular',
1824
- ),
1825
- 'Graduate' =>
1826
- array(
1827
- 0 => 'regular',
1828
- ),
1829
- 'Grand Hotel' =>
1830
- array(
1831
- 0 => 'regular',
1832
- ),
1833
- 'Gravitas One' =>
1834
- array(
1835
- 0 => 'regular',
1836
- ),
1837
- 'Great Vibes' =>
1838
- array(
1839
- 0 => 'regular',
1840
- ),
1841
- 'Griffy' =>
1842
- array(
1843
- 0 => 'regular',
1844
- ),
1845
- 'Gruppo' =>
1846
- array(
1847
- 0 => 'regular',
1848
- ),
1849
- 'Gudea' =>
1850
- array(
1851
- 0 => 'regular',
1852
- 1 => 'italic',
1853
- 2 => '700',
1854
- ),
1855
- 'Gurajada' =>
1856
- array(
1857
- 0 => 'regular',
1858
- ),
1859
- 'Habibi' =>
1860
- array(
1861
- 0 => 'regular',
1862
- ),
1863
- 'Halant' =>
1864
- array(
1865
- 0 => '300',
1866
- 1 => 'regular',
1867
- 2 => '500',
1868
- 3 => '600',
1869
- 4 => '700',
1870
- ),
1871
- 'Hammersmith One' =>
1872
- array(
1873
- 0 => 'regular',
1874
- ),
1875
- 'Hanalei' =>
1876
- array(
1877
- 0 => 'regular',
1878
- ),
1879
- 'Hanalei Fill' =>
1880
- array(
1881
- 0 => 'regular',
1882
- ),
1883
- 'Handlee' =>
1884
- array(
1885
- 0 => 'regular',
1886
- ),
1887
- 'Hanuman' =>
1888
- array(
1889
- 0 => 'regular',
1890
- 1 => '700',
1891
- ),
1892
- 'Happy Monkey' =>
1893
- array(
1894
- 0 => 'regular',
1895
- ),
1896
- 'Harmattan' =>
1897
- array(
1898
- 0 => 'regular',
1899
- ),
1900
- 'Headland One' =>
1901
- array(
1902
- 0 => 'regular',
1903
- ),
1904
- 'Heebo' =>
1905
- array(
1906
- 0 => '100',
1907
- 1 => '300',
1908
- 2 => 'regular',
1909
- 3 => '500',
1910
- 4 => '700',
1911
- 5 => '800',
1912
- 6 => '900',
1913
- ),
1914
- 'Henny Penny' =>
1915
- array(
1916
- 0 => 'regular',
1917
- ),
1918
- 'Herr Von Muellerhoff' =>
1919
- array(
1920
- 0 => 'regular',
1921
- ),
1922
- 'Hind' =>
1923
- array(
1924
- 0 => '300',
1925
- 1 => 'regular',
1926
- 2 => '500',
1927
- 3 => '600',
1928
- 4 => '700',
1929
- ),
1930
- 'Hind Guntur' =>
1931
- array(
1932
- 0 => '300',
1933
- 1 => 'regular',
1934
- 2 => '500',
1935
- 3 => '600',
1936
- 4 => '700',
1937
- ),
1938
- 'Hind Madurai' =>
1939
- array(
1940
- 0 => '300',
1941
- 1 => 'regular',
1942
- 2 => '500',
1943
- 3 => '600',
1944
- 4 => '700',
1945
- ),
1946
- 'Hind Siliguri' =>
1947
- array(
1948
- 0 => '300',
1949
- 1 => 'regular',
1950
- 2 => '500',
1951
- 3 => '600',
1952
- 4 => '700',
1953
- ),
1954
- 'Hind Vadodara' =>
1955
- array(
1956
- 0 => '300',
1957
- 1 => 'regular',
1958
- 2 => '500',
1959
- 3 => '600',
1960
- 4 => '700',
1961
- ),
1962
- 'Holtwood One SC' =>
1963
- array(
1964
- 0 => 'regular',
1965
- ),
1966
- 'Homemade Apple' =>
1967
- array(
1968
- 0 => 'regular',
1969
- ),
1970
- 'Homenaje' =>
1971
- array(
1972
- 0 => 'regular',
1973
- ),
1974
- 'IBM Plex Mono' =>
1975
- array(
1976
- 0 => '100',
1977
- 1 => '100italic',
1978
- 2 => '200',
1979
- 3 => '200italic',
1980
- 4 => '300',
1981
- 5 => '300italic',
1982
- 6 => 'regular',
1983
- 7 => 'italic',
1984
- 8 => '500',
1985
- 9 => '500italic',
1986
- 10 => '600',
1987
- 11 => '600italic',
1988
- 12 => '700',
1989
- 13 => '700italic',
1990
- ),
1991
- 'IBM Plex Sans' =>
1992
- array(
1993
- 0 => '100',
1994
- 1 => '100italic',
1995
- 2 => '200',
1996
- 3 => '200italic',
1997
- 4 => '300',
1998
- 5 => '300italic',
1999
- 6 => 'regular',
2000
- 7 => 'italic',
2001
- 8 => '500',
2002
- 9 => '500italic',
2003
- 10 => '600',
2004
- 11 => '600italic',
2005
- 12 => '700',
2006
- 13 => '700italic',
2007
- ),
2008
- 'IBM Plex Sans Condensed' =>
2009
- array(
2010
- 0 => '100',
2011
- 1 => '100italic',
2012
- 2 => '200',
2013
- 3 => '200italic',
2014
- 4 => '300',
2015
- 5 => '300italic',
2016
- 6 => 'regular',
2017
- 7 => 'italic',
2018
- 8 => '500',
2019
- 9 => '500italic',
2020
- 10 => '600',
2021
- 11 => '600italic',
2022
- 12 => '700',
2023
- 13 => '700italic',
2024
- ),
2025
- 'IBM Plex Serif' =>
2026
- array(
2027
- 0 => '100',
2028
- 1 => '100italic',
2029
- 2 => '200',
2030
- 3 => '200italic',
2031
- 4 => '300',
2032
- 5 => '300italic',
2033
- 6 => 'regular',
2034
- 7 => 'italic',
2035
- 8 => '500',
2036
- 9 => '500italic',
2037
- 10 => '600',
2038
- 11 => '600italic',
2039
- 12 => '700italic',
2040
- ),
2041
- 'IM Fell DW Pica' =>
2042
- array(
2043
- 0 => 'regular',
2044
- 1 => 'italic',
2045
- ),
2046
- 'IM Fell DW Pica SC' =>
2047
- array(
2048
- 0 => 'regular',
2049
- ),
2050
- 'IM Fell Double Pica' =>
2051
- array(
2052
- 0 => 'regular',
2053
- 1 => 'italic',
2054
- ),
2055
- 'IM Fell Double Pica SC' =>
2056
- array(
2057
- 0 => 'regular',
2058
- ),
2059
- 'IM Fell English' =>
2060
- array(
2061
- 0 => 'regular',
2062
- 1 => 'italic',
2063
- ),
2064
- 'IM Fell English SC' =>
2065
- array(
2066
- 0 => 'regular',
2067
- ),
2068
- 'IM Fell French Canon' =>
2069
- array(
2070
- 0 => 'regular',
2071
- 1 => 'italic',
2072
- ),
2073
- 'IM Fell French Canon SC' =>
2074
- array(
2075
- 0 => 'regular',
2076
- ),
2077
- 'IM Fell Great Primer' =>
2078
- array(
2079
- 0 => 'regular',
2080
- 1 => 'italic',
2081
- ),
2082
- 'IM Fell Great Primer SC' =>
2083
- array(
2084
- 0 => 'regular',
2085
- ),
2086
- 'Iceberg' =>
2087
- array(
2088
- 0 => 'regular',
2089
- ),
2090
- 'Iceland' =>
2091
- array(
2092
- 0 => 'regular',
2093
- ),
2094
- 'Imprima' =>
2095
- array(
2096
- 0 => 'regular',
2097
- ),
2098
- 'Inconsolata' =>
2099
- array(
2100
- 0 => 'regular',
2101
- 1 => '700',
2102
- ),
2103
- 'Inder' =>
2104
- array(
2105
- 0 => 'regular',
2106
- ),
2107
- 'Indie Flower' =>
2108
- array(
2109
- 0 => 'regular',
2110
- ),
2111
- 'Inika' =>
2112
- array(
2113
- 0 => 'regular',
2114
- 1 => '700',
2115
- ),
2116
- 'Inknut Antiqua' =>
2117
- array(
2118
- 0 => '300',
2119
- 1 => 'regular',
2120
- 2 => '500',
2121
- 3 => '600',
2122
- 4 => '700',
2123
- 5 => '800',
2124
- 6 => '900',
2125
- ),
2126
- 'Irish Grover' =>
2127
- array(
2128
- 0 => 'regular',
2129
- ),
2130
- 'Istok Web' =>
2131
- array(
2132
- 0 => 'regular',
2133
- 1 => 'italic',
2134
- 2 => '700',
2135
- 3 => '700italic',
2136
- ),
2137
- 'Italiana' =>
2138
- array(
2139
- 0 => 'regular',
2140
- ),
2141
- 'Italianno' =>
2142
- array(
2143
- 0 => 'regular',
2144
- ),
2145
- 'Itim' =>
2146
- array(
2147
- 0 => 'regular',
2148
- ),
2149
- 'Jacques Francois' =>
2150
- array(
2151
- 0 => 'regular',
2152
- ),
2153
- 'Jacques Francois Shadow' =>
2154
- array(
2155
- 0 => 'regular',
2156
- ),
2157
- 'Jaldi' =>
2158
- array(
2159
- 0 => 'regular',
2160
- 1 => '700',
2161
- ),
2162
- 'Jim Nightshade' =>
2163
- array(
2164
- 0 => 'regular',
2165
- ),
2166
- 'Jockey One' =>
2167
- array(
2168
- 0 => 'regular',
2169
- ),
2170
- 'Jolly Lodger' =>
2171
- array(
2172
- 0 => 'regular',
2173
- ),
2174
- 'Jomhuria' =>
2175
- array(
2176
- 0 => 'regular',
2177
- ),
2178
- 'Josefin Sans' =>
2179
- array(
2180
- 0 => '100',
2181
- 1 => '100italic',
2182
- 2 => '300',
2183
- 3 => '300italic',
2184
- 4 => 'regular',
2185
- 5 => 'italic',
2186
- 6 => '600',
2187
- 7 => '600italic',
2188
- 8 => '700',
2189
- 9 => '700italic',
2190
- ),
2191
- 'Josefin Slab' =>
2192
- array(
2193
- 0 => '100',
2194
- 1 => '100italic',
2195
- 2 => '300',
2196
- 3 => '300italic',
2197
- 4 => 'regular',
2198
- 5 => 'italic',
2199
- 6 => '600',
2200
- 7 => '600italic',
2201
- 8 => '700',
2202
- 9 => '700italic',
2203
- ),
2204
- 'Joti One' =>
2205
- array(
2206
- 0 => 'regular',
2207
- ),
2208
- 'Judson' =>
2209
- array(
2210
- 0 => 'regular',
2211
- 1 => 'italic',
2212
- 2 => '700',
2213
- ),
2214
- 'Julee' =>
2215
- array(
2216
- 0 => 'regular',
2217
- ),
2218
- 'Julius Sans One' =>
2219
- array(
2220
- 0 => 'regular',
2221
- ),
2222
- 'Junge' =>
2223
- array(
2224
- 0 => 'regular',
2225
- ),
2226
- 'Jura' =>
2227
- array(
2228
- 0 => '300',
2229
- 1 => 'regular',
2230
- 2 => '500',
2231
- 3 => '600',
2232
- 4 => '700',
2233
- ),
2234
- 'Just Another Hand' =>
2235
- array(
2236
- 0 => 'regular',
2237
- ),
2238
- 'Just Me Again Down Here' =>
2239
- array(
2240
- 0 => 'regular',
2241
- ),
2242
- 'Kadwa' =>
2243
- array(
2244
- 0 => 'regular',
2245
- 1 => '700',
2246
- ),
2247
- 'Kalam' =>
2248
- array(
2249
- 0 => '300',
2250
- 1 => 'regular',
2251
- 2 => '700',
2252
- ),
2253
- 'Kameron' =>
2254
- array(
2255
- 0 => 'regular',
2256
- 1 => '700',
2257
- ),
2258
- 'Kanit' =>
2259
- array(
2260
- 0 => '100',
2261
- 1 => '100italic',
2262
- 2 => '200',
2263
- 3 => '200italic',
2264
- 4 => '300',
2265
- 5 => '300italic',
2266
- 6 => 'regular',
2267
- 7 => 'italic',
2268
- 8 => '500',
2269
- 9 => '500italic',
2270
- 10 => '600',
2271
- 11 => '600italic',
2272
- 12 => '700',
2273
- 13 => '700italic',
2274
- 14 => '800',
2275
- 15 => '800italic',
2276
- 16 => '900',
2277
- 17 => '900italic',
2278
- ),
2279
- 'Kantumruy' =>
2280
- array(
2281
- 0 => '300',
2282
- 1 => 'regular',
2283
- 2 => '700',
2284
- ),
2285
- 'Karla' =>
2286
- array(
2287
- 0 => 'regular',
2288
- 1 => 'italic',
2289
- 2 => '700',
2290
- 3 => '700italic',
2291
- ),
2292
- 'Karma' =>
2293
- array(
2294
- 0 => '300',
2295
- 1 => 'regular',
2296
- 2 => '500',
2297
- 3 => '600',
2298
- 4 => '700',
2299
- ),
2300
- 'Katibeh' =>
2301
- array(
2302
- 0 => 'regular',
2303
- ),
2304
- 'Kaushan Script' =>
2305
- array(
2306
- 0 => 'regular',
2307
- ),
2308
- 'Kavivanar' =>
2309
- array(
2310
- 0 => 'regular',
2311
- ),
2312
- 'Kavoon' =>
2313
- array(
2314
- 0 => 'regular',
2315
- ),
2316
- 'Kdam Thmor' =>
2317
- array(
2318
- 0 => 'regular',
2319
- ),
2320
- 'Keania One' =>
2321
- array(
2322
- 0 => 'regular',
2323
- ),
2324
- 'Kelly Slab' =>
2325
- array(
2326
- 0 => 'regular',
2327
- ),
2328
- 'Kenia' =>
2329
- array(
2330
- 0 => 'regular',
2331
- ),
2332
- 'Khand' =>
2333
- array(
2334
- 0 => '300',
2335
- 1 => 'regular',
2336
- 2 => '500',
2337
- 3 => '600',
2338
- 4 => '700',
2339
- ),
2340
- 'Khmer' =>
2341
- array(
2342
- 0 => 'regular',
2343
- ),
2344
- 'Khula' =>
2345
- array(
2346
- 0 => '300',
2347
- 1 => 'regular',
2348
- 2 => '600',
2349
- 3 => '700',
2350
- 4 => '800',
2351
- ),
2352
- 'Kite One' =>
2353
- array(
2354
- 0 => 'regular',
2355
- ),
2356
- 'Knewave' =>
2357
- array(
2358
- 0 => 'regular',
2359
- ),
2360
- 'Kotta One' =>
2361
- array(
2362
- 0 => 'regular',
2363
- ),
2364
- 'Koulen' =>
2365
- array(
2366
- 0 => 'regular',
2367
- ),
2368
- 'Kranky' =>
2369
- array(
2370
- 0 => 'regular',
2371
- ),
2372
- 'Kreon' =>
2373
- array(
2374
- 0 => '300',
2375
- 1 => 'regular',
2376
- 2 => '700',
2377
- ),
2378
- 'Kristi' =>
2379
- array(
2380
- 0 => 'regular',
2381
- ),
2382
- 'Krona One' =>
2383
- array(
2384
- 0 => 'regular',
2385
- ),
2386
- 'Kumar One' =>
2387
- array(
2388
- 0 => 'regular',
2389
- ),
2390
- 'Kumar One Outline' =>
2391
- array(
2392
- 0 => 'regular',
2393
- ),
2394
- 'Kurale' =>
2395
- array(
2396
- 0 => 'regular',
2397
- ),
2398
- 'La Belle Aurore' =>
2399
- array(
2400
- 0 => 'regular',
2401
- ),
2402
- 'Laila' =>
2403
- array(
2404
- 0 => '300',
2405
- 1 => 'regular',
2406
- 2 => '500',
2407
- 3 => '600',
2408
- 4 => '700',
2409
- ),
2410
- 'Lakki Reddy' =>
2411
- array(
2412
- 0 => 'regular',
2413
- ),
2414
- 'Lalezar' =>
2415
- array(
2416
- 0 => 'regular',
2417
- ),
2418
- 'Lancelot' =>
2419
- array(
2420
- 0 => 'regular',
2421
- ),
2422
- 'Lateef' =>
2423
- array(
2424
- 0 => 'regular',
2425
- ),
2426
- 'Lato' =>
2427
- array(
2428
- 0 => '100',
2429
- 1 => '100italic',
2430
- 2 => '300',
2431
- 3 => '300italic',
2432
- 4 => 'regular',
2433
- 5 => 'italic',
2434
- 6 => '700',
2435
- 7 => '700italic',
2436
- 8 => '900',
2437
- 9 => '900italic',
2438
- ),
2439
- 'League Script' =>
2440
- array(
2441
- 0 => 'regular',
2442
- ),
2443
- 'Leckerli One' =>
2444
- array(
2445
- 0 => 'regular',
2446
- ),
2447
- 'Ledger' =>
2448
- array(
2449
- 0 => 'regular',
2450
- ),
2451
- 'Lekton' =>
2452
- array(
2453
- 0 => 'regular',
2454
- 1 => 'italic',
2455
- 2 => '700',
2456
- ),
2457
- 'Lemon' =>
2458
- array(
2459
- 0 => 'regular',
2460
- ),
2461
- 'Lemonada' =>
2462
- array(
2463
- 0 => '300',
2464
- 1 => 'regular',
2465
- 2 => '600',
2466
- 3 => '700',
2467
- ),
2468
- 'Libre Barcode 128' =>
2469
- array(
2470
- 0 => 'regular',
2471
- ),
2472
- 'Libre Barcode 128 Text' =>
2473
- array(
2474
- 0 => 'regular',
2475
- ),
2476
- 'Libre Barcode 39' =>
2477
- array(
2478
- 0 => 'regular',
2479
- ),
2480
- 'Libre Barcode 39 Extended' =>
2481
- array(
2482
- 0 => 'regular',
2483
- ),
2484
- 'Libre Barcode 39 Extended Text' =>
2485
- array(
2486
- 0 => 'regular',
2487
- ),
2488
- 'Libre Barcode 39 Text' =>
2489
- array(
2490
- 0 => 'regular',
2491
- ),
2492
- 'Libre Baskerville' =>
2493
- array(
2494
- 0 => 'regular',
2495
- 1 => 'italic',
2496
- 2 => '700',
2497
- ),
2498
- 'Libre Franklin' =>
2499
- array(
2500
- 0 => '100',
2501
- 1 => '100italic',
2502
- 2 => '200',
2503
- 3 => '200italic',
2504
- 4 => '300',
2505
- 5 => '300italic',
2506
- 6 => 'regular',
2507
- 7 => 'italic',
2508
- 8 => '500',
2509
- 9 => '500italic',
2510
- 10 => '600',
2511
- 11 => '600italic',
2512
- 12 => '700',
2513
- 13 => '700italic',
2514
- 14 => '800',
2515
- 15 => '800italic',
2516
- 16 => '900',
2517
- 17 => '900italic',
2518
- ),
2519
- 'Life Savers' =>
2520
- array(
2521
- 0 => 'regular',
2522
- 1 => '700',
2523
- ),
2524
- 'Lilita One' =>
2525
- array(
2526
- 0 => 'regular',
2527
- ),
2528
- 'Lily Script One' =>
2529
- array(
2530
- 0 => 'regular',
2531
- ),
2532
- 'Limelight' =>
2533
- array(
2534
- 0 => 'regular',
2535
- ),
2536
- 'Linden Hill' =>
2537
- array(
2538
- 0 => 'regular',
2539
- 1 => 'italic',
2540
- ),
2541
- 'Lobster' =>
2542
- array(
2543
- 0 => 'regular',
2544
- ),
2545
- 'Lobster Two' =>
2546
- array(
2547
- 0 => 'regular',
2548
- 1 => 'italic',
2549
- 2 => '700',
2550
- 3 => '700italic',
2551
- ),
2552
- 'Londrina Outline' =>
2553
- array(
2554
- 0 => 'regular',
2555
- ),
2556
- 'Londrina Shadow' =>
2557
- array(
2558
- 0 => 'regular',
2559
- ),
2560
- 'Londrina Sketch' =>
2561
- array(
2562
- 0 => 'regular',
2563
- ),
2564
- 'Londrina Solid' =>
2565
- array(
2566
- 0 => '100',
2567
- 1 => '300',
2568
- 2 => 'regular',
2569
- 3 => '900',
2570
- ),
2571
- 'Lora' =>
2572
- array(
2573
- 0 => 'regular',
2574
- 1 => 'italic',
2575
- 2 => '700',
2576
- 3 => '700italic',
2577
- ),
2578
- 'Love Ya Like A Sister' =>
2579
- array(
2580
- 0 => 'regular',
2581
- ),
2582
- 'Loved by the King' =>
2583
- array(
2584
- 0 => 'regular',
2585
- ),
2586
- 'Lovers Quarrel' =>
2587
- array(
2588
- 0 => 'regular',
2589
- ),
2590
- 'Luckiest Guy' =>
2591
- array(
2592
- 0 => 'regular',
2593
- ),
2594
- 'Lusitana' =>
2595
- array(
2596
- 0 => 'regular',
2597
- 1 => '700',
2598
- ),
2599
- 'Lustria' =>
2600
- array(
2601
- 0 => 'regular',
2602
- ),
2603
- 'Macondo' =>
2604
- array(
2605
- 0 => 'regular',
2606
- ),
2607
- 'Macondo Swash Caps' =>
2608
- array(
2609
- 0 => 'regular',
2610
- ),
2611
- 'Mada' =>
2612
- array(
2613
- 0 => '200',
2614
- 1 => '300',
2615
- 2 => 'regular',
2616
- 3 => '500',
2617
- 4 => '600',
2618
- 5 => '700',
2619
- 6 => '900',
2620
- ),
2621
- 'Magra' =>
2622
- array(
2623
- 0 => 'regular',
2624
- 1 => '700',
2625
- ),
2626
- 'Maiden Orange' =>
2627
- array(
2628
- 0 => 'regular',
2629
- ),
2630
- 'Maitree' =>
2631
- array(
2632
- 0 => '200',
2633
- 1 => '300',
2634
- 2 => 'regular',
2635
- 3 => '500',
2636
- 4 => '600',
2637
- 5 => '700',
2638
- ),
2639
- 'Mako' =>
2640
- array(
2641
- 0 => 'regular',
2642
- ),
2643
- 'Mallanna' =>
2644
- array(
2645
- 0 => 'regular',
2646
- ),
2647
- 'Mandali' =>
2648
- array(
2649
- 0 => 'regular',
2650
- ),
2651
- 'Manuale' =>
2652
- array(
2653
- 0 => 'regular',
2654
- 1 => 'italic',
2655
- 2 => '500',
2656
- 3 => '500italic',
2657
- 4 => '600',
2658
- 5 => '600italic',
2659
- 6 => '700',
2660
- 7 => '700italic',
2661
- ),
2662
- 'Marcellus' =>
2663
- array(
2664
- 0 => 'regular',
2665
- ),
2666
- 'Marcellus SC' =>
2667
- array(
2668
- 0 => 'regular',
2669
- ),
2670
- 'Marck Script' =>
2671
- array(
2672
- 0 => 'regular',
2673
- ),
2674
- 'Margarine' =>
2675
- array(
2676
- 0 => 'regular',
2677
- ),
2678
- 'Marko One' =>
2679
- array(
2680
- 0 => 'regular',
2681
- ),
2682
- 'Marmelad' =>
2683
- array(
2684
- 0 => 'regular',
2685
- ),
2686
- 'Martel' =>
2687
- array(
2688
- 0 => '200',
2689
- 1 => '300',
2690
- 2 => 'regular',
2691
- 3 => '600',
2692
- 4 => '700',
2693
- 5 => '800',
2694
- 6 => '900',
2695
- ),
2696
- 'Martel Sans' =>
2697
- array(
2698
- 0 => '200',
2699
- 1 => '300',
2700
- 2 => 'regular',
2701
- 3 => '600',
2702
- 4 => '700',
2703
- 5 => '800',
2704
- 6 => '900',
2705
- ),
2706
- 'Marvel' =>
2707
- array(
2708
- 0 => 'regular',
2709
- 1 => 'italic',
2710
- 2 => '700',
2711
- 3 => '700italic',
2712
- ),
2713
- 'Mate' =>
2714
- array(
2715
- 0 => 'regular',
2716
- 1 => 'italic',
2717
- ),
2718
- 'Mate SC' =>
2719
- array(
2720
- 0 => 'regular',
2721
- ),
2722
- 'Maven Pro' =>
2723
- array(
2724
- 0 => 'regular',
2725
- 1 => '500',
2726
- 2 => '700',
2727
- 3 => '900',
2728
- ),
2729
- 'McLaren' =>
2730
- array(
2731
- 0 => 'regular',
2732
- ),
2733
- 'Meddon' =>
2734
- array(
2735
- 0 => 'regular',
2736
- ),
2737
- 'MedievalSharp' =>
2738
- array(
2739
- 0 => 'regular',
2740
- ),
2741
- 'Medula One' =>
2742
- array(
2743
- 0 => 'regular',
2744
- ),
2745
- 'Meera Inimai' =>
2746
- array(
2747
- 0 => 'regular',
2748
- ),
2749
- 'Megrim' =>
2750
- array(
2751
- 0 => 'regular',
2752
- ),
2753
- 'Meie Script' =>
2754
- array(
2755
- 0 => 'regular',
2756
- ),
2757
- 'Merienda' =>
2758
- array(
2759
- 0 => 'regular',
2760
- 1 => '700',
2761
- ),
2762
- 'Merienda One' =>
2763
- array(
2764
- 0 => 'regular',
2765
- ),
2766
- 'Merriweather' =>
2767
- array(
2768
- 0 => '300',
2769
- 1 => '300italic',
2770
- 2 => 'regular',
2771
- 3 => 'italic',
2772
- 4 => '700',
2773
- 5 => '700italic',
2774
- 6 => '900',
2775
- 7 => '900italic',
2776
- ),
2777
- 'Merriweather Sans' =>
2778
- array(
2779
- 0 => '300',
2780
- 1 => '300italic',
2781
- 2 => 'regular',
2782
- 3 => 'italic',
2783
- 4 => '700',
2784
- 5 => '700italic',
2785
- 6 => '800',
2786
- 7 => '800italic',
2787
- ),
2788
- 'Metal' =>
2789
- array(
2790
- 0 => 'regular',
2791
- ),
2792
- 'Metal Mania' =>
2793
- array(
2794
- 0 => 'regular',
2795
- ),
2796
- 'Metamorphous' =>
2797
- array(
2798
- 0 => 'regular',
2799
- ),
2800
- 'Metrophobic' =>
2801
- array(
2802
- 0 => 'regular',
2803
- ),
2804
- 'Michroma' =>
2805
- array(
2806
- 0 => 'regular',
2807
- ),
2808
- 'Milonga' =>
2809
- array(
2810
- 0 => 'regular',
2811
- ),
2812
- 'Miltonian' =>
2813
- array(
2814
- 0 => 'regular',
2815
- ),
2816
- 'Miltonian Tattoo' =>
2817
- array(
2818
- 0 => 'regular',
2819
- ),
2820
- 'Mina' =>
2821
- array(
2822
- 0 => 'regular',
2823
- 1 => '700',
2824
- ),
2825
- 'Miniver' =>
2826
- array(
2827
- 0 => 'regular',
2828
- ),
2829
- 'Miriam Libre' =>
2830
- array(
2831
- 0 => 'regular',
2832
- 1 => '700',
2833
- ),
2834
- 'Mirza' =>
2835
- array(
2836
- 0 => 'regular',
2837
- 1 => '500',
2838
- 2 => '600',
2839
- 3 => '700',
2840
- ),
2841
- 'Miss Fajardose' =>
2842
- array(
2843
- 0 => 'regular',
2844
- ),
2845
- 'Mitr' =>
2846
- array(
2847
- 0 => '200',
2848
- 1 => '300',
2849
- 2 => 'regular',
2850
- 3 => '500',
2851
- 4 => '600',
2852
- 5 => '700',
2853
- ),
2854
- 'Modak' =>
2855
- array(
2856
- 0 => 'regular',
2857
- ),
2858
- 'Modern Antiqua' =>
2859
- array(
2860
- 0 => 'regular',
2861
- ),
2862
- 'Mogra' =>
2863
- array(
2864
- 0 => 'regular',
2865
- ),
2866
- 'Molengo' =>
2867
- array(
2868
- 0 => 'regular',
2869
- ),
2870
- 'Molle' =>
2871
- array(
2872
- 0 => 'italic',
2873
- ),
2874
- 'Monda' =>
2875
- array(
2876
- 0 => 'regular',
2877
- 1 => '700',
2878
- ),
2879
- 'Monofett' =>
2880
- array(
2881
- 0 => 'regular',
2882
- ),
2883
- 'Monoton' =>
2884
- array(
2885
- 0 => 'regular',
2886
- ),
2887
- 'Monsieur La Doulaise' =>
2888
- array(
2889
- 0 => 'regular',
2890
- ),
2891
- 'Montaga' =>
2892
- array(
2893
- 0 => 'regular',
2894
- ),
2895
- 'Montez' =>
2896
- array(
2897
- 0 => 'regular',
2898
- ),
2899
- 'Montserrat' =>
2900
- array(
2901
- 0 => '100',
2902
- 1 => '100italic',
2903
- 2 => '200',
2904
- 3 => '200italic',
2905
- 4 => '300',
2906
- 5 => '300italic',
2907
- 6 => 'regular',
2908
- 7 => 'italic',
2909
- 8 => '500',
2910
- 9 => '500italic',
2911
- 10 => '600',
2912
- 11 => '600italic',
2913
- 12 => '700',
2914
- 13 => '700italic',
2915
- 14 => '800',
2916
- 15 => '800italic',
2917
- 16 => '900',
2918
- 17 => '900italic',
2919
- ),
2920
- 'Montserrat Alternates' =>
2921
- array(
2922
- 0 => '100',
2923
- 1 => '100italic',
2924
- 2 => '200',
2925
- 3 => '200italic',
2926
- 4 => '300',
2927
- 5 => '300italic',
2928
- 6 => 'regular',
2929
- 7 => 'italic',
2930
- 8 => '500',
2931
- 9 => '500italic',
2932
- 10 => '600',
2933
- 11 => '600italic',
2934
- 12 => '700',
2935
- 13 => '700italic',
2936
- 14 => '800',
2937
- 15 => '800italic',
2938
- 16 => '900',
2939
- 17 => '900italic',
2940
- ),
2941
- 'Montserrat Subrayada' =>
2942
- array(
2943
- 0 => 'regular',
2944
- 1 => '700',
2945
- ),
2946
- 'Moul' =>
2947
- array(
2948
- 0 => 'regular',
2949
- ),
2950
- 'Moulpali' =>
2951
- array(
2952
- 0 => 'regular',
2953
- ),
2954
- 'Mountains of Christmas' =>
2955
- array(
2956
- 0 => 'regular',
2957
- 1 => '700',
2958
- ),
2959
- 'Mouse Memoirs' =>
2960
- array(
2961
- 0 => 'regular',
2962
- ),
2963
- 'Mr Bedfort' =>
2964
- array(
2965
- 0 => 'regular',
2966
- ),
2967
- 'Mr Dafoe' =>
2968
- array(
2969
- 0 => 'regular',
2970
- ),
2971
- 'Mr De Haviland' =>
2972
- array(
2973
- 0 => 'regular',
2974
- ),
2975
- 'Mrs Saint Delafield' =>
2976
- array(
2977
- 0 => 'regular',
2978
- ),
2979
- 'Mrs Sheppards' =>
2980
- array(
2981
- 0 => 'regular',
2982
- ),
2983
- 'Mukta' =>
2984
- array(
2985
- 0 => '200',
2986
- 1 => '300',
2987
- 2 => 'regular',
2988
- 3 => '500',
2989
- 4 => '600',
2990
- 5 => '700',
2991
- 6 => '800',
2992
- ),
2993
- 'Mukta Mahee' =>
2994
- array(
2995
- 0 => '200',
2996
- 1 => '300',
2997
- 2 => 'regular',
2998
- 3 => '500',
2999
- 4 => '600',
3000
- 5 => '700',
3001
- 6 => '800',
3002
- ),
3003
- 'Mukta Malar' =>
3004
- array(
3005
- 0 => '200',
3006
- 1 => '300',
3007
- 2 => 'regular',
3008
- 3 => '500',
3009
- 4 => '600',
3010
- 5 => '700',
3011
- 6 => '800',
3012
- ),
3013
- 'Mukta Vaani' =>
3014
- array(
3015
- 0 => '200',
3016
- 1 => '300',
3017
- 2 => 'regular',
3018
- 3 => '500',
3019
- 4 => '600',
3020
- 5 => '700',
3021
- 6 => '800',
3022
- ),
3023
- 'Muli' =>
3024
- array(
3025
- 0 => '200',
3026
- 1 => '200italic',
3027
- 2 => '300',
3028
- 3 => '300italic',
3029
- 4 => 'regular',
3030
- 5 => 'italic',
3031
- 6 => '600',
3032
- 7 => '600italic',
3033
- 8 => '700',
3034
- 9 => '700italic',
3035
- 10 => '800',
3036
- 11 => '800italic',
3037
- 12 => '900',
3038
- 13 => '900italic',
3039
- ),
3040
- 'Mystery Quest' =>
3041
- array(
3042
- 0 => 'regular',
3043
- ),
3044
- 'NTR' =>
3045
- array(
3046
- 0 => 'regular',
3047
- ),
3048
- 'Nanum Brush Script' =>
3049
- array(
3050
- 0 => 'regular',
3051
- ),
3052
- 'Nanum Gothic' =>
3053
- array(
3054
- 0 => 'regular',
3055
- 1 => '700',
3056
- 2 => '800',
3057
- ),
3058
- 'Nanum Gothic Coding' =>
3059
- array(
3060
- 0 => 'regular',
3061
- 1 => '700',
3062
- ),
3063
- 'Nanum Myeongjo' =>
3064
- array(
3065
- 0 => 'regular',
3066
- 1 => '700',
3067
- 2 => '800',
3068
- ),
3069
- 'Nanum Pen Script' =>
3070
- array(
3071
- 0 => 'regular',
3072
- ),
3073
- 'Neucha' =>
3074
- array(
3075
- 0 => 'regular',
3076
- ),
3077
- 'Neuton' =>
3078
- array(
3079
- 0 => '200',
3080
- 1 => '300',
3081
- 2 => 'regular',
3082
- 3 => 'italic',
3083
- 4 => '700',
3084
- 5 => '800',
3085
- ),
3086
- 'New Rocker' =>
3087
- array(
3088
- 0 => 'regular',
3089
- ),
3090
- 'News Cycle' =>
3091
- array(
3092
- 0 => 'regular',
3093
- 1 => '700',
3094
- ),
3095
- 'Niconne' =>
3096
- array(
3097
- 0 => 'regular',
3098
- ),
3099
- 'Nixie One' =>
3100
- array(
3101
- 0 => 'regular',
3102
- ),
3103
- 'Nobile' =>
3104
- array(
3105
- 0 => 'regular',
3106
- 1 => 'italic',
3107
- 2 => '500',
3108
- 3 => '500italic',
3109
- 4 => '700',
3110
- 5 => '700italic',
3111
- ),
3112
- 'Nokora' =>
3113
- array(
3114
- 0 => 'regular',
3115
- 1 => '700',
3116
- ),
3117
- 'Norican' =>
3118
- array(
3119
- 0 => 'regular',
3120
- ),
3121
- 'Nosifer' =>
3122
- array(
3123
- 0 => 'regular',
3124
- ),
3125
- 'Nothing You Could Do' =>
3126
- array(
3127
- 0 => 'regular',
3128
- ),
3129
- 'Noticia Text' =>
3130
- array(
3131
- 0 => 'regular',
3132
- 1 => 'italic',
3133
- 2 => '700',
3134
- 3 => '700italic',
3135
- ),
3136
- 'Noto Sans' =>
3137
- array(
3138
- 0 => 'regular',
3139
- 1 => 'italic',
3140
- 2 => '700',
3141
- 3 => '700italic',
3142
- ),
3143
- 'Noto Serif' =>
3144
- array(
3145
- 0 => 'regular',
3146
- 1 => 'italic',
3147
- 2 => '700',
3148
- 3 => '700italic',
3149
- ),
3150
- 'Nova Cut' =>
3151
- array(
3152
- 0 => 'regular',
3153
- ),
3154
- 'Nova Flat' =>
3155
- array(
3156
- 0 => 'regular',
3157
- ),
3158
- 'Nova Mono' =>
3159
- array(
3160
- 0 => 'regular',
3161
- ),
3162
- 'Nova Oval' =>
3163
- array(
3164
- 0 => 'regular',
3165
- ),
3166
- 'Nova Round' =>
3167
- array(
3168
- 0 => 'regular',
3169
- ),
3170
- 'Nova Script' =>
3171
- array(
3172
- 0 => 'regular',
3173
- ),
3174
- 'Nova Slim' =>
3175
- array(
3176
- 0 => 'regular',
3177
- ),
3178
- 'Nova Square' =>
3179
- array(
3180
- 0 => 'regular',
3181
- ),
3182
- 'Numans' =>
3183
- array(
3184
- 0 => 'regular',
3185
- ),
3186
- 'Nunito' =>
3187
- array(
3188
- 0 => '200',
3189
- 1 => '200italic',
3190
- 2 => '300',
3191
- 3 => '300italic',
3192
- 4 => 'regular',
3193
- 5 => 'italic',
3194
- 6 => '600',
3195
- 7 => '600italic',
3196
- 8 => '700',
3197
- 9 => '700italic',
3198
- 10 => '800',
3199
- 11 => '800italic',
3200
- 12 => '900',
3201
- 13 => '900italic',
3202
- ),
3203
- 'Nunito Sans' =>
3204
- array(
3205
- 0 => '200',
3206
- 1 => '200italic',
3207
- 2 => '300',
3208
- 3 => '300italic',
3209
- 4 => 'regular',
3210
- 5 => 'italic',
3211
- 6 => '600',
3212
- 7 => '600italic',
3213
- 8 => '700',
3214
- 9 => '700italic',
3215
- 10 => '800',
3216
- 11 => '800italic',
3217
- 12 => '900',
3218
- 13 => '900italic',
3219
- ),
3220
- 'Odor Mean Chey' =>
3221
- array(
3222
- 0 => 'regular',
3223
- ),
3224
- 'Offside' =>
3225
- array(
3226
- 0 => 'regular',
3227
- ),
3228
- 'Old Standard TT' =>
3229
- array(
3230
- 0 => 'regular',
3231
- 1 => 'italic',
3232
- 2 => '700',
3233
- ),
3234
- 'Oldenburg' =>
3235
- array(
3236
- 0 => 'regular',
3237
- ),
3238
- 'Oleo Script' =>
3239
- array(
3240
- 0 => 'regular',
3241
- 1 => '700',
3242
- ),
3243
- 'Oleo Script Swash Caps' =>
3244
- array(
3245
- 0 => 'regular',
3246
- 1 => '700',
3247
- ),
3248
- 'Open Sans' =>
3249
- array(
3250
- 0 => '300',
3251
- 1 => '300italic',
3252
- 2 => 'regular',
3253
- 3 => 'italic',
3254
- 4 => '600',
3255
- 5 => '600italic',
3256
- 6 => '700',
3257
- 7 => '700italic',
3258
- 8 => '800',
3259
- 9 => '800italic',
3260
- ),
3261
- 'Open Sans Condensed' =>
3262
- array(
3263
- 0 => '300',
3264
- 1 => '300italic',
3265
- 2 => '700',
3266
- ),
3267
- 'Oranienbaum' =>
3268
- array(
3269
- 0 => 'regular',
3270
- ),
3271
- 'Orbitron' =>
3272
- array(
3273
- 0 => 'regular',
3274
- 1 => '500',
3275
- 2 => '700',
3276
- 3 => '900',
3277
- ),
3278
- 'Oregano' =>
3279
- array(
3280
- 0 => 'regular',
3281
- 1 => 'italic',
3282
- ),
3283
- 'Orienta' =>
3284
- array(
3285
- 0 => 'regular',
3286
- ),
3287
- 'Original Surfer' =>
3288
- array(
3289
- 0 => 'regular',
3290
- ),
3291
- 'Oswald' =>
3292
- array(
3293
- 0 => '200',
3294
- 1 => '300',
3295
- 2 => 'regular',
3296
- 3 => '500',
3297
- 4 => '600',
3298
- 5 => '700',
3299
- ),
3300
- 'Over the Rainbow' =>
3301
- array(
3302
- 0 => 'regular',
3303
- ),
3304
- 'Overlock' =>
3305
- array(
3306
- 0 => 'regular',
3307
- 1 => 'italic',
3308
- 2 => '700',
3309
- 3 => '700italic',
3310
- 4 => '900',
3311
- 5 => '900italic',
3312
- ),
3313
- 'Overlock SC' =>
3314
- array(
3315
- 0 => 'regular',
3316
- ),
3317
- 'Overpass' =>
3318
- array(
3319
- 0 => '100',
3320
- 1 => '100italic',
3321
- 2 => '200',
3322
- 3 => '200italic',
3323
- 4 => '300',
3324
- 5 => '300italic',
3325
- 6 => 'regular',
3326
- 7 => 'italic',
3327
- 8 => '600',
3328
- 9 => '600italic',
3329
- 10 => '700',
3330
- 11 => '700italic',
3331
- 12 => '800',
3332
- 13 => '800italic',
3333
- 14 => '900',
3334
- 15 => '900italic',
3335
- ),
3336
- 'Overpass Mono' =>
3337
- array(
3338
- 0 => '300',
3339
- 1 => 'regular',
3340
- 2 => '600',
3341
- 3 => '700',
3342
- ),
3343
- 'Ovo' =>
3344
- array(
3345
- 0 => 'regular',
3346
- ),
3347
- 'Oxygen' =>
3348
- array(
3349
- 0 => '300',
3350
- 1 => 'regular',
3351
- 2 => '700',
3352
- ),
3353
- 'Oxygen Mono' =>
3354
- array(
3355
- 0 => 'regular',
3356
- ),
3357
- 'PT Mono' =>
3358
- array(
3359
- 0 => 'regular',
3360
- ),
3361
- 'PT Sans' =>
3362
- array(
3363
- 0 => 'regular',
3364
- 1 => 'italic',
3365
- 2 => '700',
3366
- 3 => '700italic',
3367
- ),
3368
- 'PT Sans Caption' =>
3369
- array(
3370
- 0 => 'regular',
3371
- 1 => '700',
3372
- ),
3373
- 'PT Sans Narrow' =>
3374
- array(
3375
- 0 => 'regular',
3376
- 1 => '700',
3377
- ),
3378
- 'PT Serif' =>
3379
- array(
3380
- 0 => 'regular',
3381
- 1 => 'italic',
3382
- 2 => '700',
3383
- 3 => '700italic',
3384
- ),
3385
- 'PT Serif Caption' =>
3386
- array(
3387
- 0 => 'regular',
3388
- 1 => 'italic',
3389
- ),
3390
- 'Pacifico' =>
3391
- array(
3392
- 0 => 'regular',
3393
- ),
3394
- 'Padauk' =>
3395
- array(
3396
- 0 => 'regular',
3397
- 1 => '700',
3398
- ),
3399
- 'Palanquin' =>
3400
- array(
3401
- 0 => '100',
3402
- 1 => '200',
3403
- 2 => '300',
3404
- 3 => 'regular',
3405
- 4 => '500',
3406
- 5 => '600',
3407
- 6 => '700',
3408
- ),
3409
- 'Palanquin Dark' =>
3410
- array(
3411
- 0 => 'regular',
3412
- 1 => '500',
3413
- 2 => '600',
3414
- 3 => '700',
3415
- ),
3416
- 'Pangolin' =>
3417
- array(
3418
- 0 => 'regular',
3419
- ),
3420
- 'Paprika' =>
3421
- array(
3422
- 0 => 'regular',
3423
- ),
3424
- 'Parisienne' =>
3425
- array(
3426
- 0 => 'regular',
3427
- ),
3428
- 'Passero One' =>
3429
- array(
3430
- 0 => 'regular',
3431
- ),
3432
- 'Passion One' =>
3433
- array(
3434
- 0 => 'regular',
3435
- 1 => '700',
3436
- 2 => '900',
3437
- ),
3438
- 'Pathway Gothic One' =>
3439
- array(
3440
- 0 => 'regular',
3441
- ),
3442
- 'Patrick Hand' =>
3443
- array(
3444
- 0 => 'regular',
3445
- ),
3446
- 'Patrick Hand SC' =>
3447
- array(
3448
- 0 => 'regular',
3449
- ),
3450
- 'Pattaya' =>
3451
- array(
3452
- 0 => 'regular',
3453
- ),
3454
- 'Patua One' =>
3455
- array(
3456
- 0 => 'regular',
3457
- ),
3458
- 'Pavanam' =>
3459
- array(
3460
- 0 => 'regular',
3461
- ),
3462
- 'Paytone One' =>
3463
- array(
3464
- 0 => 'regular',
3465
- ),
3466
- 'Peddana' =>
3467
- array(
3468
- 0 => 'regular',
3469
- ),
3470
- 'Peralta' =>
3471
- array(
3472
- 0 => 'regular',
3473
- ),
3474
- 'Permanent Marker' =>
3475
- array(
3476
- 0 => 'regular',
3477
- ),
3478
- 'Petit Formal Script' =>
3479
- array(
3480
- 0 => 'regular',
3481
- ),
3482
- 'Petrona' =>
3483
- array(
3484
- 0 => 'regular',
3485
- ),
3486
- 'Philosopher' =>
3487
- array(
3488
- 0 => 'regular',
3489
- 1 => 'italic',
3490
- 2 => '700',
3491
- 3 => '700italic',
3492
- ),
3493
- 'Piedra' =>
3494
- array(
3495
- 0 => 'regular',
3496
- ),
3497
- 'Pinyon Script' =>
3498
- array(
3499
- 0 => 'regular',
3500
- ),
3501
- 'Pirata One' =>
3502
- array(
3503
- 0 => 'regular',
3504
- ),
3505
- 'Plaster' =>
3506
- array(
3507
- 0 => 'regular',
3508
- ),
3509
- 'Play' =>
3510
- array(
3511
- 0 => 'regular',
3512
- 1 => '700',
3513
- ),
3514
- 'Playball' =>
3515
- array(
3516
- 0 => 'regular',
3517
- ),
3518
- 'Playfair Display' =>
3519
- array(
3520
- 0 => 'regular',
3521
- 1 => 'italic',
3522
- 2 => '700',
3523
- 3 => '700italic',
3524
- 4 => '900',
3525
- 5 => '900italic',
3526
- ),
3527
- 'Playfair Display SC' =>
3528
- array(
3529
- 0 => 'regular',
3530
- 1 => 'italic',
3531
- 2 => '700',
3532
- 3 => '700italic',
3533
- 4 => '900',
3534
- 5 => '900italic',
3535
- ),
3536
- 'Podkova' =>
3537
- array(
3538
- 0 => 'regular',
3539
- 1 => '500',
3540
- 2 => '600',
3541
- 3 => '700',
3542
- 4 => '800',
3543
- ),
3544
- 'Poiret One' =>
3545
- array(
3546
- 0 => 'regular',
3547
- ),
3548
- 'Poller One' =>
3549
- array(
3550
- 0 => 'regular',
3551
- ),
3552
- 'Poly' =>
3553
- array(
3554
- 0 => 'regular',
3555
- 1 => 'italic',
3556
- ),
3557
- 'Pompiere' =>
3558
- array(
3559
- 0 => 'regular',
3560
- ),
3561
- 'Pontano Sans' =>
3562
- array(
3563
- 0 => 'regular',
3564
- ),
3565
- 'Poppins' =>
3566
- array(
3567
- 0 => '100',
3568
- 1 => '100italic',
3569
- 2 => '200',
3570
- 3 => '200italic',
3571
- 4 => '300',
3572
- 5 => '300italic',
3573
- 6 => 'regular',
3574
- 7 => 'italic',
3575
- 8 => '500',
3576
- 9 => '500italic',
3577
- 10 => '600',
3578
- 11 => '600italic',
3579
- 12 => '700',
3580
- 13 => '700italic',
3581
- 14 => '800',
3582
- 15 => '800italic',
3583
- 16 => '900',
3584
- 17 => '900italic',
3585
- ),
3586
- 'Port Lligat Sans' =>
3587
- array(
3588
- 0 => 'regular',
3589
- ),
3590
- 'Port Lligat Slab' =>
3591
- array(
3592
- 0 => 'regular',
3593
- ),
3594
- 'Pragati Narrow' =>
3595
- array(
3596
- 0 => 'regular',
3597
- 1 => '700',
3598
- ),
3599
- 'Prata' =>
3600
- array(
3601
- 0 => 'regular',
3602
- ),
3603
- 'Preahvihear' =>
3604
- array(
3605
- 0 => 'regular',
3606
- ),
3607
- 'Press Start 2P' =>
3608
- array(
3609
- 0 => 'regular',
3610
- ),
3611
- 'Pridi' =>
3612
- array(
3613
- 0 => '200',
3614
- 1 => '300',
3615
- 2 => 'regular',
3616
- 3 => '500',
3617
- 4 => '600',
3618
- 5 => '700',
3619
- ),
3620
- 'Princess Sofia' =>
3621
- array(
3622
- 0 => 'regular',
3623
- ),
3624
- 'Prociono' =>
3625
- array(
3626
- 0 => 'regular',
3627
- ),
3628
- 'Prompt' =>
3629
- array(
3630
- 0 => '100',
3631
- 1 => '100italic',
3632
- 2 => '200',
3633
- 3 => '200italic',
3634
- 4 => '300',
3635
- 5 => '300italic',
3636
- 6 => 'regular',
3637
- 7 => 'italic',
3638
- 8 => '500',
3639
- 9 => '500italic',
3640
- 10 => '600',
3641
- 11 => '600italic',
3642
- 12 => '700',
3643
- 13 => '700italic',
3644
- 14 => '800',
3645
- 15 => '800italic',
3646
- 16 => '900',
3647
- 17 => '900italic',
3648
- ),
3649
- 'Prosto One' =>
3650
- array(
3651
- 0 => 'regular',
3652
- ),
3653
- 'Proza Libre' =>
3654
- array(
3655
- 0 => 'regular',
3656
- 1 => 'italic',
3657
- 2 => '500',
3658
- 3 => '500italic',
3659
- 4 => '600',
3660
- 5 => '600italic',
3661
- 6 => '700',
3662
- 7 => '700italic',
3663
- 8 => '800',
3664
- 9 => '800italic',
3665
- ),
3666
- 'Puritan' =>
3667
- array(
3668
- 0 => 'regular',
3669
- 1 => 'italic',
3670
- 2 => '700',
3671
- 3 => '700italic',
3672
- ),
3673
- 'Purple Purse' =>
3674
- array(
3675
- 0 => 'regular',
3676
- ),
3677
- 'Quando' =>
3678
- array(
3679
- 0 => 'regular',
3680
- ),
3681
- 'Quantico' =>
3682
- array(
3683
- 0 => 'regular',
3684
- 1 => 'italic',
3685
- 2 => '700',
3686
- 3 => '700italic',
3687
- ),
3688
- 'Quattrocento' =>
3689
- array(
3690
- 0 => 'regular',
3691
- 1 => '700',
3692
- ),
3693
- 'Quattrocento Sans' =>
3694
- array(
3695
- 0 => 'regular',
3696
- 1 => 'italic',
3697
- 2 => '700',
3698
- 3 => '700italic',
3699
- ),
3700
- 'Questrial' =>
3701
- array(
3702
- 0 => 'regular',
3703
- ),
3704
- 'Quicksand' =>
3705
- array(
3706
- 0 => '300',
3707
- 1 => 'regular',
3708
- 2 => '500',
3709
- 3 => '700',
3710
- ),
3711
- 'Quintessential' =>
3712
- array(
3713
- 0 => 'regular',
3714
- ),
3715
- 'Qwigley' =>
3716
- array(
3717
- 0 => 'regular',
3718
- ),
3719
- 'Racing Sans One' =>
3720
- array(
3721
- 0 => 'regular',
3722
- ),
3723
- 'Radley' =>
3724
- array(
3725
- 0 => 'regular',
3726
- 1 => 'italic',
3727
- ),
3728
- 'Rajdhani' =>
3729
- array(
3730
- 0 => '300',
3731
- 1 => 'regular',
3732
- 2 => '500',
3733
- 3 => '600',
3734
- 4 => '700',
3735
- ),
3736
- 'Rakkas' =>
3737
- array(
3738
- 0 => 'regular',
3739
- ),
3740
- 'Raleway' =>
3741
- array(
3742
- 0 => '100',
3743
- 1 => '100italic',
3744
- 2 => '200',
3745
- 3 => '200italic',
3746
- 4 => '300',
3747
- 5 => '300italic',
3748
- 6 => 'regular',
3749
- 7 => 'italic',
3750
- 8 => '500',
3751
- 9 => '500italic',
3752
- 10 => '600',
3753
- 11 => '600italic',
3754
- 12 => '700',
3755
- 13 => '700italic',
3756
- 14 => '800',
3757
- 15 => '800italic',
3758
- 16 => '900',
3759
- 17 => '900italic',
3760
- ),
3761
- 'Raleway Dots' =>
3762
- array(
3763
- 0 => 'regular',
3764
- ),
3765
- 'Ramabhadra' =>
3766
- array(
3767
- 0 => 'regular',
3768
- ),
3769
- 'Ramaraja' =>
3770
- array(
3771
- 0 => 'regular',
3772
- ),
3773
- 'Rambla' =>
3774
- array(
3775
- 0 => 'regular',
3776
- 1 => 'italic',
3777
- 2 => '700',
3778
- 3 => '700italic',
3779
- ),
3780
- 'Rammetto One' =>
3781
- array(
3782
- 0 => 'regular',
3783
- ),
3784
- 'Ranchers' =>
3785
- array(
3786
- 0 => 'regular',
3787
- ),
3788
- 'Rancho' =>
3789
- array(
3790
- 0 => 'regular',
3791
- ),
3792
- 'Ranga' =>
3793
- array(
3794
- 0 => 'regular',
3795
- 1 => '700',
3796
- ),
3797
- 'Rasa' =>
3798
- array(
3799
- 0 => '300',
3800
- 1 => 'regular',
3801
- 2 => '500',
3802
- 3 => '600',
3803
- 4 => '700',
3804
- ),
3805
- 'Rationale' =>
3806
- array(
3807
- 0 => 'regular',
3808
- ),
3809
- 'Ravi Prakash' =>
3810
- array(
3811
- 0 => 'regular',
3812
- ),
3813
- 'Redressed' =>
3814
- array(
3815
- 0 => 'regular',
3816
- ),
3817
- 'Reem Kufi' =>
3818
- array(
3819
- 0 => 'regular',
3820
- ),
3821
- 'Reenie Beanie' =>
3822
- array(
3823
- 0 => 'regular',
3824
- ),
3825
- 'Revalia' =>
3826
- array(
3827
- 0 => 'regular',
3828
- ),
3829
- 'Rhodium Libre' =>
3830
- array(
3831
- 0 => 'regular',
3832
- ),
3833
- 'Ribeye' =>
3834
- array(
3835
- 0 => 'regular',
3836
- ),
3837
- 'Ribeye Marrow' =>
3838
- array(
3839
- 0 => 'regular',
3840
- ),
3841
- 'Righteous' =>
3842
- array(
3843
- 0 => 'regular',
3844
- ),
3845
- 'Risque' =>
3846
- array(
3847
- 0 => 'regular',
3848
- ),
3849
- 'Roboto' =>
3850
- array(
3851
- 0 => '100',
3852
- 1 => '100italic',
3853
- 2 => '300',
3854
- 3 => '300italic',
3855
- 4 => 'regular',
3856
- 5 => 'italic',
3857
- 6 => '500',
3858
- 7 => '500italic',
3859
- 8 => '700',
3860
- 9 => '700italic',
3861
- 10 => '900',
3862
- 11 => '900italic',
3863
- ),
3864
- 'Roboto Condensed' =>
3865
- array(
3866
- 0 => '300',
3867
- 1 => '300italic',
3868
- 2 => 'regular',
3869
- 3 => 'italic',
3870
- 4 => '700',
3871
- 5 => '700italic',
3872
- ),
3873
- 'Roboto Mono' =>
3874
- array(
3875
- 0 => '100',
3876
- 1 => '100italic',
3877
- 2 => '300',
3878
- 3 => '300italic',
3879
- 4 => 'regular',
3880
- 5 => 'italic',
3881
- 6 => '500',
3882
- 7 => '500italic',
3883
- 8 => '700',
3884
- 9 => '700italic',
3885
- ),
3886
- 'Roboto Slab' =>
3887
- array(
3888
- 0 => '100',
3889
- 1 => '300',
3890
- 2 => 'regular',
3891
- 3 => '700',
3892
- ),
3893
- 'Rochester' =>
3894
- array(
3895
- 0 => 'regular',
3896
- ),
3897
- 'Rock Salt' =>
3898
- array(
3899
- 0 => 'regular',
3900
- ),
3901
- 'Rokkitt' =>
3902
- array(
3903
- 0 => '100',
3904
- 1 => '200',
3905
- 2 => '300',
3906
- 3 => 'regular',
3907
- 4 => '500',
3908
- 5 => '600',
3909
- 6 => '700',
3910
- 7 => '800',
3911
- 8 => '900',
3912
- ),
3913
- 'Romanesco' =>
3914
- array(
3915
- 0 => 'regular',
3916
- ),
3917
- 'Ropa Sans' =>
3918
- array(
3919
- 0 => 'regular',
3920
- 1 => 'italic',
3921
- ),
3922
- 'Rosario' =>
3923
- array(
3924
- 0 => 'regular',
3925
- 1 => 'italic',
3926
- 2 => '700',
3927
- 3 => '700italic',
3928
- ),
3929
- 'Rosarivo' =>
3930
- array(
3931
- 0 => 'regular',
3932
- 1 => 'italic',
3933
- ),
3934
- 'Rouge Script' =>
3935
- array(
3936
- 0 => 'regular',
3937
- ),
3938
- 'Rozha One' =>
3939
- array(
3940
- 0 => 'regular',
3941
- ),
3942
- 'Rubik' =>
3943
- array(
3944
- 0 => '300',
3945
- 1 => '300italic',
3946
- 2 => 'regular',
3947
- 3 => 'italic',
3948
- 4 => '500',
3949
- 5 => '500italic',
3950
- 6 => '700',
3951
- 7 => '700italic',
3952
- 8 => '900',
3953
- 9 => '900italic',
3954
- ),
3955
- 'Rubik Mono One' =>
3956
- array(
3957
- 0 => 'regular',
3958
- ),
3959
- 'Ruda' =>
3960
- array(
3961
- 0 => 'regular',
3962
- 1 => '700',
3963
- 2 => '900',
3964
- ),
3965
- 'Rufina' =>
3966
- array(
3967
- 0 => 'regular',
3968
- 1 => '700',
3969
- ),
3970
- 'Ruge Boogie' =>
3971
- array(
3972
- 0 => 'regular',
3973
- ),
3974
- 'Ruluko' =>
3975
- array(
3976
- 0 => 'regular',
3977
- ),
3978
- 'Rum Raisin' =>
3979
- array(
3980
- 0 => 'regular',
3981
- ),
3982
- 'Ruslan Display' =>
3983
- array(
3984
- 0 => 'regular',
3985
- ),
3986
- 'Russo One' =>
3987
- array(
3988
- 0 => 'regular',
3989
- ),
3990
- 'Ruthie' =>
3991
- array(
3992
- 0 => 'regular',
3993
- ),
3994
- 'Rye' =>
3995
- array(
3996
- 0 => 'regular',
3997
- ),
3998
- 'Sacramento' =>
3999
- array(
4000
- 0 => 'regular',
4001
- ),
4002
- 'Sahitya' =>
4003
- array(
4004
- 0 => 'regular',
4005
- 1 => '700',
4006
- ),
4007
- 'Sail' =>
4008
- array(
4009
- 0 => 'regular',
4010
- ),
4011
- 'Saira' =>
4012
- array(
4013
- 0 => '100',
4014
- 1 => '200',
4015
- 2 => '300',
4016
- 3 => 'regular',
4017
- 4 => '500',
4018
- 5 => '600',
4019
- 6 => '700',
4020
- 7 => '800',
4021
- 8 => '900',
4022
- ),
4023
- 'Saira Condensed' =>
4024
- array(
4025
- 0 => '100',
4026
- 1 => '200',
4027
- 2 => '300',
4028
- 3 => 'regular',
4029
- 4 => '500',
4030
- 5 => '600',
4031
- 6 => '700',
4032
- 7 => '800',
4033
- 8 => '900',
4034
- ),
4035
- 'Saira Extra Condensed' =>
4036
- array(
4037
- 0 => '100',
4038
- 1 => '200',
4039
- 2 => '300',
4040
- 3 => 'regular',
4041
- 4 => '500',
4042
- 5 => '600',
4043
- 6 => '700',
4044
- 7 => '800',
4045
- 8 => '900',
4046
- ),
4047
- 'Saira Semi Condensed' =>
4048
- array(
4049
- 0 => '100',
4050
- 1 => '200',
4051
- 2 => '300',
4052
- 3 => 'regular',
4053
- 4 => '500',
4054
- 5 => '600',
4055
- 6 => '700',
4056
- 7 => '800',
4057
- 8 => '900',
4058
- ),
4059
- 'Salsa' =>
4060
- array(
4061
- 0 => 'regular',
4062
- ),
4063
- 'Sanchez' =>
4064
- array(
4065
- 0 => 'regular',
4066
- 1 => 'italic',
4067
- ),
4068
- 'Sancreek' =>
4069
- array(
4070
- 0 => 'regular',
4071
- ),
4072
- 'Sansita' =>
4073
- array(
4074
- 0 => 'regular',
4075
- 1 => 'italic',
4076
- 2 => '700',
4077
- 3 => '700italic',
4078
- 4 => '800',
4079
- 5 => '800italic',
4080
- 6 => '900',
4081
- 7 => '900italic',
4082
- ),
4083
- 'Sarala' =>
4084
- array(
4085
- 0 => 'regular',
4086
- 1 => '700',
4087
- ),
4088
- 'Sarina' =>
4089
- array(
4090
- 0 => 'regular',
4091
- ),
4092
- 'Sarpanch' =>
4093
- array(
4094
- 0 => 'regular',
4095
- 1 => '500',
4096
- 2 => '600',
4097
- 3 => '700',
4098
- 4 => '800',
4099
- 5 => '900',
4100
- ),
4101
- 'Satisfy' =>
4102
- array(
4103
- 0 => 'regular',
4104
- ),
4105
- 'Scada' =>
4106
- array(
4107
- 0 => 'regular',
4108
- 1 => 'italic',
4109
- 2 => '700',
4110
- 3 => '700italic',
4111
- ),
4112
- 'Scheherazade' =>
4113
- array(
4114
- 0 => 'regular',
4115
- 1 => '700',
4116
- ),
4117
- 'Schoolbell' =>
4118
- array(
4119
- 0 => 'regular',
4120
- ),
4121
- 'Scope One' =>
4122
- array(
4123
- 0 => 'regular',
4124
- ),
4125
- 'Seaweed Script' =>
4126
- array(
4127
- 0 => 'regular',
4128
- ),
4129
- 'Secular One' =>
4130
- array(
4131
- 0 => 'regular',
4132
- ),
4133
- 'Sedgwick Ave' =>
4134
- array(
4135
- 0 => 'regular',
4136
- ),
4137
- 'Sedgwick Ave Display' =>
4138
- array(
4139
- 0 => 'regular',
4140
- ),
4141
- 'Sevillana' =>
4142
- array(
4143
- 0 => 'regular',
4144
- ),
4145
- 'Seymour One' =>
4146
- array(
4147
- 0 => 'regular',
4148
- ),
4149
- 'Shadows Into Light' =>
4150
- array(
4151
- 0 => 'regular',
4152
- ),
4153
- 'Shadows Into Light Two' =>
4154
- array(
4155
- 0 => 'regular',
4156
- ),
4157
- 'Shanti' =>
4158
- array(
4159
- 0 => 'regular',
4160
- ),
4161
- 'Share' =>
4162
- array(
4163
- 0 => 'regular',
4164
- 1 => 'italic',
4165
- 2 => '700',
4166
- 3 => '700italic',
4167
- ),
4168
- 'Share Tech' =>
4169
- array(
4170
- 0 => 'regular',
4171
- ),
4172
- 'Share Tech Mono' =>
4173
- array(
4174
- 0 => 'regular',
4175
- ),
4176
- 'Shojumaru' =>
4177
- array(
4178
- 0 => 'regular',
4179
- ),
4180
- 'Short Stack' =>
4181
- array(
4182
- 0 => 'regular',
4183
- ),
4184
- 'Shrikhand' =>
4185
- array(
4186
- 0 => 'regular',
4187
- ),
4188
- 'Siemreap' =>
4189
- array(
4190
- 0 => 'regular',
4191
- ),
4192
- 'Sigmar One' =>
4193
- array(
4194
- 0 => 'regular',
4195
- ),
4196
- 'Signika' =>
4197
- array(
4198
- 0 => '300',
4199
- 1 => 'regular',
4200
- 2 => '600',
4201
- 3 => '700',
4202
- ),
4203
- 'Signika Negative' =>
4204
- array(
4205
- 0 => '300',
4206
- 1 => 'regular',
4207
- 2 => '600',
4208
- 3 => '700',
4209
- ),
4210
- 'Simonetta' =>
4211
- array(
4212
- 0 => 'regular',
4213
- 1 => 'italic',
4214
- 2 => '900',
4215
- 3 => '900italic',
4216
- ),
4217
- 'Sintony' =>
4218
- array(
4219
- 0 => 'regular',
4220
- 1 => '700',
4221
- ),
4222
- 'Sirin Stencil' =>
4223
- array(
4224
- 0 => 'regular',
4225
- ),
4226
- 'Six Caps' =>
4227
- array(
4228
- 0 => 'regular',
4229
- ),
4230
- 'Skranji' =>
4231
- array(
4232
- 0 => 'regular',
4233
- 1 => '700',
4234
- ),
4235
- 'Slabo 13px' =>
4236
- array(
4237
- 0 => 'regular',
4238
- ),
4239
- 'Slabo 27px' =>
4240
- array(
4241
- 0 => 'regular',
4242
- ),
4243
- 'Slackey' =>
4244
- array(
4245
- 0 => 'regular',
4246
- ),
4247
- 'Smokum' =>
4248
- array(
4249
- 0 => 'regular',
4250
- ),
4251
- 'Smythe' =>
4252
- array(
4253
- 0 => 'regular',
4254
- ),
4255
- 'Sniglet' =>
4256
- array(
4257
- 0 => 'regular',
4258
- 1 => '800',
4259
- ),
4260
- 'Snippet' =>
4261
- array(
4262
- 0 => 'regular',
4263
- ),
4264
- 'Snowburst One' =>
4265
- array(
4266
- 0 => 'regular',
4267
- ),
4268
- 'Sofadi One' =>
4269
- array(
4270
- 0 => 'regular',
4271
- ),
4272
- 'Sofia' =>
4273
- array(
4274
- 0 => 'regular',
4275
- ),
4276
- 'Sonsie One' =>
4277
- array(
4278
- 0 => 'regular',
4279
- ),
4280
- 'Sorts Mill Goudy' =>
4281
- array(
4282
- 0 => 'regular',
4283
- 1 => 'italic',
4284
- ),
4285
- 'Source Code Pro' =>
4286
- array(
4287
- 0 => '200',
4288
- 1 => '300',
4289
- 2 => 'regular',
4290
- 3 => '500',
4291
- 4 => '600',
4292
- 5 => '700',
4293
- 6 => '900',
4294
- ),
4295
- 'Source Sans Pro' =>
4296
- array(
4297
- 0 => '200',
4298
- 1 => '200italic',
4299
- 2 => '300',
4300
- 3 => '300italic',
4301
- 4 => 'regular',
4302
- 5 => 'italic',
4303
- 6 => '600',
4304
- 7 => '600italic',
4305
- 8 => '700',
4306
- 9 => '700italic',
4307
- 10 => '900',
4308
- 11 => '900italic',
4309
- ),
4310
- 'Source Serif Pro' =>
4311
- array(
4312
- 0 => 'regular',
4313
- 1 => '600',
4314
- 2 => '700',
4315
- ),
4316
- 'Space Mono' =>
4317
- array(
4318
- 0 => 'regular',
4319
- 1 => 'italic',
4320
- 2 => '700',
4321
- 3 => '700italic',
4322
- ),
4323
- 'Special Elite' =>
4324
- array(
4325
- 0 => 'regular',
4326
- ),
4327
- 'Spectral' =>
4328
- array(
4329
- 0 => '200',
4330
- 1 => '200italic',
4331
- 2 => '300',
4332
- 3 => '300italic',
4333
- 4 => 'regular',
4334
- 5 => 'italic',
4335
- 6 => '500',
4336
- 7 => '500italic',
4337
- 8 => '600',
4338
- 9 => '600italic',
4339
- 10 => '700',
4340
- 11 => '700italic',
4341
- 12 => '800',
4342
- 13 => '800italic',
4343
- ),
4344
- 'Spectral SC' =>
4345
- array(
4346
- 0 => '200',
4347
- 1 => '200italic',
4348
- 2 => '300',
4349
- 3 => '300italic',
4350
- 4 => 'regular',
4351
- 5 => 'italic',
4352
- 6 => '500',
4353
- 7 => '500italic',
4354
- 8 => '600',
4355
- 9 => '600italic',
4356
- 10 => '700',
4357
- 11 => '700italic',
4358
- 12 => '800',
4359
- 13 => '800italic',
4360
- ),
4361
- 'Spicy Rice' =>
4362
- array(
4363
- 0 => 'regular',
4364
- ),
4365
- 'Spinnaker' =>
4366
- array(
4367
- 0 => 'regular',
4368
- ),
4369
- 'Spirax' =>
4370
- array(
4371
- 0 => 'regular',
4372
- ),
4373
- 'Squada One' =>
4374
- array(
4375
- 0 => 'regular',
4376
- ),
4377
- 'Sree Krushnadevaraya' =>
4378
- array(
4379
- 0 => 'regular',
4380
- ),
4381
- 'Sriracha' =>
4382
- array(
4383
- 0 => 'regular',
4384
- ),
4385
- 'Stalemate' =>
4386
- array(
4387
- 0 => 'regular',
4388
- ),
4389
- 'Stalinist One' =>
4390
- array(
4391
- 0 => 'regular',
4392
- ),
4393
- 'Stardos Stencil' =>
4394
- array(
4395
- 0 => 'regular',
4396
- 1 => '700',
4397
- ),
4398
- 'Stint Ultra Condensed' =>
4399
- array(
4400
- 0 => 'regular',
4401
- ),
4402
- 'Stint Ultra Expanded' =>
4403
- array(
4404
- 0 => 'regular',
4405
- ),
4406
- 'Stoke' =>
4407
- array(
4408
- 0 => '300',
4409
- 1 => 'regular',
4410
- ),
4411
- 'Strait' =>
4412
- array(
4413
- 0 => 'regular',
4414
- ),
4415
- 'Sue Ellen Francisco' =>
4416
- array(
4417
- 0 => 'regular',
4418
- ),
4419
- 'Suez One' =>
4420
- array(
4421
- 0 => 'regular',
4422
- ),
4423
- 'Sumana' =>
4424
- array(
4425
- 0 => 'regular',
4426
- 1 => '700',
4427
- ),
4428
- 'Sunshiney' =>
4429
- array(
4430
- 0 => 'regular',
4431
- ),
4432
- 'Supermercado One' =>
4433
- array(
4434
- 0 => 'regular',
4435
- ),
4436
- 'Sura' =>
4437
- array(
4438
- 0 => 'regular',
4439
- 1 => '700',
4440
- ),
4441
- 'Suranna' =>
4442
- array(
4443
- 0 => 'regular',
4444
- ),
4445
- 'Suravaram' =>
4446
- array(
4447
- 0 => 'regular',
4448
- ),
4449
- 'Suwannaphum' =>
4450
- array(
4451
- 0 => 'regular',
4452
- ),
4453
- 'Swanky and Moo Moo' =>
4454
- array(
4455
- 0 => 'regular',
4456
- ),
4457
- 'Syncopate' =>
4458
- array(
4459
- 0 => 'regular',
4460
- 1 => '700',
4461
- ),
4462
- 'Tangerine' =>
4463
- array(
4464
- 0 => 'regular',
4465
- 1 => '700',
4466
- ),
4467
- 'Taprom' =>
4468
- array(
4469
- 0 => 'regular',
4470
- ),
4471
- 'Tauri' =>
4472
- array(
4473
- 0 => 'regular',
4474
- ),
4475
- 'Taviraj' =>
4476
- array(
4477
- 0 => '100',
4478
- 1 => '100italic',
4479
- 2 => '200',
4480
- 3 => '200italic',
4481
- 4 => '300',
4482
- 5 => '300italic',
4483
- 6 => 'regular',
4484
- 7 => 'italic',
4485
- 8 => '500',
4486
- 9 => '500italic',
4487
- 10 => '600',
4488
- 11 => '600italic',
4489
- 12 => '700',
4490
- 13 => '700italic',
4491
- 14 => '800',
4492
- 15 => '800italic',
4493
- 16 => '900',
4494
- 17 => '900italic',
4495
- ),
4496
- 'Teko' =>
4497
- array(
4498
- 0 => '300',
4499
- 1 => 'regular',
4500
- 2 => '500',
4501
- 3 => '600',
4502
- 4 => '700',
4503
- ),
4504
- 'Telex' =>
4505
- array(
4506
- 0 => 'regular',
4507
- ),
4508
- 'Tenali Ramakrishna' =>
4509
- array(
4510
- 0 => 'regular',
4511
- ),
4512
- 'Tenor Sans' =>
4513
- array(
4514
- 0 => 'regular',
4515
- ),
4516
- 'Text Me One' =>
4517
- array(
4518
- 0 => 'regular',
4519
- ),
4520
- 'The Girl Next Door' =>
4521
- array(
4522
- 0 => 'regular',
4523
- ),
4524
- 'Tienne' =>
4525
- array(
4526
- 0 => 'regular',
4527
- 1 => '700',
4528
- 2 => '900',
4529
- ),
4530
- 'Tillana' =>
4531
- array(
4532
- 0 => 'regular',
4533
- 1 => '500',
4534
- 2 => '600',
4535
- 3 => '700',
4536
- 4 => '800',
4537
- ),
4538
- 'Timmana' =>
4539
- array(
4540
- 0 => 'regular',
4541
- ),
4542
- 'Tinos' =>
4543
- array(
4544
- 0 => 'regular',
4545
- 1 => 'italic',
4546
- 2 => '700',
4547
- 3 => '700italic',
4548
- ),
4549
- 'Titan One' =>
4550
- array(
4551
- 0 => 'regular',
4552
- ),
4553
- 'Titillium Web' =>
4554
- array(
4555
- 0 => '200',
4556
- 1 => '200italic',
4557
- 2 => '300',
4558
- 3 => '300italic',
4559
- 4 => 'regular',
4560
- 5 => 'italic',
4561
- 6 => '600',
4562
- 7 => '600italic',
4563
- 8 => '700',
4564
- 9 => '700italic',
4565
- 10 => '900',
4566
- ),
4567
- 'Trade Winds' =>
4568
- array(
4569
- 0 => 'regular',
4570
- ),
4571
- 'Trirong' =>
4572
- array(
4573
- 0 => '100',
4574
- 1 => '100italic',
4575
- 2 => '200',
4576
- 3 => '200italic',
4577
- 4 => '300',
4578
- 5 => '300italic',
4579
- 6 => 'regular',
4580
- 7 => 'italic',
4581
- 8 => '500',
4582
- 9 => '500italic',
4583
- 10 => '600',
4584
- 11 => '600italic',
4585
- 12 => '700',
4586
- 13 => '700italic',
4587
- 14 => '800',
4588
- 15 => '800italic',
4589
- 16 => '900',
4590
- 17 => '900italic',
4591
- ),
4592
- 'Trocchi' =>
4593
- array(
4594
- 0 => 'regular',
4595
- ),
4596
- 'Trochut' =>
4597
- array(
4598
- 0 => 'regular',
4599
- 1 => 'italic',
4600
- 2 => '700',
4601
- ),
4602
- 'Trykker' =>
4603
- array(
4604
- 0 => 'regular',
4605
- ),
4606
- 'Tulpen One' =>
4607
- array(
4608
- 0 => 'regular',
4609
- ),
4610
- 'Ubuntu' =>
4611
- array(
4612
- 0 => '300',
4613
- 1 => '300italic',
4614
- 2 => 'regular',
4615
- 3 => 'italic',
4616
- 4 => '500',
4617
- 5 => '500italic',
4618
- 6 => '700',
4619
- 7 => '700italic',
4620
- ),
4621
- 'Ubuntu Condensed' =>
4622
- array(
4623
- 0 => 'regular',
4624
- ),
4625
- 'Ubuntu Mono' =>
4626
- array(
4627
- 0 => 'regular',
4628
- 1 => 'italic',
4629
- 2 => '700',
4630
- 3 => '700italic',
4631
- ),
4632
- 'Ultra' =>
4633
- array(
4634
- 0 => 'regular',
4635
- ),
4636
- 'Uncial Antiqua' =>
4637
- array(
4638
- 0 => 'regular',
4639
- ),
4640
- 'Underdog' =>
4641
- array(
4642
- 0 => 'regular',
4643
- ),
4644
- 'Unica One' =>
4645
- array(
4646
- 0 => 'regular',
4647
- ),
4648
- 'UnifrakturCook' =>
4649
- array(
4650
- 0 => '700',
4651
- ),
4652
- 'UnifrakturMaguntia' =>
4653
- array(
4654
- 0 => 'regular',
4655
- ),
4656
- 'Unkempt' =>
4657
- array(
4658
- 0 => 'regular',
4659
- 1 => '700',
4660
- ),
4661
- 'Unlock' =>
4662
- array(
4663
- 0 => 'regular',
4664
- ),
4665
- 'Unna' =>
4666
- array(
4667
- 0 => 'regular',
4668
- 1 => 'italic',
4669
- 2 => '700',
4670
- 3 => '700italic',
4671
- ),
4672
- 'VT323' =>
4673
- array(
4674
- 0 => 'regular',
4675
- ),
4676
- 'Vampiro One' =>
4677
- array(
4678
- 0 => 'regular',
4679
- ),
4680
- 'Varela' =>
4681
- array(
4682
- 0 => 'regular',
4683
- ),
4684
- 'Varela Round' =>
4685
- array(
4686
- 0 => 'regular',
4687
- ),
4688
- 'Vast Shadow' =>
4689
- array(
4690
- 0 => 'regular',
4691
- ),
4692
- 'Vesper Libre' =>
4693
- array(
4694
- 0 => 'regular',
4695
- 1 => '500',
4696
- 2 => '700',
4697
- 3 => '900',
4698
- ),
4699
- 'Vibur' =>
4700
- array(
4701
- 0 => 'regular',
4702
- ),
4703
- 'Vidaloka' =>
4704
- array(
4705
- 0 => 'regular',
4706
- ),
4707
- 'Viga' =>
4708
- array(
4709
- 0 => 'regular',
4710
- ),
4711
- 'Voces' =>
4712
- array(
4713
- 0 => 'regular',
4714
- ),
4715
- 'Volkhov' =>
4716
- array(
4717
- 0 => 'regular',
4718
- 1 => 'italic',
4719
- 2 => '700',
4720
- 3 => '700italic',
4721
- ),
4722
- 'Vollkorn' =>
4723
- array(
4724
- 0 => 'regular',
4725
- 1 => 'italic',
4726
- 2 => '600',
4727
- 3 => '600italic',
4728
- 4 => '700',
4729
- 5 => '700italic',
4730
- 6 => '900',
4731
- 7 => '900italic',
4732
- ),
4733
- 'Vollkorn SC' =>
4734
- array(
4735
- 0 => 'regular',
4736
- 1 => '600',
4737
- 2 => '700',
4738
- 3 => '900',
4739
- ),
4740
- 'Voltaire' =>
4741
- array(
4742
- 0 => 'regular',
4743
- ),
4744
- 'Waiting for the Sunrise' =>
4745
- array(
4746
- 0 => 'regular',
4747
- ),
4748
- 'Wallpoet' =>
4749
- array(
4750
- 0 => 'regular',
4751
- ),
4752
- 'Walter Turncoat' =>
4753
- array(
4754
- 0 => 'regular',
4755
- ),
4756
- 'Warnes' =>
4757
- array(
4758
- 0 => 'regular',
4759
- ),
4760
- 'Wellfleet' =>
4761
- array(
4762
- 0 => 'regular',
4763
- ),
4764
- 'Wendy One' =>
4765
- array(
4766
- 0 => 'regular',
4767
- ),
4768
- 'Wire One' =>
4769
- array(
4770
- 0 => 'regular',
4771
- ),
4772
- 'Work Sans' =>
4773
- array(
4774
- 0 => '100',
4775
- 1 => '200',
4776
- 2 => '300',
4777
- 3 => 'regular',
4778
- 4 => '500',
4779
- 5 => '600',
4780
- 6 => '700',
4781
- 7 => '800',
4782
- 8 => '900',
4783
- ),
4784
- 'Yanone Kaffeesatz' =>
4785
- array(
4786
- 0 => '200',
4787
- 1 => '300',
4788
- 2 => 'regular',
4789
- 3 => '700',
4790
- ),
4791
- 'Yantramanav' =>
4792
- array(
4793
- 0 => '100',
4794
- 1 => '300',
4795
- 2 => 'regular',
4796
- 3 => '500',
4797
- 4 => '700',
4798
- 5 => '900',
4799
- ),
4800
- 'Yatra One' =>
4801
- array(
4802
- 0 => 'regular',
4803
- ),
4804
- 'Yellowtail' =>
4805
- array(
4806
- 0 => 'regular',
4807
- ),
4808
- 'Yeseva One' =>
4809
- array(
4810
- 0 => 'regular',
4811
- ),
4812
- 'Yesteryear' =>
4813
- array(
4814
- 0 => 'regular',
4815
- ),
4816
- 'Yrsa' =>
4817
- array(
4818
- 0 => '300',
4819
- 1 => 'regular',
4820
- 2 => '500',
4821
- 3 => '600',
4822
- 4 => '700',
4823
- ),
4824
- 'Zeyada' =>
4825
- array(
4826
- 0 => 'regular',
4827
- ),
4828
- 'Zilla Slab' =>
4829
- array(
4830
- 0 => '300',
4831
- 1 => '300italic',
4832
- 2 => 'regular',
4833
- 3 => 'italic',
4834
- 4 => '500',
4835
- 5 => '500italic',
4836
- 6 => '600',
4837
- 7 => '600italic',
4838
- 8 => '700',
4839
- 9 => '700italic',
4840
- ),
4841
- 'Zilla Slab Highlight' =>
4842
- array(
4843
- 0 => 'regular',
4844
- 1 => '700',
4845
- ),
4846
- );
1
+ <?php
2
+
3
+ return array(
4
+ 'ABeeZee' =>
5
+ array(
6
+ 0 => 'regular',
7
+ 1 => 'italic',
8
+ ),
9
+ 'Abel' =>
10
+ array(
11
+ 0 => 'regular',
12
+ ),
13
+ 'Abhaya Libre' =>
14
+ array(
15
+ 0 => 'regular',
16
+ 1 => '500',
17
+ 2 => '600',
18
+ 3 => '700',
19
+ 4 => '800',
20
+ ),
21
+ 'Abril Fatface' =>
22
+ array(
23
+ 0 => 'regular',
24
+ ),
25
+ 'Aclonica' =>
26
+ array(
27
+ 0 => 'regular',
28
+ ),
29
+ 'Acme' =>
30
+ array(
31
+ 0 => 'regular',
32
+ ),
33
+ 'Actor' =>
34
+ array(
35
+ 0 => 'regular',
36
+ ),
37
+ 'Adamina' =>
38
+ array(
39
+ 0 => 'regular',
40
+ ),
41
+ 'Advent Pro' =>
42
+ array(
43
+ 0 => '100',
44
+ 1 => '200',
45
+ 2 => '300',
46
+ 3 => 'regular',
47
+ 4 => '500',
48
+ 5 => '600',
49
+ 6 => '700',
50
+ ),
51
+ 'Aguafina Script' =>
52
+ array(
53
+ 0 => 'regular',
54
+ ),
55
+ 'Akronim' =>
56
+ array(
57
+ 0 => 'regular',
58
+ ),
59
+ 'Aladin' =>
60
+ array(
61
+ 0 => 'regular',
62
+ ),
63
+ 'Aldrich' =>
64
+ array(
65
+ 0 => 'regular',
66
+ ),
67
+ 'Alef' =>
68
+ array(
69
+ 0 => 'regular',
70
+ 1 => '700',
71
+ ),
72
+ 'Alegreya' =>
73
+ array(
74
+ 0 => 'regular',
75
+ 1 => 'italic',
76
+ 2 => '500',
77
+ 3 => '500italic',
78
+ 4 => '700',
79
+ 5 => '700italic',
80
+ 6 => '800',
81
+ 7 => '800italic',
82
+ 8 => '900',
83
+ 9 => '900italic',
84
+ ),
85
+ 'Alegreya SC' =>
86
+ array(
87
+ 0 => 'regular',
88
+ 1 => 'italic',
89
+ 2 => '500',
90
+ 3 => '500italic',
91
+ 4 => '700',
92
+ 5 => '700italic',
93
+ 6 => '800',
94
+ 7 => '800italic',
95
+ 8 => '900',
96
+ 9 => '900italic',
97
+ ),
98
+ 'Alegreya Sans' =>
99
+ array(
100
+ 0 => '100',
101
+ 1 => '100italic',
102
+ 2 => '300',
103
+ 3 => '300italic',
104
+ 4 => 'regular',
105
+ 5 => 'italic',
106
+ 6 => '500',
107
+ 7 => '500italic',
108
+ 8 => '700',
109
+ 9 => '700italic',
110
+ 10 => '800',
111
+ 11 => '800italic',
112
+ 12 => '900',
113
+ 13 => '900italic',
114
+ ),
115
+ 'Alegreya Sans SC' =>
116
+ array(
117
+ 0 => '100',
118
+ 1 => '100italic',
119
+ 2 => '300',
120
+ 3 => '300italic',
121
+ 4 => 'regular',
122
+ 5 => 'italic',
123
+ 6 => '500',
124
+ 7 => '500italic',
125
+ 8 => '700',
126
+ 9 => '700italic',
127
+ 10 => '800',
128
+ 11 => '800italic',
129
+ 12 => '900',
130
+ 13 => '900italic',
131
+ ),
132
+ 'Alex Brush' =>
133
+ array(
134
+ 0 => 'regular',
135
+ ),
136
+ 'Alfa Slab One' =>
137
+ array(
138
+ 0 => 'regular',
139
+ ),
140
+ 'Alice' =>
141
+ array(
142
+ 0 => 'regular',
143
+ ),
144
+ 'Alike' =>
145
+ array(
146
+ 0 => 'regular',
147
+ ),
148
+ 'Alike Angular' =>
149
+ array(
150
+ 0 => 'regular',
151
+ ),
152
+ 'Allan' =>
153
+ array(
154
+ 0 => 'regular',
155
+ 1 => '700',
156
+ ),
157
+ 'Allerta' =>
158
+ array(
159
+ 0 => 'regular',
160
+ ),
161
+ 'Allerta Stencil' =>
162
+ array(
163
+ 0 => 'regular',
164
+ ),
165
+ 'Allura' =>
166
+ array(
167
+ 0 => 'regular',
168
+ ),
169
+ 'Almendra' =>
170
+ array(
171
+ 0 => 'regular',
172
+ 1 => 'italic',
173
+ 2 => '700',
174
+ 3 => '700italic',
175
+ ),
176
+ 'Almendra Display' =>
177
+ array(
178
+ 0 => 'regular',
179
+ ),
180
+ 'Almendra SC' =>
181
+ array(
182
+ 0 => 'regular',
183
+ ),
184
+ 'Amarante' =>
185
+ array(
186
+ 0 => 'regular',
187
+ ),
188
+ 'Amaranth' =>
189
+ array(
190
+ 0 => 'regular',
191
+ 1 => 'italic',
192
+ 2 => '700',
193
+ 3 => '700italic',
194
+ ),
195
+ 'Amatic SC' =>
196
+ array(
197
+ 0 => 'regular',
198
+ 1 => '700',
199
+ ),
200
+ 'Amethysta' =>
201
+ array(
202
+ 0 => 'regular',
203
+ ),
204
+ 'Amiko' =>
205
+ array(
206
+ 0 => 'regular',
207
+ 1 => '600',
208
+ 2 => '700',
209
+ ),
210
+ 'Amiri' =>
211
+ array(
212
+ 0 => 'regular',
213
+ 1 => 'italic',
214
+ 2 => '700',
215
+ 3 => '700italic',
216
+ ),
217
+ 'Amita' =>
218
+ array(
219
+ 0 => 'regular',
220
+ 1 => '700',
221
+ ),
222
+ 'Anaheim' =>
223
+ array(
224
+ 0 => 'regular',
225
+ ),
226
+ 'Andada' =>
227
+ array(
228
+ 0 => 'regular',
229
+ ),
230
+ 'Andika' =>
231
+ array(
232
+ 0 => 'regular',
233
+ ),
234
+ 'Angkor' =>
235
+ array(
236
+ 0 => 'regular',
237
+ ),
238
+ 'Annie Use Your Telescope' =>
239
+ array(
240
+ 0 => 'regular',
241
+ ),
242
+ 'Anonymous Pro' =>
243
+ array(
244
+ 0 => 'regular',
245
+ 1 => 'italic',
246
+ 2 => '700',
247
+ 3 => '700italic',
248
+ ),
249
+ 'Antic' =>
250
+ array(
251
+ 0 => 'regular',
252
+ ),
253
+ 'Antic Didone' =>
254
+ array(
255
+ 0 => 'regular',
256
+ ),
257
+ 'Antic Slab' =>
258
+ array(
259
+ 0 => 'regular',
260
+ ),
261
+ 'Anton' =>
262
+ array(
263
+ 0 => 'regular',
264
+ ),
265
+ 'Arapey' =>
266
+ array(
267
+ 0 => 'regular',
268
+ 1 => 'italic',
269
+ ),
270
+ 'Arbutus' =>
271
+ array(
272
+ 0 => 'regular',
273
+ ),
274
+ 'Arbutus Slab' =>
275
+ array(
276
+ 0 => 'regular',
277
+ ),
278
+ 'Architects Daughter' =>
279
+ array(
280
+ 0 => 'regular',
281
+ ),
282
+ 'Archivo' =>
283
+ array(
284
+ 0 => 'regular',
285
+ 1 => 'italic',
286
+ 2 => '500',
287
+ 3 => '500italic',
288
+ 4 => '600',
289
+ 5 => '600italic',
290
+ 6 => '700',
291
+ 7 => '700italic',
292
+ ),
293
+ 'Archivo Black' =>
294
+ array(
295
+ 0 => 'regular',
296
+ ),
297
+ 'Archivo Narrow' =>
298
+ array(
299
+ 0 => 'regular',
300
+ 1 => 'italic',
301
+ 2 => '500',
302
+ 3 => '500italic',
303
+ 4 => '600',
304
+ 5 => '600italic',
305
+ 6 => '700',
306
+ 7 => '700italic',
307
+ ),
308
+ 'Aref Ruqaa' =>
309
+ array(
310
+ 0 => 'regular',
311
+ 1 => '700',
312
+ ),
313
+ 'Arima Madurai' =>
314
+ array(
315
+ 0 => '100',
316
+ 1 => '200',
317
+ 2 => '300',
318
+ 3 => 'regular',
319
+ 4 => '500',
320
+ 5 => '700',
321
+ 6 => '800',
322
+ 7 => '900',
323
+ ),
324
+ 'Arimo' =>
325
+ array(
326
+ 0 => 'regular',
327
+ 1 => 'italic',
328
+ 2 => '700',
329
+ 3 => '700italic',
330
+ ),
331
+ 'Arizonia' =>
332
+ array(
333
+ 0 => 'regular',
334
+ ),
335
+ 'Armata' =>
336
+ array(
337
+ 0 => 'regular',
338
+ ),
339
+ 'Arsenal' =>
340
+ array(
341
+ 0 => 'regular',
342
+ 1 => 'italic',
343
+ 2 => '700',
344
+ 3 => '700italic',
345
+ ),
346
+ 'Artifika' =>
347
+ array(
348
+ 0 => 'regular',
349
+ ),
350
+ 'Arvo' =>
351
+ array(
352
+ 0 => 'regular',
353
+ 1 => 'italic',
354
+ 2 => '700',
355
+ 3 => '700italic',
356
+ ),
357
+ 'Arya' =>
358
+ array(
359
+ 0 => 'regular',
360
+ 1 => '700',
361
+ ),
362
+ 'Asap' =>
363
+ array(
364
+ 0 => 'regular',
365
+ 1 => 'italic',
366
+ 2 => '500',
367
+ 3 => '500italic',
368
+ 4 => '600',
369
+ 5 => '600italic',
370
+ 6 => '700',
371
+ 7 => '700italic',
372
+ ),
373
+ 'Asap Condensed' =>
374
+ array(
375
+ 0 => 'regular',
376
+ 1 => 'italic',
377
+ 2 => '500',
378
+ 3 => '500italic',
379
+ 4 => '600',
380
+ 5 => '600italic',
381
+ 6 => '700',
382
+ 7 => '700italic',
383
+ ),
384
+ 'Asar' =>
385
+ array(
386
+ 0 => 'regular',
387
+ ),
388
+ 'Asset' =>
389
+ array(
390
+ 0 => 'regular',
391
+ ),
392
+ 'Assistant' =>
393
+ array(
394
+ 0 => '200',
395
+ 1 => '300',
396
+ 2 => 'regular',
397
+ 3 => '600',
398
+ 4 => '700',
399
+ 5 => '800',
400
+ ),
401
+ 'Astloch' =>
402
+ array(
403
+ 0 => 'regular',
404
+ 1 => '700',
405
+ ),
406
+ 'Asul' =>
407
+ array(
408
+ 0 => 'regular',
409
+ 1 => '700',
410
+ ),
411
+ 'Athiti' =>
412
+ array(
413
+ 0 => '200',
414
+ 1 => '300',
415
+ 2 => 'regular',
416
+ 3 => '500',
417
+ 4 => '600',
418
+ 5 => '700',
419
+ ),
420
+ 'Atma' =>
421
+ array(
422
+ 0 => '300',
423
+ 1 => 'regular',
424
+ 2 => '500',
425
+ 3 => '600',
426
+ 4 => '700',
427
+ ),
428
+ 'Atomic Age' =>
429
+ array(
430
+ 0 => 'regular',
431
+ ),
432
+ 'Aubrey' =>
433
+ array(
434
+ 0 => 'regular',
435
+ ),
436
+ 'Audiowide' =>
437
+ array(
438
+ 0 => 'regular',
439
+ ),
440
+ 'Autour One' =>
441
+ array(
442
+ 0 => 'regular',
443
+ ),
444
+ 'Average' =>
445
+ array(
446
+ 0 => 'regular',
447
+ ),
448
+ 'Average Sans' =>
449
+ array(
450
+ 0 => 'regular',
451
+ ),
452
+ 'Averia Gruesa Libre' =>
453
+ array(
454
+ 0 => 'regular',
455
+ ),
456
+ 'Averia Libre' =>
457
+ array(
458
+ 0 => '300',
459
+ 1 => '300italic',
460
+ 2 => 'regular',
461
+ 3 => 'italic',
462
+ 4 => '700',
463
+ 5 => '700italic',
464
+ ),
465
+ 'Averia Sans Libre' =>
466
+ array(
467
+ 0 => '300',
468
+ 1 => '300italic',
469
+ 2 => 'regular',
470
+ 3 => 'italic',
471
+ 4 => '700',
472
+ 5 => '700italic',
473
+ ),
474
+ 'Averia Serif Libre' =>
475
+ array(
476
+ 0 => '300',
477
+ 1 => '300italic',
478
+ 2 => 'regular',
479
+ 3 => 'italic',
480
+ 4 => '700',
481
+ 5 => '700italic',
482
+ ),
483
+ 'Bad Script' =>
484
+ array(
485
+ 0 => 'regular',
486
+ ),
487
+ 'Bahiana' =>
488
+ array(
489
+ 0 => 'regular',
490
+ ),
491
+ 'Baloo' =>
492
+ array(
493
+ 0 => 'regular',
494
+ ),
495
+ 'Baloo Bhai' =>
496
+ array(
497
+ 0 => 'regular',
498
+ ),
499
+ 'Baloo Bhaijaan' =>
500
+ array(
501
+ 0 => 'regular',
502
+ ),
503
+ 'Baloo Bhaina' =>
504
+ array(
505
+ 0 => 'regular',
506
+ ),
507
+ 'Baloo Chettan' =>
508
+ array(
509
+ 0 => 'regular',
510
+ ),
511
+ 'Baloo Da' =>
512
+ array(
513
+ 0 => 'regular',
514
+ ),
515
+ 'Baloo Paaji' =>
516
+ array(
517
+ 0 => 'regular',
518
+ ),
519
+ 'Baloo Tamma' =>
520
+ array(
521
+ 0 => 'regular',
522
+ ),
523
+ 'Baloo Tammudu' =>
524
+ array(
525
+ 0 => 'regular',
526
+ ),
527
+ 'Baloo Thambi' =>
528
+ array(
529
+ 0 => 'regular',
530
+ ),
531
+ 'Balthazar' =>
532
+ array(
533
+ 0 => 'regular',
534
+ ),
535
+ 'Bangers' =>
536
+ array(
537
+ 0 => 'regular',
538
+ ),
539
+ 'Barlow' =>
540
+ array(
541
+ 0 => '100',
542
+ 1 => '100italic',
543
+ 2 => '200',
544
+ 3 => '200italic',
545
+ 4 => '300',
546
+ 5 => '300italic',
547
+ 6 => 'regular',
548
+ 7 => 'italic',
549
+ 8 => '500',
550
+ 9 => '500italic',
551
+ 10 => '600',
552
+ 11 => '600italic',
553
+ 12 => '700',
554
+ 13 => '700italic',
555
+ 14 => '800',
556
+ 15 => '800italic',
557
+ 16 => '900',
558
+ 17 => '900italic',
559
+ ),
560
+ 'Barlow Condensed' =>
561
+ array(
562
+ 0 => '100',
563
+ 1 => '100italic',
564
+ 2 => '200',
565
+ 3 => '200italic',
566
+ 4 => '300',
567
+ 5 => '300italic',
568
+ 6 => 'regular',
569
+ 7 => 'italic',
570
+ 8 => '500',
571
+ 9 => '500italic',
572
+ 10 => '600',
573
+ 11 => '600italic',
574
+ 12 => '700',
575
+ 13 => '700italic',
576
+ 14 => '800',
577
+ 15 => '800italic',
578
+ 16 => '900',
579
+ 17 => '900italic',
580
+ ),
581
+ 'Barlow Semi Condensed' =>
582
+ array(
583
+ 0 => '100',
584
+ 1 => '100italic',
585
+ 2 => '200',
586
+ 3 => '200italic',
587
+ 4 => '300',
588
+ 5 => '300italic',
589
+ 6 => 'regular',
590
+ 7 => 'italic',
591
+ 8 => '500',
592
+ 9 => '500italic',
593
+ 10 => '600',
594
+ 11 => '600italic',
595
+ 12 => '700',
596
+ 13 => '700italic',
597
+ 14 => '800',
598
+ 15 => '800italic',
599
+ 16 => '900',
600
+ 17 => '900italic',
601
+ ),
602
+ 'Barrio' =>
603
+ array(
604
+ 0 => 'regular',
605
+ ),
606
+ 'Basic' =>
607
+ array(
608
+ 0 => 'regular',
609
+ ),
610
+ 'Battambang' =>
611
+ array(
612
+ 0 => 'regular',
613
+ 1 => '700',
614
+ ),
615
+ 'Baumans' =>
616
+ array(
617
+ 0 => 'regular',
618
+ ),
619
+ 'Bayon' =>
620
+ array(
621
+ 0 => 'regular',
622
+ ),
623
+ 'Belgrano' =>
624
+ array(
625
+ 0 => 'regular',
626
+ ),
627
+ 'Bellefair' =>
628
+ array(
629
+ 0 => 'regular',
630
+ ),
631
+ 'Belleza' =>
632
+ array(
633
+ 0 => 'regular',
634
+ ),
635
+ 'BenchNine' =>
636
+ array(
637
+ 0 => '300',
638
+ 1 => 'regular',
639
+ 2 => '700',
640
+ ),
641
+ 'Bentham' =>
642
+ array(
643
+ 0 => 'regular',
644
+ ),
645
+ 'Berkshire Swash' =>
646
+ array(
647
+ 0 => 'regular',
648
+ ),
649
+ 'Bevan' =>
650
+ array(
651
+ 0 => 'regular',
652
+ ),
653
+ 'Bigelow Rules' =>
654
+ array(
655
+ 0 => 'regular',
656
+ ),
657
+ 'Bigshot One' =>
658
+ array(
659
+ 0 => 'regular',
660
+ ),
661
+ 'Bilbo' =>
662
+ array(
663
+ 0 => 'regular',
664
+ ),
665
+ 'Bilbo Swash Caps' =>
666
+ array(
667
+ 0 => 'regular',
668
+ ),
669
+ 'BioRhyme' =>
670
+ array(
671
+ 0 => '200',
672
+ 1 => '300',
673
+ 2 => 'regular',
674
+ 3 => '700',
675
+ 4 => '800',
676
+ ),
677
+ 'BioRhyme Expanded' =>
678
+ array(
679
+ 0 => '200',
680
+ 1 => '300',
681
+ 2 => 'regular',
682
+ 3 => '700',
683
+ 4 => '800',
684
+ ),
685
+ 'Biryani' =>
686
+ array(
687
+ 0 => '200',
688
+ 1 => '300',
689
+ 2 => 'regular',
690
+ 3 => '600',
691
+ 4 => '700',
692
+ 5 => '800',
693
+ 6 => '900',
694
+ ),
695
+ 'Bitter' =>
696
+ array(
697
+ 0 => 'regular',
698
+ 1 => 'italic',
699
+ 2 => '700',
700
+ ),
701
+ 'Black Ops One' =>
702
+ array(
703
+ 0 => 'regular',
704
+ ),
705
+ 'Bokor' =>
706
+ array(
707
+ 0 => 'regular',
708
+ ),
709
+ 'Bonbon' =>
710
+ array(
711
+ 0 => 'regular',
712
+ ),
713
+ 'Boogaloo' =>
714
+ array(
715
+ 0 => 'regular',
716
+ ),
717
+ 'Bowlby One' =>
718
+ array(
719
+ 0 => 'regular',
720
+ ),
721
+ 'Bowlby One SC' =>
722
+ array(
723
+ 0 => 'regular',
724
+ ),
725
+ 'Brawler' =>
726
+ array(
727
+ 0 => 'regular',
728
+ ),
729
+ 'Bree Serif' =>
730
+ array(
731
+ 0 => 'regular',
732
+ ),
733
+ 'Bubblegum Sans' =>
734
+ array(
735
+ 0 => 'regular',
736
+ ),
737
+ 'Bubbler One' =>
738
+ array(
739
+ 0 => 'regular',
740
+ ),
741
+ 'Buda' =>
742
+ array(
743
+ 0 => '300',
744
+ ),
745
+ 'Buenard' =>
746
+ array(
747
+ 0 => 'regular',
748
+ 1 => '700',
749
+ ),
750
+ 'Bungee' =>
751
+ array(
752
+ 0 => 'regular',
753
+ ),
754
+ 'Bungee Hairline' =>
755
+ array(
756
+ 0 => 'regular',
757
+ ),
758
+ 'Bungee Inline' =>
759
+ array(
760
+ 0 => 'regular',
761
+ ),
762
+ 'Bungee Outline' =>
763
+ array(
764
+ 0 => 'regular',
765
+ ),
766
+ 'Bungee Shade' =>
767
+ array(
768
+ 0 => 'regular',
769
+ ),
770
+ 'Butcherman' =>
771
+ array(
772
+ 0 => 'regular',
773
+ ),
774
+ 'Butterfly Kids' =>
775
+ array(
776
+ 0 => 'regular',
777
+ ),
778
+ 'Cabin' =>
779
+ array(
780
+ 0 => 'regular',
781
+ 1 => 'italic',
782
+ 2 => '500',
783
+ 3 => '500italic',
784
+ 4 => '600',
785
+ 5 => '600italic',
786
+ 6 => '700',
787
+ 7 => '700italic',
788
+ ),
789
+ 'Cabin Condensed' =>
790
+ array(
791
+ 0 => 'regular',
792
+ 1 => '500',
793
+ 2 => '600',
794
+ 3 => '700',
795
+ ),
796
+ 'Cabin Sketch' =>
797
+ array(
798
+ 0 => 'regular',
799
+ 1 => '700',
800
+ ),
801
+ 'Caesar Dressing' =>
802
+ array(
803
+ 0 => 'regular',
804
+ ),
805
+ 'Cagliostro' =>
806
+ array(
807
+ 0 => 'regular',
808
+ ),
809
+ 'Cairo' =>
810
+ array(
811
+ 0 => '200',
812
+ 1 => '300',
813
+ 2 => 'regular',
814
+ 3 => '600',
815
+ 4 => '700',
816
+ 5 => '900',
817
+ ),
818
+ 'Calligraffitti' =>
819
+ array(
820
+ 0 => 'regular',
821
+ ),
822
+ 'Cambay' =>
823
+ array(
824
+ 0 => 'regular',
825
+ 1 => 'italic',
826
+ 2 => '700',
827
+ 3 => '700italic',
828
+ ),
829
+ 'Cambo' =>
830
+ array(
831
+ 0 => 'regular',
832
+ ),
833
+ 'Candal' =>
834
+ array(
835
+ 0 => 'regular',
836
+ ),
837
+ 'Cantarell' =>
838
+ array(
839
+ 0 => 'regular',
840
+ 1 => 'italic',
841
+ 2 => '700',
842
+ 3 => '700italic',
843
+ ),
844
+ 'Cantata One' =>
845
+ array(
846
+ 0 => 'regular',
847
+ ),
848
+ 'Cantora One' =>
849
+ array(
850
+ 0 => 'regular',
851
+ ),
852
+ 'Capriola' =>
853
+ array(
854
+ 0 => 'regular',
855
+ ),
856
+ 'Cardo' =>
857
+ array(
858
+ 0 => 'regular',
859
+ 1 => 'italic',
860
+ 2 => '700',
861
+ ),
862
+ 'Carme' =>
863
+ array(
864
+ 0 => 'regular',
865
+ ),
866
+ 'Carrois Gothic' =>
867
+ array(
868
+ 0 => 'regular',
869
+ ),
870
+ 'Carrois Gothic SC' =>
871
+ array(
872
+ 0 => 'regular',
873
+ ),
874
+ 'Carter One' =>
875
+ array(
876
+ 0 => 'regular',
877
+ ),
878
+ 'Catamaran' =>
879
+ array(
880
+ 0 => '100',
881
+ 1 => '200',
882
+ 2 => '300',
883
+ 3 => 'regular',
884
+ 4 => '500',
885
+ 5 => '600',
886
+ 6 => '700',
887
+ 7 => '800',
888
+ 8 => '900',
889
+ ),
890
+ 'Caudex' =>
891
+ array(
892
+ 0 => 'regular',
893
+ 1 => 'italic',
894
+ 2 => '700',
895
+ 3 => '700italic',
896
+ ),
897
+ 'Caveat' =>
898
+ array(
899
+ 0 => 'regular',
900
+ 1 => '700',
901
+ ),
902
+ 'Caveat Brush' =>
903
+ array(
904
+ 0 => 'regular',
905
+ ),
906
+ 'Cedarville Cursive' =>
907
+ array(
908
+ 0 => 'regular',
909
+ ),
910
+ 'Ceviche One' =>
911
+ array(
912
+ 0 => 'regular',
913
+ ),
914
+ 'Changa' =>
915
+ array(
916
+ 0 => '200',
917
+ 1 => '300',
918
+ 2 => 'regular',
919
+ 3 => '500',
920
+ 4 => '600',
921
+ 5 => '700',
922
+ 6 => '800',
923
+ ),
924
+ 'Changa One' =>
925
+ array(
926
+ 0 => 'regular',
927
+ 1 => 'italic',
928
+ ),
929
+ 'Chango' =>
930
+ array(
931
+ 0 => 'regular',
932
+ ),
933
+ 'Chathura' =>
934
+ array(
935
+ 0 => '100',
936
+ 1 => '300',
937
+ 2 => 'regular',
938
+ 3 => '700',
939
+ 4 => '800',
940
+ ),
941
+ 'Chau Philomene One' =>
942
+ array(
943
+ 0 => 'regular',
944
+ 1 => 'italic',
945
+ ),
946
+ 'Chela One' =>
947
+ array(
948
+ 0 => 'regular',
949
+ ),
950
+ 'Chelsea Market' =>
951
+ array(
952
+ 0 => 'regular',
953
+ ),
954
+ 'Chenla' =>
955
+ array(
956
+ 0 => 'regular',
957
+ ),
958
+ 'Cherry Cream Soda' =>
959
+ array(
960
+ 0 => 'regular',
961
+ ),
962
+ 'Cherry Swash' =>
963
+ array(
964
+ 0 => 'regular',
965
+ 1 => '700',
966
+ ),
967
+ 'Chewy' =>
968
+ array(
969
+ 0 => 'regular',
970
+ ),
971
+ 'Chicle' =>
972
+ array(
973
+ 0 => 'regular',
974
+ ),
975
+ 'Chivo' =>
976
+ array(
977
+ 0 => '300',
978
+ 1 => '300italic',
979
+ 2 => 'regular',
980
+ 3 => 'italic',
981
+ 4 => '700',
982
+ 5 => '700italic',
983
+ 6 => '900',
984
+ 7 => '900italic',
985
+ ),
986
+ 'Chonburi' =>
987
+ array(
988
+ 0 => 'regular',
989
+ ),
990
+ 'Cinzel' =>
991
+ array(
992
+ 0 => 'regular',
993
+ 1 => '700',
994
+ 2 => '900',
995
+ ),
996
+ 'Cinzel Decorative' =>
997
+ array(
998
+ 0 => 'regular',
999
+ 1 => '700',
1000
+ 2 => '900',
1001
+ ),
1002
+ 'Clicker Script' =>
1003
+ array(
1004
+ 0 => 'regular',
1005
+ ),
1006
+ 'Coda' =>
1007
+ array(
1008
+ 0 => 'regular',
1009
+ 1 => '800',
1010
+ ),
1011
+ 'Coda Caption' =>
1012
+ array(
1013
+ 0 => '800',
1014
+ ),
1015
+ 'Codystar' =>
1016
+ array(
1017
+ 0 => '300',
1018
+ 1 => 'regular',
1019
+ ),
1020
+ 'Coiny' =>
1021
+ array(
1022
+ 0 => 'regular',
1023
+ ),
1024
+ 'Combo' =>
1025
+ array(
1026
+ 0 => 'regular',
1027
+ ),
1028
+ 'Comfortaa' =>
1029
+ array(
1030
+ 0 => '300',
1031
+ 1 => 'regular',
1032
+ 2 => '700',
1033
+ ),
1034
+ 'Coming Soon' =>
1035
+ array(
1036
+ 0 => 'regular',
1037
+ ),
1038
+ 'Concert One' =>
1039
+ array(
1040
+ 0 => 'regular',
1041
+ ),
1042
+ 'Condiment' =>
1043
+ array(
1044
+ 0 => 'regular',
1045
+ ),
1046
+ 'Content' =>
1047
+ array(
1048
+ 0 => 'regular',
1049
+ 1 => '700',
1050
+ ),
1051
+ 'Contrail One' =>
1052
+ array(
1053
+ 0 => 'regular',
1054
+ ),
1055
+ 'Convergence' =>
1056
+ array(
1057
+ 0 => 'regular',
1058
+ ),
1059
+ 'Cookie' =>
1060
+ array(
1061
+ 0 => 'regular',
1062
+ ),
1063
+ 'Copse' =>
1064
+ array(
1065
+ 0 => 'regular',
1066
+ ),
1067
+ 'Corben' =>
1068
+ array(
1069
+ 0 => 'regular',
1070
+ 1 => '700',
1071
+ ),
1072
+ 'Cormorant' =>
1073
+ array(
1074
+ 0 => '300',
1075
+ 1 => '300italic',
1076
+ 2 => 'regular',
1077
+ 3 => 'italic',
1078
+ 4 => '500',
1079
+ 5 => '500italic',
1080
+ 6 => '600',
1081
+ 7 => '600italic',
1082
+ 8 => '700',
1083
+ 9 => '700italic',
1084
+ ),
1085
+ 'Cormorant Garamond' =>
1086
+ array(
1087
+ 0 => '300',
1088
+ 1 => '300italic',
1089
+ 2 => 'regular',
1090
+ 3 => 'italic',
1091
+ 4 => '500',
1092
+ 5 => '500italic',
1093
+ 6 => '600',
1094
+ 7 => '600italic',
1095
+ 8 => '700',
1096
+ 9 => '700italic',
1097
+ ),
1098
+ 'Cormorant Infant' =>
1099
+ array(
1100
+ 0 => '300',
1101
+ 1 => '300italic',
1102
+ 2 => 'regular',
1103
+ 3 => 'italic',
1104
+ 4 => '500',
1105
+ 5 => '500italic',
1106
+ 6 => '600',
1107
+ 7 => '600italic',
1108
+ 8 => '700',
1109
+ 9 => '700italic',
1110
+ ),
1111
+ 'Cormorant SC' =>
1112
+ array(
1113
+ 0 => '300',
1114
+ 1 => 'regular',
1115
+ 2 => '500',
1116
+ 3 => '600',
1117
+ 4 => '700',
1118
+ ),
1119
+ 'Cormorant Unicase' =>
1120
+ array(
1121
+ 0 => '300',
1122
+ 1 => 'regular',
1123
+ 2 => '500',
1124
+ 3 => '600',
1125
+ 4 => '700',
1126
+ ),
1127
+ 'Cormorant Upright' =>
1128
+ array(
1129
+ 0 => '300',
1130
+ 1 => 'regular',
1131
+ 2 => '500',
1132
+ 3 => '600',
1133
+ 4 => '700',
1134
+ ),
1135
+ 'Courgette' =>
1136
+ array(
1137
+ 0 => 'regular',
1138
+ ),
1139
+ 'Cousine' =>
1140
+ array(
1141
+ 0 => 'regular',
1142
+ 1 => 'italic',
1143
+ 2 => '700',
1144
+ 3 => '700italic',
1145
+ ),
1146
+ 'Coustard' =>
1147
+ array(
1148
+ 0 => 'regular',
1149
+ 1 => '900',
1150
+ ),
1151
+ 'Covered By Your Grace' =>
1152
+ array(
1153
+ 0 => 'regular',
1154
+ ),
1155
+ 'Crafty Girls' =>
1156
+ array(
1157
+ 0 => 'regular',
1158
+ ),
1159
+ 'Creepster' =>
1160
+ array(
1161
+ 0 => 'regular',
1162
+ ),
1163
+ 'Crete Round' =>
1164
+ array(
1165
+ 0 => 'regular',
1166
+ 1 => 'italic',
1167
+ ),
1168
+ 'Crimson Text' =>
1169
+ array(
1170
+ 0 => 'regular',
1171
+ 1 => 'italic',
1172
+ 2 => '600',
1173
+ 3 => '600italic',
1174
+ 4 => '700',
1175
+ 5 => '700italic',
1176
+ ),
1177
+ 'Croissant One' =>
1178
+ array(
1179
+ 0 => 'regular',
1180
+ ),
1181
+ 'Crushed' =>
1182
+ array(
1183
+ 0 => 'regular',
1184
+ ),
1185
+ 'Cuprum' =>
1186
+ array(
1187
+ 0 => 'regular',
1188
+ 1 => 'italic',
1189
+ 2 => '700',
1190
+ 3 => '700italic',
1191
+ ),
1192
+ 'Cutive' =>
1193
+ array(
1194
+ 0 => 'regular',
1195
+ ),
1196
+ 'Cutive Mono' =>
1197
+ array(
1198
+ 0 => 'regular',
1199
+ ),
1200
+ 'Damion' =>
1201
+ array(
1202
+ 0 => 'regular',
1203
+ ),
1204
+ 'Dancing Script' =>
1205
+ array(
1206
+ 0 => 'regular',
1207
+ 1 => '700',
1208
+ ),
1209
+ 'Dangrek' =>
1210
+ array(
1211
+ 0 => 'regular',
1212
+ ),
1213
+ 'David Libre' =>
1214
+ array(
1215
+ 0 => 'regular',
1216
+ 1 => '500',
1217
+ 2 => '700',
1218
+ ),
1219
+ 'Dawning of a New Day' =>
1220
+ array(
1221
+ 0 => 'regular',
1222
+ ),
1223
+ 'Days One' =>
1224
+ array(
1225
+ 0 => 'regular',
1226
+ ),
1227
+ 'Dekko' =>
1228
+ array(
1229
+ 0 => 'regular',
1230
+ ),
1231
+ 'Delius' =>
1232
+ array(
1233
+ 0 => 'regular',
1234
+ ),
1235
+ 'Delius Swash Caps' =>
1236
+ array(
1237
+ 0 => 'regular',
1238
+ ),
1239
+ 'Delius Unicase' =>
1240
+ array(
1241
+ 0 => 'regular',
1242
+ 1 => '700',
1243
+ ),
1244
+ 'Della Respira' =>
1245
+ array(
1246
+ 0 => 'regular',
1247
+ ),
1248
+ 'Denk One' =>
1249
+ array(
1250
+ 0 => 'regular',
1251
+ ),
1252
+ 'Devonshire' =>
1253
+ array(
1254
+ 0 => 'regular',
1255
+ ),
1256
+ 'Dhurjati' =>
1257
+ array(
1258
+ 0 => 'regular',
1259
+ ),
1260
+ 'Didact Gothic' =>
1261
+ array(
1262
+ 0 => 'regular',
1263
+ ),
1264
+ 'Diplomata' =>
1265
+ array(
1266
+ 0 => 'regular',
1267
+ ),
1268
+ 'Diplomata SC' =>
1269
+ array(
1270
+ 0 => 'regular',
1271
+ ),
1272
+ 'Domine' =>
1273
+ array(
1274
+ 0 => 'regular',
1275
+ 1 => '700',
1276
+ ),
1277
+ 'Donegal One' =>
1278
+ array(
1279
+ 0 => 'regular',
1280
+ ),
1281
+ 'Doppio One' =>
1282
+ array(
1283
+ 0 => 'regular',
1284
+ ),
1285
+ 'Dorsa' =>
1286
+ array(
1287
+ 0 => 'regular',
1288
+ ),
1289
+ 'Dosis' =>
1290
+ array(
1291
+ 0 => '200',
1292
+ 1 => '300',
1293
+ 2 => 'regular',
1294
+ 3 => '500',
1295
+ 4 => '600',
1296
+ 5 => '700',
1297
+ 6 => '800',
1298
+ ),
1299
+ 'Dr Sugiyama' =>
1300
+ array(
1301
+ 0 => 'regular',
1302
+ ),
1303
+ 'Duru Sans' =>
1304
+ array(
1305
+ 0 => 'regular',
1306
+ ),
1307
+ 'Dynalight' =>
1308
+ array(
1309
+ 0 => 'regular',
1310
+ ),
1311
+ 'EB Garamond' =>
1312
+ array(
1313
+ 0 => 'regular',
1314
+ 1 => 'italic',
1315
+ 2 => '500',
1316
+ 3 => '500italic',
1317
+ 4 => '600',
1318
+ 5 => '600italic',
1319
+ 6 => '700',
1320
+ 7 => '700italic',
1321
+ 8 => '800',
1322
+ 9 => '800italic',
1323
+ ),
1324
+ 'Eagle Lake' =>
1325
+ array(
1326
+ 0 => 'regular',
1327
+ ),
1328
+ 'Eater' =>
1329
+ array(
1330
+ 0 => 'regular',
1331
+ ),
1332
+ 'Economica' =>
1333
+ array(
1334
+ 0 => 'regular',
1335
+ 1 => 'italic',
1336
+ 2 => '700',
1337
+ 3 => '700italic',
1338
+ ),
1339
+ 'Eczar' =>
1340
+ array(
1341
+ 0 => 'regular',
1342
+ 1 => '500',
1343
+ 2 => '600',
1344
+ 3 => '700',
1345
+ 4 => '800',
1346
+ ),
1347
+ 'El Messiri' =>
1348
+ array(
1349
+ 0 => 'regular',
1350
+ 1 => '500',
1351
+ 2 => '600',
1352
+ 3 => '700',
1353
+ ),
1354
+ 'Electrolize' =>
1355
+ array(
1356
+ 0 => 'regular',
1357
+ ),
1358
+ 'Elsie' =>
1359
+ array(
1360
+ 0 => 'regular',
1361
+ 1 => '900',
1362
+ ),
1363
+ 'Elsie Swash Caps' =>
1364
+ array(
1365
+ 0 => 'regular',
1366
+ 1 => '900',
1367
+ ),
1368
+ 'Emblema One' =>
1369
+ array(
1370
+ 0 => 'regular',
1371
+ ),
1372
+ 'Emilys Candy' =>
1373
+ array(
1374
+ 0 => 'regular',
1375
+ ),
1376
+ 'Encode Sans' =>
1377
+ array(
1378
+ 0 => '100',
1379
+ 1 => '200',
1380
+ 2 => '300',
1381
+ 3 => 'regular',
1382
+ 4 => '500',
1383
+ 5 => '600',
1384
+ 6 => '700',
1385
+ 7 => '800',
1386
+ 8 => '900',
1387
+ ),
1388
+ 'Encode Sans Condensed' =>
1389
+ array(
1390
+ 0 => '100',
1391
+ 1 => '200',
1392
+ 2 => '300',
1393
+ 3 => 'regular',
1394
+ 4 => '500',
1395
+ 5 => '600',
1396
+ 6 => '700',
1397
+ 7 => '800',
1398
+ 8 => '900',
1399
+ ),
1400
+ 'Encode Sans Expanded' =>
1401
+ array(
1402
+ 0 => '100',
1403
+ 1 => '200',
1404
+ 2 => '300',
1405
+ 3 => 'regular',
1406
+ 4 => '500',
1407
+ 5 => '600',
1408
+ 6 => '700',
1409
+ 7 => '800',
1410
+ 8 => '900',
1411
+ ),
1412
+ 'Encode Sans Semi Condensed' =>
1413
+ array(
1414
+ 0 => '100',
1415
+ 1 => '200',
1416
+ 2 => '300',
1417
+ 3 => 'regular',
1418
+ 4 => '500',
1419
+ 5 => '600',
1420
+ 6 => '700',
1421
+ 7 => '800',
1422
+ 8 => '900',
1423
+ ),
1424
+ 'Encode Sans Semi Expanded' =>
1425
+ array(
1426
+ 0 => '100',
1427
+ 1 => '200',
1428
+ 2 => '300',
1429
+ 3 => 'regular',
1430
+ 4 => '500',
1431
+ 5 => '600',
1432
+ 6 => '700',
1433
+ 7 => '800',
1434
+ 8 => '900',
1435
+ ),
1436
+ 'Engagement' =>
1437
+ array(
1438
+ 0 => 'regular',
1439
+ ),
1440
+ 'Englebert' =>
1441
+ array(
1442
+ 0 => 'regular',
1443
+ ),
1444
+ 'Enriqueta' =>
1445
+ array(
1446
+ 0 => 'regular',
1447
+ 1 => '700',
1448
+ ),
1449
+ 'Erica One' =>
1450
+ array(
1451
+ 0 => 'regular',
1452
+ ),
1453
+ 'Esteban' =>
1454
+ array(
1455
+ 0 => 'regular',
1456
+ ),
1457
+ 'Euphoria Script' =>
1458
+ array(
1459
+ 0 => 'regular',
1460
+ ),
1461
+ 'Ewert' =>
1462
+ array(
1463
+ 0 => 'regular',
1464
+ ),
1465
+ 'Exo' =>
1466
+ array(
1467
+ 0 => '100',
1468
+ 1 => '100italic',
1469
+ 2 => '200',
1470
+ 3 => '200italic',
1471
+ 4 => '300',
1472
+ 5 => '300italic',
1473
+ 6 => 'regular',
1474
+ 7 => 'italic',
1475
+ 8 => '500',
1476
+ 9 => '500italic',
1477
+ 10 => '600',
1478
+ 11 => '600italic',
1479
+ 12 => '700',
1480
+ 13 => '700italic',
1481
+ 14 => '800',
1482
+ 15 => '800italic',
1483
+ 16 => '900',
1484
+ 17 => '900italic',
1485
+ ),
1486
+ 'Exo 2' =>
1487
+ array(
1488
+ 0 => '100',
1489
+ 1 => '100italic',
1490
+ 2 => '200',
1491
+ 3 => '200italic',
1492
+ 4 => '300',
1493
+ 5 => '300italic',
1494
+ 6 => 'regular',
1495
+ 7 => 'italic',
1496
+ 8 => '500',
1497
+ 9 => '500italic',
1498
+ 10 => '600',
1499
+ 11 => '600italic',
1500
+ 12 => '700',
1501
+ 13 => '700italic',
1502
+ 14 => '800',
1503
+ 15 => '800italic',
1504
+ 16 => '900',
1505
+ 17 => '900italic',
1506
+ ),
1507
+ 'Expletus Sans' =>
1508
+ array(
1509
+ 0 => 'regular',
1510
+ 1 => 'italic',
1511
+ 2 => '500',
1512
+ 3 => '500italic',
1513
+ 4 => '600',
1514
+ 5 => '600italic',
1515
+ 6 => '700',
1516
+ 7 => '700italic',
1517
+ ),
1518
+ 'Fanwood Text' =>
1519
+ array(
1520
+ 0 => 'regular',
1521
+ 1 => 'italic',
1522
+ ),
1523
+ 'Farsan' =>
1524
+ array(
1525
+ 0 => 'regular',
1526
+ ),
1527
+ 'Fascinate' =>
1528
+ array(
1529
+ 0 => 'regular',
1530
+ ),
1531
+ 'Fascinate Inline' =>
1532
+ array(
1533
+ 0 => 'regular',
1534
+ ),
1535
+ 'Faster One' =>
1536
+ array(
1537
+ 0 => 'regular',
1538
+ ),
1539
+ 'Fasthand' =>
1540
+ array(
1541
+ 0 => 'regular',
1542
+ ),
1543
+ 'Fauna One' =>
1544
+ array(
1545
+ 0 => 'regular',
1546
+ ),
1547
+ 'Faustina' =>
1548
+ array(
1549
+ 0 => 'regular',
1550
+ 1 => 'italic',
1551
+ 2 => '500',
1552
+ 3 => '500italic',
1553
+ 4 => '600',
1554
+ 5 => '600italic',
1555
+ 6 => '700',
1556
+ 7 => '700italic',
1557
+ ),
1558
+ 'Federant' =>
1559
+ array(
1560
+ 0 => 'regular',
1561
+ ),
1562
+ 'Federo' =>
1563
+ array(
1564
+ 0 => 'regular',
1565
+ ),
1566
+ 'Felipa' =>
1567
+ array(
1568
+ 0 => 'regular',
1569
+ ),
1570
+ 'Fenix' =>
1571
+ array(
1572
+ 0 => 'regular',
1573
+ ),
1574
+ 'Finger Paint' =>
1575
+ array(
1576
+ 0 => 'regular',
1577
+ ),
1578
+ 'Fira Mono' =>
1579
+ array(
1580
+ 0 => 'regular',
1581
+ 1 => '500',
1582
+ 2 => '700',
1583
+ ),
1584
+ 'Fira Sans' =>
1585
+ array(
1586
+ 0 => '100',
1587
+ 1 => '100italic',
1588
+ 2 => '200',
1589
+ 3 => '200italic',
1590
+ 4 => '300',
1591
+ 5 => '300italic',
1592
+ 6 => 'regular',
1593
+ 7 => 'italic',
1594
+ 8 => '500',
1595
+ 9 => '500italic',
1596
+ 10 => '600',
1597
+ 11 => '600italic',
1598
+ 12 => '700',
1599
+ 13 => '700italic',
1600
+ 14 => '800',
1601
+ 15 => '800italic',
1602
+ 16 => '900',
1603
+ 17 => '900italic',
1604
+ ),
1605
+ 'Fira Sans Condensed' =>
1606
+ array(
1607
+ 0 => '100',
1608
+ 1 => '100italic',
1609
+ 2 => '200',
1610
+ 3 => '200italic',
1611
+ 4 => '300',
1612
+ 5 => '300italic',
1613
+ 6 => 'regular',
1614
+ 7 => 'italic',
1615
+ 8 => '500',
1616
+ 9 => '500italic',
1617
+ 10 => '600',
1618
+ 11 => '600italic',
1619
+ 12 => '700',
1620
+ 13 => '700italic',
1621
+ 14 => '800',
1622
+ 15 => '800italic',
1623
+ 16 => '900',
1624
+ 17 => '900italic',
1625
+ ),
1626
+ 'Fira Sans Extra Condensed' =>
1627
+ array(
1628
+ 0 => '100',
1629
+ 1 => '100italic',
1630
+ 2 => '200',
1631
+ 3 => '200italic',
1632
+ 4 => '300',
1633
+ 5 => '300italic',
1634
+ 6 => 'regular',
1635
+ 7 => 'italic',
1636
+ 8 => '500',
1637
+ 9 => '500italic',
1638
+ 10 => '600',
1639
+ 11 => '600italic',
1640
+ 12 => '700',
1641
+ 13 => '700italic',
1642
+ 14 => '800',
1643
+ 15 => '800italic',
1644
+ 16 => '900',
1645
+ 17 => '900italic',
1646
+ ),
1647
+ 'Fjalla One' =>
1648
+ array(
1649
+ 0 => 'regular',
1650
+ ),
1651
+ 'Fjord One' =>
1652
+ array(
1653
+ 0 => 'regular',
1654
+ ),
1655
+ 'Flamenco' =>
1656
+ array(
1657
+ 0 => '300',
1658
+ 1 => 'regular',
1659
+ ),
1660
+ 'Flavors' =>
1661
+ array(
1662
+ 0 => 'regular',
1663
+ ),
1664
+ 'Fondamento' =>
1665
+ array(
1666
+ 0 => 'regular',
1667
+ 1 => 'italic',
1668
+ ),
1669
+ 'Fontdiner Swanky' =>
1670
+ array(
1671
+ 0 => 'regular',
1672
+ ),
1673
+ 'Forum' =>
1674
+ array(
1675
+ 0 => 'regular',
1676
+ ),
1677
+ 'Francois One' =>
1678
+ array(
1679
+ 0 => 'regular',
1680
+ ),
1681
+ 'Frank Ruhl Libre' =>
1682
+ array(
1683
+ 0 => '300',
1684
+ 1 => 'regular',
1685
+ 2 => '500',
1686
+ 3 => '700',
1687
+ 4 => '900',
1688
+ ),
1689
+ 'Freckle Face' =>
1690
+ array(
1691
+ 0 => 'regular',
1692
+ ),
1693
+ 'Fredericka the Great' =>
1694
+ array(
1695
+ 0 => 'regular',
1696
+ ),
1697
+ 'Fredoka One' =>
1698
+ array(
1699
+ 0 => 'regular',
1700
+ ),
1701
+ 'Freehand' =>
1702
+ array(
1703
+ 0 => 'regular',
1704
+ ),
1705
+ 'Fresca' =>
1706
+ array(
1707
+ 0 => 'regular',
1708
+ ),
1709
+ 'Frijole' =>
1710
+ array(
1711
+ 0 => 'regular',
1712
+ ),
1713
+ 'Fruktur' =>
1714
+ array(
1715
+ 0 => 'regular',
1716
+ ),
1717
+ 'Fugaz One' =>
1718
+ array(
1719
+ 0 => 'regular',
1720
+ ),
1721
+ 'GFS Didot' =>
1722
+ array(
1723
+ 0 => 'regular',
1724
+ ),
1725
+ 'GFS Neohellenic' =>
1726
+ array(
1727
+ 0 => 'regular',
1728
+ 1 => 'italic',
1729
+ 2 => '700',
1730
+ 3 => '700italic',
1731
+ ),
1732
+ 'Gabriela' =>
1733
+ array(
1734
+ 0 => 'regular',
1735
+ ),
1736
+ 'Gafata' =>
1737
+ array(
1738
+ 0 => 'regular',
1739
+ ),
1740
+ 'Galada' =>
1741
+ array(
1742
+ 0 => 'regular',
1743
+ ),
1744
+ 'Galdeano' =>
1745
+ array(
1746
+ 0 => 'regular',
1747
+ ),
1748
+ 'Galindo' =>
1749
+ array(
1750
+ 0 => 'regular',
1751
+ ),
1752
+ 'Gentium Basic' =>
1753
+ array(
1754
+ 0 => 'regular',
1755
+ 1 => 'italic',
1756
+ 2 => '700',
1757
+ 3 => '700italic',
1758
+ ),
1759
+ 'Gentium Book Basic' =>
1760
+ array(
1761
+ 0 => 'regular',
1762
+ 1 => 'italic',
1763
+ 2 => '700',
1764
+ 3 => '700italic',
1765
+ ),
1766
+ 'Geo' =>
1767
+ array(
1768
+ 0 => 'regular',
1769
+ 1 => 'italic',
1770
+ ),
1771
+ 'Geostar' =>
1772
+ array(
1773
+ 0 => 'regular',
1774
+ ),
1775
+ 'Geostar Fill' =>
1776
+ array(
1777
+ 0 => 'regular',
1778
+ ),
1779
+ 'Germania One' =>
1780
+ array(
1781
+ 0 => 'regular',
1782
+ ),
1783
+ 'Gidugu' =>
1784
+ array(
1785
+ 0 => 'regular',
1786
+ ),
1787
+ 'Gilda Display' =>
1788
+ array(
1789
+ 0 => 'regular',
1790
+ ),
1791
+ 'Give You Glory' =>
1792
+ array(
1793
+ 0 => 'regular',
1794
+ ),
1795
+ 'Glass Antiqua' =>
1796
+ array(
1797
+ 0 => 'regular',
1798
+ ),
1799
+ 'Glegoo' =>
1800
+ array(
1801
+ 0 => 'regular',
1802
+ 1 => '700',
1803
+ ),
1804
+ 'Gloria Hallelujah' =>
1805
+ array(
1806
+ 0 => 'regular',
1807
+ ),
1808
+ 'Goblin One' =>
1809
+ array(
1810
+ 0 => 'regular',
1811
+ ),
1812
+ 'Gochi Hand' =>
1813
+ array(
1814
+ 0 => 'regular',
1815
+ ),
1816
+ 'Gorditas' =>
1817
+ array(
1818
+ 0 => 'regular',
1819
+ 1 => '700',
1820
+ ),
1821
+ 'Goudy Bookletter 1911' =>
1822
+ array(
1823
+ 0 => 'regular',
1824
+ ),
1825
+ 'Graduate' =>
1826
+ array(
1827
+ 0 => 'regular',
1828
+ ),
1829
+ 'Grand Hotel' =>
1830
+ array(
1831
+ 0 => 'regular',
1832
+ ),
1833
+ 'Gravitas One' =>
1834
+ array(
1835
+ 0 => 'regular',
1836
+ ),
1837
+ 'Great Vibes' =>
1838
+ array(
1839
+ 0 => 'regular',
1840
+ ),
1841
+ 'Griffy' =>
1842
+ array(
1843
+ 0 => 'regular',
1844
+ ),
1845
+ 'Gruppo' =>
1846
+ array(
1847
+ 0 => 'regular',
1848
+ ),
1849
+ 'Gudea' =>
1850
+ array(
1851
+ 0 => 'regular',
1852
+ 1 => 'italic',
1853
+ 2 => '700',
1854
+ ),
1855
+ 'Gurajada' =>
1856
+ array(
1857
+ 0 => 'regular',
1858
+ ),
1859
+ 'Habibi' =>
1860
+ array(
1861
+ 0 => 'regular',
1862
+ ),
1863
+ 'Halant' =>
1864
+ array(
1865
+ 0 => '300',
1866
+ 1 => 'regular',
1867
+ 2 => '500',
1868
+ 3 => '600',
1869
+ 4 => '700',
1870
+ ),
1871
+ 'Hammersmith One' =>
1872
+ array(
1873
+ 0 => 'regular',
1874
+ ),
1875
+ 'Hanalei' =>
1876
+ array(
1877
+ 0 => 'regular',
1878
+ ),
1879
+ 'Hanalei Fill' =>
1880
+ array(
1881
+ 0 => 'regular',
1882
+ ),
1883
+ 'Handlee' =>
1884
+ array(
1885
+ 0 => 'regular',
1886
+ ),
1887
+ 'Hanuman' =>
1888
+ array(
1889
+ 0 => 'regular',
1890
+ 1 => '700',
1891
+ ),
1892
+ 'Happy Monkey' =>
1893
+ array(
1894
+ 0 => 'regular',
1895
+ ),
1896
+ 'Harmattan' =>
1897
+ array(
1898
+ 0 => 'regular',
1899
+ ),
1900
+ 'Headland One' =>
1901
+ array(
1902
+ 0 => 'regular',
1903
+ ),
1904
+ 'Heebo' =>
1905
+ array(
1906
+ 0 => '100',
1907
+ 1 => '300',
1908
+ 2 => 'regular',
1909
+ 3 => '500',
1910
+ 4 => '700',
1911
+ 5 => '800',
1912
+ 6 => '900',
1913
+ ),
1914
+ 'Henny Penny' =>
1915
+ array(
1916
+ 0 => 'regular',
1917
+ ),
1918
+ 'Herr Von Muellerhoff' =>
1919
+ array(
1920
+ 0 => 'regular',
1921
+ ),
1922
+ 'Hind' =>
1923
+ array(
1924
+ 0 => '300',
1925
+ 1 => 'regular',
1926
+ 2 => '500',
1927
+ 3 => '600',
1928
+ 4 => '700',
1929
+ ),
1930
+ 'Hind Guntur' =>
1931
+ array(
1932
+ 0 => '300',
1933
+ 1 => 'regular',
1934
+ 2 => '500',
1935
+ 3 => '600',
1936
+ 4 => '700',
1937
+ ),
1938
+ 'Hind Madurai' =>
1939
+ array(
1940
+ 0 => '300',
1941
+ 1 => 'regular',
1942
+ 2 => '500',
1943
+ 3 => '600',
1944
+ 4 => '700',
1945
+ ),
1946
+ 'Hind Siliguri' =>
1947
+ array(
1948
+ 0 => '300',
1949
+ 1 => 'regular',
1950
+ 2 => '500',
1951
+ 3 => '600',
1952
+ 4 => '700',
1953
+ ),
1954
+ 'Hind Vadodara' =>
1955
+ array(
1956
+ 0 => '300',
1957
+ 1 => 'regular',
1958
+ 2 => '500',
1959
+ 3 => '600',
1960
+ 4 => '700',
1961
+ ),
1962
+ 'Holtwood One SC' =>
1963
+ array(
1964
+ 0 => 'regular',
1965
+ ),
1966
+ 'Homemade Apple' =>
1967
+ array(
1968
+ 0 => 'regular',
1969
+ ),
1970
+ 'Homenaje' =>
1971
+ array(
1972
+ 0 => 'regular',
1973
+ ),
1974
+ 'IBM Plex Mono' =>
1975
+ array(
1976
+ 0 => '100',
1977
+ 1 => '100italic',
1978
+ 2 => '200',
1979
+ 3 => '200italic',
1980
+ 4 => '300',
1981
+ 5 => '300italic',
1982
+ 6 => 'regular',
1983
+ 7 => 'italic',
1984
+ 8 => '500',
1985
+ 9 => '500italic',
1986
+ 10 => '600',
1987
+ 11 => '600italic',
1988
+ 12 => '700',
1989
+ 13 => '700italic',
1990
+ ),
1991
+ 'IBM Plex Sans' =>
1992
+ array(
1993
+ 0 => '100',
1994
+ 1 => '100italic',
1995
+ 2 => '200',
1996
+ 3 => '200italic',
1997
+ 4 => '300',
1998
+ 5 => '300italic',
1999
+ 6 => 'regular',
2000
+ 7 => 'italic',
2001
+ 8 => '500',
2002
+ 9 => '500italic',
2003
+ 10 => '600',
2004
+ 11 => '600italic',
2005
+ 12 => '700',
2006
+ 13 => '700italic',
2007
+ ),
2008
+ 'IBM Plex Sans Condensed' =>
2009
+ array(
2010
+ 0 => '100',
2011
+ 1 => '100italic',
2012
+ 2 => '200',
2013
+ 3 => '200italic',
2014
+ 4 => '300',
2015
+ 5 => '300italic',
2016
+ 6 => 'regular',
2017
+ 7 => 'italic',
2018
+ 8 => '500',
2019
+ 9 => '500italic',
2020
+ 10 => '600',
2021
+ 11 => '600italic',
2022
+ 12 => '700',
2023
+ 13 => '700italic',
2024
+ ),
2025
+ 'IBM Plex Serif' =>
2026
+ array(
2027
+ 0 => '100',
2028
+ 1 => '100italic',
2029
+ 2 => '200',
2030
+ 3 => '200italic',
2031
+ 4 => '300',
2032
+ 5 => '300italic',
2033
+ 6 => 'regular',
2034
+ 7 => 'italic',
2035
+ 8 => '500',
2036
+ 9 => '500italic',
2037
+ 10 => '600',
2038
+ 11 => '600italic',
2039
+ 12 => '700italic',
2040
+ ),
2041
+ 'IM Fell DW Pica' =>
2042
+ array(
2043
+ 0 => 'regular',
2044
+ 1 => 'italic',
2045
+ ),
2046
+ 'IM Fell DW Pica SC' =>
2047
+ array(
2048
+ 0 => 'regular',
2049
+ ),
2050
+ 'IM Fell Double Pica' =>
2051
+ array(
2052
+ 0 => 'regular',
2053
+ 1 => 'italic',
2054
+ ),
2055
+ 'IM Fell Double Pica SC' =>
2056
+ array(
2057
+ 0 => 'regular',
2058
+ ),
2059
+ 'IM Fell English' =>
2060
+ array(
2061
+ 0 => 'regular',
2062
+ 1 => 'italic',
2063
+ ),
2064
+ 'IM Fell English SC' =>
2065
+ array(
2066
+ 0 => 'regular',
2067
+ ),
2068
+ 'IM Fell French Canon' =>
2069
+ array(
2070
+ 0 => 'regular',
2071
+ 1 => 'italic',
2072
+ ),
2073
+ 'IM Fell French Canon SC' =>
2074
+ array(
2075
+ 0 => 'regular',
2076
+ ),
2077
+ 'IM Fell Great Primer' =>
2078
+ array(
2079
+ 0 => 'regular',
2080
+ 1 => 'italic',
2081
+ ),
2082
+ 'IM Fell Great Primer SC' =>
2083
+ array(
2084
+ 0 => 'regular',
2085
+ ),
2086
+ 'Iceberg' =>
2087
+ array(
2088
+ 0 => 'regular',
2089
+ ),
2090
+ 'Iceland' =>
2091
+ array(
2092
+ 0 => 'regular',
2093
+ ),
2094
+ 'Imprima' =>
2095
+ array(
2096
+ 0 => 'regular',
2097
+ ),
2098
+ 'Inconsolata' =>
2099
+ array(
2100
+ 0 => 'regular',
2101
+ 1 => '700',
2102
+ ),
2103
+ 'Inder' =>
2104
+ array(
2105
+ 0 => 'regular',
2106
+ ),
2107
+ 'Indie Flower' =>
2108
+ array(
2109
+ 0 => 'regular',
2110
+ ),
2111
+ 'Inika' =>
2112
+ array(
2113
+ 0 => 'regular',
2114
+ 1 => '700',
2115
+ ),
2116
+ 'Inknut Antiqua' =>
2117
+ array(
2118
+ 0 => '300',
2119
+ 1 => 'regular',
2120
+ 2 => '500',
2121
+ 3 => '600',
2122
+ 4 => '700',
2123
+ 5 => '800',
2124
+ 6 => '900',
2125
+ ),
2126
+ 'Irish Grover' =>
2127
+ array(
2128
+ 0 => 'regular',
2129
+ ),
2130
+ 'Istok Web' =>
2131
+ array(
2132
+ 0 => 'regular',
2133
+ 1 => 'italic',
2134
+ 2 => '700',
2135
+ 3 => '700italic',
2136
+ ),
2137
+ 'Italiana' =>
2138
+ array(
2139
+ 0 => 'regular',
2140
+ ),
2141
+ 'Italianno' =>
2142
+ array(
2143
+ 0 => 'regular',
2144
+ ),
2145
+ 'Itim' =>
2146
+ array(
2147
+ 0 => 'regular',
2148
+ ),
2149
+ 'Jacques Francois' =>
2150
+ array(
2151
+ 0 => 'regular',
2152
+ ),
2153
+ 'Jacques Francois Shadow' =>
2154
+ array(
2155
+ 0 => 'regular',
2156
+ ),
2157
+ 'Jaldi' =>
2158
+ array(
2159
+ 0 => 'regular',
2160
+ 1 => '700',
2161
+ ),
2162
+ 'Jim Nightshade' =>
2163
+ array(
2164
+ 0 => 'regular',
2165
+ ),
2166
+ 'Jockey One' =>
2167
+ array(
2168
+ 0 => 'regular',
2169
+ ),
2170
+ 'Jolly Lodger' =>
2171
+ array(
2172
+ 0 => 'regular',
2173
+ ),
2174
+ 'Jomhuria' =>
2175
+ array(
2176
+ 0 => 'regular',
2177
+ ),
2178
+ 'Josefin Sans' =>
2179
+ array(
2180
+ 0 => '100',
2181
+ 1 => '100italic',
2182
+ 2 => '300',
2183
+ 3 => '300italic',
2184
+ 4 => 'regular',
2185
+ 5 => 'italic',
2186
+ 6 => '600',
2187
+ 7 => '600italic',
2188
+ 8 => '700',
2189
+ 9 => '700italic',
2190
+ ),
2191
+ 'Josefin Slab' =>
2192
+ array(
2193
+ 0 => '100',
2194
+ 1 => '100italic',
2195
+ 2 => '300',
2196
+ 3 => '300italic',
2197
+ 4 => 'regular',
2198
+ 5 => 'italic',
2199
+ 6 => '600',
2200
+ 7 => '600italic',
2201
+ 8 => '700',
2202
+ 9 => '700italic',
2203
+ ),
2204
+ 'Joti One' =>
2205
+ array(
2206
+ 0 => 'regular',
2207
+ ),
2208
+ 'Judson' =>
2209
+ array(
2210
+ 0 => 'regular',
2211
+ 1 => 'italic',
2212
+ 2 => '700',
2213
+ ),
2214
+ 'Julee' =>
2215
+ array(
2216
+ 0 => 'regular',
2217
+ ),
2218
+ 'Julius Sans One' =>
2219
+ array(
2220
+ 0 => 'regular',
2221
+ ),
2222
+ 'Junge' =>
2223
+ array(
2224
+ 0 => 'regular',
2225
+ ),
2226
+ 'Jura' =>
2227
+ array(
2228
+ 0 => '300',
2229
+ 1 => 'regular',
2230
+ 2 => '500',
2231
+ 3 => '600',
2232
+ 4 => '700',
2233
+ ),
2234
+ 'Just Another Hand' =>
2235
+ array(
2236
+ 0 => 'regular',
2237
+ ),
2238
+ 'Just Me Again Down Here' =>
2239
+ array(
2240
+ 0 => 'regular',
2241
+ ),
2242
+ 'Kadwa' =>
2243
+ array(
2244
+ 0 => 'regular',
2245
+ 1 => '700',
2246
+ ),
2247
+ 'Kalam' =>
2248
+ array(
2249
+ 0 => '300',
2250
+ 1 => 'regular',
2251
+ 2 => '700',
2252
+ ),
2253
+ 'Kameron' =>
2254
+ array(
2255
+ 0 => 'regular',
2256
+ 1 => '700',
2257
+ ),
2258
+ 'Kanit' =>
2259
+ array(
2260
+ 0 => '100',
2261
+ 1 => '100italic',
2262
+ 2 => '200',
2263
+ 3 => '200italic',
2264
+ 4 => '300',
2265
+ 5 => '300italic',
2266
+ 6 => 'regular',
2267
+ 7 => 'italic',
2268
+ 8 => '500',
2269
+ 9 => '500italic',
2270
+ 10 => '600',
2271
+ 11 => '600italic',
2272
+ 12 => '700',
2273
+ 13 => '700italic',
2274
+ 14 => '800',
2275
+ 15 => '800italic',
2276
+ 16 => '900',
2277
+ 17 => '900italic',
2278
+ ),
2279
+ 'Kantumruy' =>
2280
+ array(
2281
+ 0 => '300',
2282
+ 1 => 'regular',
2283
+ 2 => '700',
2284
+ ),
2285
+ 'Karla' =>
2286
+ array(
2287
+ 0 => 'regular',
2288
+ 1 => 'italic',
2289
+ 2 => '700',
2290
+ 3 => '700italic',
2291
+ ),
2292
+ 'Karma' =>
2293
+ array(
2294
+ 0 => '300',
2295
+ 1 => 'regular',
2296
+ 2 => '500',
2297
+ 3 => '600',
2298
+ 4 => '700',
2299
+ ),
2300
+ 'Katibeh' =>
2301
+ array(
2302
+ 0 => 'regular',
2303
+ ),
2304
+ 'Kaushan Script' =>
2305
+ array(
2306
+ 0 => 'regular',
2307
+ ),
2308
+ 'Kavivanar' =>
2309
+ array(
2310
+ 0 => 'regular',
2311
+ ),
2312
+ 'Kavoon' =>
2313
+ array(
2314
+ 0 => 'regular',
2315
+ ),
2316
+ 'Kdam Thmor' =>
2317
+ array(
2318
+ 0 => 'regular',
2319
+ ),
2320
+ 'Keania One' =>
2321
+ array(
2322
+ 0 => 'regular',
2323
+ ),
2324
+ 'Kelly Slab' =>
2325
+ array(
2326
+ 0 => 'regular',
2327
+ ),
2328
+ 'Kenia' =>
2329
+ array(
2330
+ 0 => 'regular',
2331
+ ),
2332
+ 'Khand' =>
2333
+ array(
2334
+ 0 => '300',
2335
+ 1 => 'regular',
2336
+ 2 => '500',
2337
+ 3 => '600',
2338
+ 4 => '700',
2339
+ ),
2340
+ 'Khmer' =>
2341
+ array(
2342
+ 0 => 'regular',
2343
+ ),
2344
+ 'Khula' =>
2345
+ array(
2346
+ 0 => '300',
2347
+ 1 => 'regular',
2348
+ 2 => '600',
2349
+ 3 => '700',
2350
+ 4 => '800',
2351
+ ),
2352
+ 'Kite One' =>
2353
+ array(
2354
+ 0 => 'regular',
2355
+ ),
2356
+ 'Knewave' =>
2357
+ array(
2358
+ 0 => 'regular',
2359
+ ),
2360
+ 'Kotta One' =>
2361
+ array(
2362
+ 0 => 'regular',
2363
+ ),
2364
+ 'Koulen' =>
2365
+ array(
2366
+ 0 => 'regular',
2367
+ ),
2368
+ 'Kranky' =>
2369
+ array(
2370
+ 0 => 'regular',
2371
+ ),
2372
+ 'Kreon' =>
2373
+ array(
2374
+ 0 => '300',
2375
+ 1 => 'regular',
2376
+ 2 => '700',
2377
+ ),
2378
+ 'Kristi' =>
2379
+ array(
2380
+ 0 => 'regular',
2381
+ ),
2382
+ 'Krona One' =>
2383
+ array(
2384
+ 0 => 'regular',
2385
+ ),
2386
+ 'Kumar One' =>
2387
+ array(
2388
+ 0 => 'regular',
2389
+ ),
2390
+ 'Kumar One Outline' =>
2391
+ array(
2392
+ 0 => 'regular',
2393
+ ),
2394
+ 'Kurale' =>
2395
+ array(
2396
+ 0 => 'regular',
2397
+ ),
2398
+ 'La Belle Aurore' =>
2399
+ array(
2400
+ 0 => 'regular',
2401
+ ),
2402
+ 'Laila' =>
2403
+ array(
2404
+ 0 => '300',
2405
+ 1 => 'regular',
2406
+ 2 => '500',
2407
+ 3 => '600',
2408
+ 4 => '700',
2409
+ ),
2410
+ 'Lakki Reddy' =>
2411
+ array(
2412
+ 0 => 'regular',
2413
+ ),
2414
+ 'Lalezar' =>
2415
+ array(
2416
+ 0 => 'regular',
2417
+ ),
2418
+ 'Lancelot' =>
2419
+ array(
2420
+ 0 => 'regular',
2421
+ ),
2422
+ 'Lateef' =>
2423
+ array(
2424
+ 0 => 'regular',
2425
+ ),
2426
+ 'Lato' =>
2427
+ array(
2428
+ 0 => '100',
2429
+ 1 => '100italic',
2430
+ 2 => '300',
2431
+ 3 => '300italic',
2432
+ 4 => 'regular',
2433
+ 5 => 'italic',
2434
+ 6 => '700',
2435
+ 7 => '700italic',
2436
+ 8 => '900',
2437
+ 9 => '900italic',
2438
+ ),
2439
+ 'League Script' =>
2440
+ array(
2441
+ 0 => 'regular',
2442
+ ),
2443
+ 'Leckerli One' =>
2444
+ array(
2445
+ 0 => 'regular',
2446
+ ),
2447
+ 'Ledger' =>
2448
+ array(
2449
+ 0 => 'regular',
2450
+ ),
2451
+ 'Lekton' =>
2452
+ array(
2453
+ 0 => 'regular',
2454
+ 1 => 'italic',
2455
+ 2 => '700',
2456
+ ),
2457
+ 'Lemon' =>
2458
+ array(
2459
+ 0 => 'regular',
2460
+ ),
2461
+ 'Lemonada' =>
2462
+ array(
2463
+ 0 => '300',
2464
+ 1 => 'regular',
2465
+ 2 => '600',
2466
+ 3 => '700',
2467
+ ),
2468
+ 'Libre Barcode 128' =>
2469
+ array(
2470
+ 0 => 'regular',
2471
+ ),
2472
+ 'Libre Barcode 128 Text' =>
2473
+ array(
2474
+ 0 => 'regular',
2475
+ ),
2476
+ 'Libre Barcode 39' =>
2477
+ array(
2478
+ 0 => 'regular',
2479
+ ),
2480
+ 'Libre Barcode 39 Extended' =>
2481
+ array(
2482
+ 0 => 'regular',
2483
+ ),
2484
+ 'Libre Barcode 39 Extended Text' =>
2485
+ array(
2486
+ 0 => 'regular',
2487
+ ),
2488
+ 'Libre Barcode 39 Text' =>
2489
+ array(
2490
+ 0 => 'regular',
2491
+ ),
2492
+ 'Libre Baskerville' =>
2493
+ array(
2494
+ 0 => 'regular',
2495
+ 1 => 'italic',
2496
+ 2 => '700',
2497
+ ),
2498
+ 'Libre Franklin' =>
2499
+ array(
2500
+ 0 => '100',
2501
+ 1 => '100italic',
2502
+ 2 => '200',
2503
+ 3 => '200italic',
2504
+ 4 => '300',
2505
+ 5 => '300italic',
2506
+ 6 => 'regular',
2507
+ 7 => 'italic',
2508
+ 8 => '500',
2509
+ 9 => '500italic',
2510
+ 10 => '600',
2511
+ 11 => '600italic',
2512
+ 12 => '700',
2513
+ 13 => '700italic',
2514
+ 14 => '800',
2515
+ 15 => '800italic',
2516
+ 16 => '900',
2517
+ 17 => '900italic',
2518
+ ),
2519
+ 'Life Savers' =>
2520
+ array(
2521
+ 0 => 'regular',
2522
+ 1 => '700',
2523
+ ),
2524
+ 'Lilita One' =>
2525
+ array(
2526
+ 0 => 'regular',
2527
+ ),
2528
+ 'Lily Script One' =>
2529
+ array(
2530
+ 0 => 'regular',
2531
+ ),
2532
+ 'Limelight' =>
2533
+ array(
2534
+ 0 => 'regular',
2535
+ ),
2536
+ 'Linden Hill' =>
2537
+ array(
2538
+ 0 => 'regular',
2539
+ 1 => 'italic',
2540
+ ),
2541
+ 'Lobster' =>
2542
+ array(
2543
+ 0 => 'regular',
2544
+ ),
2545
+ 'Lobster Two' =>
2546
+ array(
2547
+ 0 => 'regular',
2548
+ 1 => 'italic',
2549
+ 2 => '700',
2550
+ 3 => '700italic',
2551
+ ),
2552
+ 'Londrina Outline' =>
2553
+ array(
2554
+ 0 => 'regular',
2555
+ ),
2556
+ 'Londrina Shadow' =>
2557
+ array(
2558
+ 0 => 'regular',
2559
+ ),
2560
+ 'Londrina Sketch' =>
2561
+ array(
2562
+ 0 => 'regular',
2563
+ ),
2564
+ 'Londrina Solid' =>
2565
+ array(
2566
+ 0 => '100',
2567
+ 1 => '300',
2568
+ 2 => 'regular',
2569
+ 3 => '900',
2570
+ ),
2571
+ 'Lora' =>
2572
+ array(
2573
+ 0 => 'regular',
2574
+ 1 => 'italic',
2575
+ 2 => '700',
2576
+ 3 => '700italic',
2577
+ ),
2578
+ 'Love Ya Like A Sister' =>
2579
+ array(
2580
+ 0 => 'regular',
2581
+ ),
2582
+ 'Loved by the King' =>
2583
+ array(
2584
+ 0 => 'regular',
2585
+ ),
2586
+ 'Lovers Quarrel' =>
2587
+ array(
2588
+ 0 => 'regular',
2589
+ ),
2590
+ 'Luckiest Guy' =>
2591
+ array(
2592
+ 0 => 'regular',
2593
+ ),
2594
+ 'Lusitana' =>
2595
+ array(
2596
+ 0 => 'regular',
2597
+ 1 => '700',
2598
+ ),
2599
+ 'Lustria' =>
2600
+ array(
2601
+ 0 => 'regular',
2602
+ ),
2603
+ 'Macondo' =>
2604
+ array(
2605
+ 0 => 'regular',
2606
+ ),
2607
+ 'Macondo Swash Caps' =>
2608
+ array(
2609
+ 0 => 'regular',
2610
+ ),
2611
+ 'Mada' =>
2612
+ array(
2613
+ 0 => '200',
2614
+ 1 => '300',
2615
+ 2 => 'regular',
2616
+ 3 => '500',
2617
+ 4 => '600',
2618
+ 5 => '700',
2619
+ 6 => '900',
2620
+ ),
2621
+ 'Magra' =>
2622
+ array(
2623
+ 0 => 'regular',
2624
+ 1 => '700',
2625
+ ),
2626
+ 'Maiden Orange' =>
2627
+ array(
2628
+ 0 => 'regular',
2629
+ ),
2630
+ 'Maitree' =>
2631
+ array(
2632
+ 0 => '200',
2633
+ 1 => '300',
2634
+ 2 => 'regular',
2635
+ 3 => '500',
2636
+ 4 => '600',
2637
+ 5 => '700',
2638
+ ),
2639
+ 'Mako' =>
2640
+ array(
2641
+ 0 => 'regular',
2642
+ ),
2643
+ 'Mallanna' =>
2644
+ array(
2645
+ 0 => 'regular',
2646
+ ),
2647
+ 'Mandali' =>
2648
+ array(
2649
+ 0 => 'regular',
2650
+ ),
2651
+ 'Manuale' =>
2652
+ array(
2653
+ 0 => 'regular',
2654
+ 1 => 'italic',
2655
+ 2 => '500',
2656
+ 3 => '500italic',
2657
+ 4 => '600',
2658
+ 5 => '600italic',
2659
+ 6 => '700',
2660
+ 7 => '700italic',
2661
+ ),
2662
+ 'Marcellus' =>
2663
+ array(
2664
+ 0 => 'regular',
2665
+ ),
2666
+ 'Marcellus SC' =>
2667
+ array(
2668
+ 0 => 'regular',
2669
+ ),
2670
+ 'Marck Script' =>
2671
+ array(
2672
+ 0 => 'regular',
2673
+ ),
2674
+ 'Margarine' =>
2675
+ array(
2676
+ 0 => 'regular',
2677
+ ),
2678
+ 'Marko One' =>
2679
+ array(
2680
+ 0 => 'regular',
2681
+ ),
2682
+ 'Marmelad' =>
2683
+ array(
2684
+ 0 => 'regular',
2685
+ ),
2686
+ 'Martel' =>
2687
+ array(
2688
+ 0 => '200',
2689
+ 1 => '300',
2690
+ 2 => 'regular',
2691
+ 3 => '600',
2692
+ 4 => '700',
2693
+ 5 => '800',
2694
+ 6 => '900',
2695
+ ),
2696
+ 'Martel Sans' =>
2697
+ array(
2698
+ 0 => '200',
2699
+ 1 => '300',
2700
+ 2 => 'regular',
2701
+ 3 => '600',
2702
+ 4 => '700',
2703
+ 5 => '800',
2704
+ 6 => '900',
2705
+ ),
2706
+ 'Marvel' =>
2707
+ array(
2708
+ 0 => 'regular',
2709
+ 1 => 'italic',
2710
+ 2 => '700',
2711
+ 3 => '700italic',
2712
+ ),
2713
+ 'Mate' =>
2714
+ array(
2715
+ 0 => 'regular',
2716
+ 1 => 'italic',
2717
+ ),
2718
+ 'Mate SC' =>
2719
+ array(
2720
+ 0 => 'regular',
2721
+ ),
2722
+ 'Maven Pro' =>
2723
+ array(
2724
+ 0 => 'regular',
2725
+ 1 => '500',
2726
+ 2 => '700',
2727
+ 3 => '900',
2728
+ ),
2729
+ 'McLaren' =>
2730
+ array(
2731
+ 0 => 'regular',
2732
+ ),
2733
+ 'Meddon' =>
2734
+ array(
2735
+ 0 => 'regular',
2736
+ ),
2737
+ 'MedievalSharp' =>
2738
+ array(
2739
+ 0 => 'regular',
2740
+ ),
2741
+ 'Medula One' =>
2742
+ array(
2743
+ 0 => 'regular',
2744
+ ),
2745
+ 'Meera Inimai' =>
2746
+ array(
2747
+ 0 => 'regular',
2748
+ ),
2749
+ 'Megrim' =>
2750
+ array(
2751
+ 0 => 'regular',
2752
+ ),
2753
+ 'Meie Script' =>
2754
+ array(
2755
+ 0 => 'regular',
2756
+ ),
2757
+ 'Merienda' =>
2758
+ array(
2759
+ 0 => 'regular',
2760
+ 1 => '700',
2761
+ ),
2762
+ 'Merienda One' =>
2763
+ array(
2764
+ 0 => 'regular',
2765
+ ),
2766
+ 'Merriweather' =>
2767
+ array(
2768
+ 0 => '300',
2769
+ 1 => '300italic',
2770
+ 2 => 'regular',
2771
+ 3 => 'italic',
2772
+ 4 => '700',
2773
+ 5 => '700italic',
2774
+ 6 => '900',
2775
+ 7 => '900italic',
2776
+ ),
2777
+ 'Merriweather Sans' =>
2778
+ array(
2779
+ 0 => '300',
2780
+ 1 => '300italic',
2781
+ 2 => 'regular',
2782
+ 3 => 'italic',
2783
+ 4 => '700',
2784
+ 5 => '700italic',
2785
+ 6 => '800',
2786
+ 7 => '800italic',
2787
+ ),
2788
+ 'Metal' =>
2789
+ array(
2790
+ 0 => 'regular',
2791
+ ),
2792
+ 'Metal Mania' =>
2793
+ array(
2794
+ 0 => 'regular',
2795
+ ),
2796
+ 'Metamorphous' =>
2797
+ array(
2798
+ 0 => 'regular',
2799
+ ),
2800
+ 'Metrophobic' =>
2801
+ array(
2802
+ 0 => 'regular',
2803
+ ),
2804
+ 'Michroma' =>
2805
+ array(
2806
+ 0 => 'regular',
2807
+ ),
2808
+ 'Milonga' =>
2809
+ array(
2810
+ 0 => 'regular',
2811
+ ),
2812
+ 'Miltonian' =>
2813
+ array(
2814
+ 0 => 'regular',
2815
+ ),
2816
+ 'Miltonian Tattoo' =>
2817
+ array(
2818
+ 0 => 'regular',
2819
+ ),
2820
+ 'Mina' =>
2821
+ array(
2822
+ 0 => 'regular',
2823
+ 1 => '700',
2824
+ ),
2825
+ 'Miniver' =>
2826
+ array(
2827
+ 0 => 'regular',
2828
+ ),
2829
+ 'Miriam Libre' =>
2830
+ array(
2831
+ 0 => 'regular',
2832
+ 1 => '700',
2833
+ ),
2834
+ 'Mirza' =>
2835
+ array(
2836
+ 0 => 'regular',
2837
+ 1 => '500',
2838
+ 2 => '600',
2839
+ 3 => '700',
2840
+ ),
2841
+ 'Miss Fajardose' =>
2842
+ array(
2843
+ 0 => 'regular',
2844
+ ),
2845
+ 'Mitr' =>
2846
+ array(
2847
+ 0 => '200',
2848
+ 1 => '300',
2849
+ 2 => 'regular',
2850
+ 3 => '500',
2851
+ 4 => '600',
2852
+ 5 => '700',
2853
+ ),
2854
+ 'Modak' =>
2855
+ array(
2856
+ 0 => 'regular',
2857
+ ),
2858
+ 'Modern Antiqua' =>
2859
+ array(
2860
+ 0 => 'regular',
2861
+ ),
2862
+ 'Mogra' =>
2863
+ array(
2864
+ 0 => 'regular',
2865
+ ),
2866
+ 'Molengo' =>
2867
+ array(
2868
+ 0 => 'regular',
2869
+ ),
2870
+ 'Molle' =>
2871
+ array(
2872
+ 0 => 'italic',
2873
+ ),
2874
+ 'Monda' =>
2875
+ array(
2876
+ 0 => 'regular',
2877
+ 1 => '700',
2878
+ ),
2879
+ 'Monofett' =>
2880
+ array(
2881
+ 0 => 'regular',
2882
+ ),
2883
+ 'Monoton' =>
2884
+ array(
2885
+ 0 => 'regular',
2886
+ ),
2887
+ 'Monsieur La Doulaise' =>
2888
+ array(
2889
+ 0 => 'regular',
2890
+ ),
2891
+ 'Montaga' =>
2892
+ array(
2893
+ 0 => 'regular',
2894
+ ),
2895
+ 'Montez' =>
2896
+ array(
2897
+ 0 => 'regular',
2898
+ ),
2899
+ 'Montserrat' =>
2900
+ array(
2901
+ 0 => '100',
2902
+ 1 => '100italic',
2903
+ 2 => '200',
2904
+ 3 => '200italic',
2905
+ 4 => '300',
2906
+ 5 => '300italic',
2907
+ 6 => 'regular',
2908
+ 7 => 'italic',
2909
+ 8 => '500',
2910
+ 9 => '500italic',
2911
+ 10 => '600',
2912
+ 11 => '600italic',
2913
+ 12 => '700',
2914
+ 13 => '700italic',
2915
+ 14 => '800',
2916
+ 15 => '800italic',
2917
+ 16 => '900',
2918
+ 17 => '900italic',
2919
+ ),
2920
+ 'Montserrat Alternates' =>
2921
+ array(
2922
+ 0 => '100',
2923
+ 1 => '100italic',
2924
+ 2 => '200',
2925
+ 3 => '200italic',
2926
+ 4 => '300',
2927
+ 5 => '300italic',
2928
+ 6 => 'regular',
2929
+ 7 => 'italic',
2930
+ 8 => '500',
2931
+ 9 => '500italic',
2932
+ 10 => '600',
2933
+ 11 => '600italic',
2934
+ 12 => '700',
2935
+ 13 => '700italic',
2936
+ 14 => '800',
2937
+ 15 => '800italic',
2938
+ 16 => '900',
2939
+ 17 => '900italic',
2940
+ ),
2941
+ 'Montserrat Subrayada' =>
2942
+ array(
2943
+ 0 => 'regular',
2944
+ 1 => '700',
2945
+ ),
2946
+ 'Moul' =>
2947
+ array(
2948
+ 0 => 'regular',
2949
+ ),
2950
+ 'Moulpali' =>
2951
+ array(
2952
+ 0 => 'regular',
2953
+ ),
2954
+ 'Mountains of Christmas' =>
2955
+ array(
2956
+ 0 => 'regular',
2957
+ 1 => '700',
2958
+ ),
2959
+ 'Mouse Memoirs' =>
2960
+ array(
2961
+ 0 => 'regular',
2962
+ ),
2963
+ 'Mr Bedfort' =>
2964
+ array(
2965
+ 0 => 'regular',
2966
+ ),
2967
+ 'Mr Dafoe' =>
2968
+ array(
2969
+ 0 => 'regular',
2970
+ ),
2971
+ 'Mr De Haviland' =>
2972
+ array(
2973
+ 0 => 'regular',
2974
+ ),
2975
+ 'Mrs Saint Delafield' =>
2976
+ array(
2977
+ 0 => 'regular',
2978
+ ),
2979
+ 'Mrs Sheppards' =>
2980
+ array(
2981
+ 0 => 'regular',
2982
+ ),
2983
+ 'Mukta' =>
2984
+ array(
2985
+ 0 => '200',
2986
+ 1 => '300',
2987
+ 2 => 'regular',
2988
+ 3 => '500',
2989
+ 4 => '600',
2990
+ 5 => '700',
2991
+ 6 => '800',
2992
+ ),
2993
+ 'Mukta Mahee' =>
2994
+ array(
2995
+ 0 => '200',
2996
+ 1 => '300',
2997
+ 2 => 'regular',
2998
+ 3 => '500',
2999
+ 4 => '600',
3000
+ 5 => '700',
3001
+ 6 => '800',
3002
+ ),
3003
+ 'Mukta Malar' =>
3004
+ array(
3005
+ 0 => '200',
3006
+ 1 => '300',
3007
+ 2 => 'regular',
3008
+ 3 => '500',
3009
+ 4 => '600',
3010
+ 5 => '700',
3011
+ 6 => '800',
3012
+ ),
3013
+ 'Mukta Vaani' =>
3014
+ array(
3015
+ 0 => '200',
3016
+ 1 => '300',
3017
+ 2 => 'regular',
3018
+ 3 => '500',
3019
+ 4 => '600',
3020
+ 5 => '700',
3021
+ 6 => '800',
3022
+ ),
3023
+ 'Muli' =>
3024
+ array(
3025
+ 0 => '200',
3026
+ 1 => '200italic',
3027
+ 2 => '300',
3028
+ 3 => '300italic',
3029
+ 4 => 'regular',
3030
+ 5 => 'italic',
3031
+ 6 => '600',
3032
+ 7 => '600italic',
3033
+ 8 => '700',
3034
+ 9 => '700italic',
3035
+ 10 => '800',
3036
+ 11 => '800italic',
3037
+ 12 => '900',
3038
+ 13 => '900italic',
3039
+ ),
3040
+ 'Mystery Quest' =>
3041
+ array(
3042
+ 0 => 'regular',
3043
+ ),
3044
+ 'NTR' =>
3045
+ array(
3046
+ 0 => 'regular',
3047
+ ),
3048
+ 'Nanum Brush Script' =>
3049
+ array(
3050
+ 0 => 'regular',
3051
+ ),
3052
+ 'Nanum Gothic' =>
3053
+ array(
3054
+ 0 => 'regular',
3055
+ 1 => '700',
3056
+ 2 => '800',
3057
+ ),
3058
+ 'Nanum Gothic Coding' =>
3059
+ array(
3060
+ 0 => 'regular',
3061
+ 1 => '700',
3062
+ ),
3063
+ 'Nanum Myeongjo' =>
3064
+ array(
3065
+ 0 => 'regular',
3066
+ 1 => '700',
3067
+ 2 => '800',
3068
+ ),
3069
+ 'Nanum Pen Script' =>
3070
+ array(
3071
+ 0 => 'regular',
3072
+ ),
3073
+ 'Neucha' =>
3074
+ array(
3075
+ 0 => 'regular',
3076
+ ),
3077
+ 'Neuton' =>
3078
+ array(
3079
+ 0 => '200',
3080
+ 1 => '300',
3081
+ 2 => 'regular',
3082
+ 3 => 'italic',
3083
+ 4 => '700',
3084
+ 5 => '800',
3085
+ ),
3086
+ 'New Rocker' =>
3087
+ array(
3088
+ 0 => 'regular',
3089
+ ),
3090
+ 'News Cycle' =>
3091
+ array(
3092
+ 0 => 'regular',
3093
+ 1 => '700',
3094
+ ),
3095
+ 'Niconne' =>
3096
+ array(
3097
+ 0 => 'regular',
3098
+ ),
3099
+ 'Nixie One' =>
3100
+ array(
3101
+ 0 => 'regular',
3102
+ ),
3103
+ 'Nobile' =>
3104
+ array(
3105
+ 0 => 'regular',
3106
+ 1 => 'italic',
3107
+ 2 => '500',
3108
+ 3 => '500italic',
3109
+ 4 => '700',
3110
+ 5 => '700italic',
3111
+ ),
3112
+ 'Nokora' =>
3113
+ array(
3114
+ 0 => 'regular',
3115
+ 1 => '700',
3116
+ ),
3117
+ 'Norican' =>
3118
+ array(
3119
+ 0 => 'regular',
3120
+ ),
3121
+ 'Nosifer' =>
3122
+ array(
3123
+ 0 => 'regular',
3124
+ ),
3125
+ 'Nothing You Could Do' =>
3126
+ array(
3127
+ 0 => 'regular',
3128
+ ),
3129
+ 'Noticia Text' =>
3130
+ array(
3131
+ 0 => 'regular',
3132
+ 1 => 'italic',
3133
+ 2 => '700',
3134
+ 3 => '700italic',
3135
+ ),
3136
+ 'Noto Sans' =>
3137
+ array(
3138
+ 0 => 'regular',
3139
+ 1 => 'italic',
3140
+ 2 => '700',
3141
+ 3 => '700italic',
3142
+ ),
3143
+ 'Noto Serif' =>
3144
+ array(
3145
+ 0 => 'regular',
3146
+ 1 => 'italic',
3147
+ 2 => '700',
3148
+ 3 => '700italic',
3149
+ ),
3150
+ 'Nova Cut' =>
3151
+ array(
3152
+ 0 => 'regular',
3153
+ ),
3154
+ 'Nova Flat' =>
3155
+ array(
3156
+ 0 => 'regular',
3157
+ ),
3158
+ 'Nova Mono' =>
3159
+ array(
3160
+ 0 => 'regular',
3161
+ ),
3162
+ 'Nova Oval' =>
3163
+ array(
3164
+ 0 => 'regular',
3165
+ ),
3166
+ 'Nova Round' =>
3167
+ array(
3168
+ 0 => 'regular',
3169
+ ),
3170
+ 'Nova Script' =>
3171
+ array(
3172
+ 0 => 'regular',
3173
+ ),
3174
+ 'Nova Slim' =>
3175
+ array(
3176
+ 0 => 'regular',
3177
+ ),
3178
+ 'Nova Square' =>
3179
+ array(
3180
+ 0 => 'regular',
3181
+ ),
3182
+ 'Numans' =>
3183
+ array(
3184
+ 0 => 'regular',
3185
+ ),
3186
+ 'Nunito' =>
3187
+ array(
3188
+ 0 => '200',
3189
+ 1 => '200italic',
3190
+ 2 => '300',
3191
+ 3 => '300italic',
3192
+ 4 => 'regular',
3193
+ 5 => 'italic',
3194
+ 6 => '600',
3195
+ 7 => '600italic',
3196
+ 8 => '700',
3197
+ 9 => '700italic',
3198
+ 10 => '800',
3199
+ 11 => '800italic',
3200
+ 12 => '900',
3201
+ 13 => '900italic',
3202
+ ),
3203
+ 'Nunito Sans' =>
3204
+ array(
3205
+ 0 => '200',
3206
+ 1 => '200italic',
3207
+ 2 => '300',
3208
+ 3 => '300italic',
3209
+ 4 => 'regular',
3210
+ 5 => 'italic',
3211
+ 6 => '600',
3212
+ 7 => '600italic',
3213
+ 8 => '700',
3214
+ 9 => '700italic',
3215
+ 10 => '800',
3216
+ 11 => '800italic',
3217
+ 12 => '900',
3218
+ 13 => '900italic',
3219
+ ),
3220
+ 'Odor Mean Chey' =>
3221
+ array(
3222
+ 0 => 'regular',
3223
+ ),
3224
+ 'Offside' =>
3225
+ array(
3226
+ 0 => 'regular',
3227
+ ),
3228
+ 'Old Standard TT' =>
3229
+ array(
3230
+ 0 => 'regular',
3231
+ 1 => 'italic',
3232
+ 2 => '700',
3233
+ ),
3234
+ 'Oldenburg' =>
3235
+ array(
3236
+ 0 => 'regular',
3237
+ ),
3238
+ 'Oleo Script' =>
3239
+ array(
3240
+ 0 => 'regular',
3241
+ 1 => '700',
3242
+ ),
3243
+ 'Oleo Script Swash Caps' =>
3244
+ array(
3245
+ 0 => 'regular',
3246
+ 1 => '700',
3247
+ ),
3248
+ 'Open Sans' =>
3249
+ array(
3250
+ 0 => '300',
3251
+ 1 => '300italic',
3252
+ 2 => 'regular',
3253
+ 3 => 'italic',
3254
+ 4 => '600',
3255
+ 5 => '600italic',
3256
+ 6 => '700',
3257
+ 7 => '700italic',
3258
+ 8 => '800',
3259
+ 9 => '800italic',
3260
+ ),
3261
+ 'Open Sans Condensed' =>
3262
+ array(
3263
+ 0 => '300',
3264
+ 1 => '300italic',
3265
+ 2 => '700',
3266
+ ),
3267
+ 'Oranienbaum' =>
3268
+ array(
3269
+ 0 => 'regular',
3270
+ ),
3271
+ 'Orbitron' =>
3272
+ array(
3273
+ 0 => 'regular',
3274
+ 1 => '500',
3275
+ 2 => '700',
3276
+ 3 => '900',
3277
+ ),
3278
+ 'Oregano' =>
3279
+ array(
3280
+ 0 => 'regular',
3281
+ 1 => 'italic',
3282
+ ),
3283
+ 'Orienta' =>
3284
+ array(
3285
+ 0 => 'regular',
3286
+ ),
3287
+ 'Original Surfer' =>
3288
+ array(
3289
+ 0 => 'regular',
3290
+ ),
3291
+ 'Oswald' =>
3292
+ array(
3293
+ 0 => '200',
3294
+ 1 => '300',
3295
+ 2 => 'regular',
3296
+ 3 => '500',
3297
+ 4 => '600',
3298
+ 5 => '700',
3299
+ ),
3300
+ 'Over the Rainbow' =>
3301
+ array(
3302
+ 0 => 'regular',
3303
+ ),
3304
+ 'Overlock' =>
3305
+ array(
3306
+ 0 => 'regular',
3307
+ 1 => 'italic',
3308
+ 2 => '700',
3309
+ 3 => '700italic',
3310
+ 4 => '900',
3311
+ 5 => '900italic',
3312
+ ),
3313
+ 'Overlock SC' =>
3314
+ array(
3315
+ 0 => 'regular',
3316
+ ),
3317
+ 'Overpass' =>
3318
+ array(
3319
+ 0 => '100',
3320
+ 1 => '100italic',
3321
+ 2 => '200',
3322
+ 3 => '200italic',
3323
+ 4 => '300',
3324
+ 5 => '300italic',
3325
+ 6 => 'regular',
3326
+ 7 => 'italic',
3327
+ 8 => '600',
3328
+ 9 => '600italic',
3329
+ 10 => '700',
3330
+ 11 => '700italic',
3331
+ 12 => '800',
3332
+ 13 => '800italic',
3333
+ 14 => '900',
3334
+ 15 => '900italic',
3335
+ ),
3336
+ 'Overpass Mono' =>
3337
+ array(
3338
+ 0 => '300',
3339
+ 1 => 'regular',
3340
+ 2 => '600',
3341
+ 3 => '700',
3342
+ ),
3343
+ 'Ovo' =>
3344
+ array(
3345
+ 0 => 'regular',
3346
+ ),
3347
+ 'Oxygen' =>
3348
+ array(
3349
+ 0 => '300',
3350
+ 1 => 'regular',
3351
+ 2 => '700',
3352
+ ),
3353
+ 'Oxygen Mono' =>
3354
+ array(
3355
+ 0 => 'regular',
3356
+ ),
3357
+ 'PT Mono' =>
3358
+ array(
3359
+ 0 => 'regular',
3360
+ ),
3361
+ 'PT Sans' =>
3362
+ array(
3363
+ 0 => 'regular',
3364
+ 1 => 'italic',
3365
+ 2 => '700',
3366
+ 3 => '700italic',
3367
+ ),
3368
+ 'PT Sans Caption' =>
3369
+ array(
3370
+ 0 => 'regular',
3371
+ 1 => '700',
3372
+ ),
3373
+ 'PT Sans Narrow' =>
3374
+ array(
3375
+ 0 => 'regular',
3376
+ 1 => '700',
3377
+ ),
3378
+ 'PT Serif' =>
3379
+ array(
3380
+ 0 => 'regular',
3381
+ 1 => 'italic',
3382
+ 2 => '700',
3383
+ 3 => '700italic',
3384
+ ),
3385
+ 'PT Serif Caption' =>
3386
+ array(
3387
+ 0 => 'regular',
3388
+ 1 => 'italic',
3389
+ ),
3390
+ 'Pacifico' =>
3391
+ array(
3392
+ 0 => 'regular',
3393
+ ),
3394
+ 'Padauk' =>
3395
+ array(
3396
+ 0 => 'regular',
3397
+ 1 => '700',
3398
+ ),
3399
+ 'Palanquin' =>
3400
+ array(
3401
+ 0 => '100',
3402
+ 1 => '200',
3403
+ 2 => '300',
3404
+ 3 => 'regular',
3405
+ 4 => '500',
3406
+ 5 => '600',
3407
+ 6 => '700',
3408
+ ),
3409
+ 'Palanquin Dark' =>
3410
+ array(
3411
+ 0 => 'regular',
3412
+ 1 => '500',
3413
+ 2 => '600',
3414
+ 3 => '700',
3415
+ ),
3416
+ 'Pangolin' =>
3417
+ array(
3418
+ 0 => 'regular',
3419
+ ),
3420
+ 'Paprika' =>
3421
+ array(
3422
+ 0 => 'regular',
3423
+ ),
3424
+ 'Parisienne' =>
3425
+ array(
3426
+ 0 => 'regular',
3427
+ ),
3428
+ 'Passero One' =>
3429
+ array(
3430
+ 0 => 'regular',
3431
+ ),
3432
+ 'Passion One' =>
3433
+ array(
3434
+ 0 => 'regular',
3435
+ 1 => '700',
3436
+ 2 => '900',
3437
+ ),
3438
+ 'Pathway Gothic One' =>
3439
+ array(
3440
+ 0 => 'regular',
3441
+ ),
3442
+ 'Patrick Hand' =>
3443
+ array(
3444
+ 0 => 'regular',
3445
+ ),
3446
+ 'Patrick Hand SC' =>
3447
+ array(
3448
+ 0 => 'regular',
3449
+ ),
3450
+ 'Pattaya' =>
3451
+ array(
3452
+ 0 => 'regular',
3453
+ ),
3454
+ 'Patua One' =>
3455
+ array(
3456
+ 0 => 'regular',
3457
+ ),
3458
+ 'Pavanam' =>
3459
+ array(
3460
+ 0 => 'regular',
3461
+ ),
3462
+ 'Paytone One' =>
3463
+ array(
3464
+ 0 => 'regular',
3465
+ ),
3466
+ 'Peddana' =>
3467
+ array(
3468
+ 0 => 'regular',
3469
+ ),
3470
+ 'Peralta' =>
3471
+ array(
3472
+ 0 => 'regular',
3473
+ ),
3474
+ 'Permanent Marker' =>
3475
+ array(
3476
+ 0 => 'regular',
3477
+ ),
3478
+ 'Petit Formal Script' =>
3479
+ array(
3480
+ 0 => 'regular',
3481
+ ),
3482
+ 'Petrona' =>
3483
+ array(
3484
+ 0 => 'regular',
3485
+ ),
3486
+ 'Philosopher' =>
3487
+ array(
3488
+ 0 => 'regular',
3489
+ 1 => 'italic',
3490
+ 2 => '700',
3491
+ 3 => '700italic',
3492
+ ),
3493
+ 'Piedra' =>
3494
+ array(
3495
+ 0 => 'regular',
3496
+ ),
3497
+ 'Pinyon Script' =>
3498
+ array(
3499
+ 0 => 'regular',
3500
+ ),
3501
+ 'Pirata One' =>
3502
+ array(
3503
+ 0 => 'regular',
3504
+ ),
3505
+ 'Plaster' =>
3506
+ array(
3507
+ 0 => 'regular',
3508
+ ),
3509
+ 'Play' =>
3510
+ array(
3511
+ 0 => 'regular',
3512
+ 1 => '700',
3513
+ ),
3514
+ 'Playball' =>
3515
+ array(
3516
+ 0 => 'regular',
3517
+ ),
3518
+ 'Playfair Display' =>
3519
+ array(
3520
+ 0 => 'regular',
3521
+ 1 => 'italic',
3522
+ 2 => '700',
3523
+ 3 => '700italic',
3524
+ 4 => '900',
3525
+ 5 => '900italic',
3526
+ ),
3527
+ 'Playfair Display SC' =>
3528
+ array(
3529
+ 0 => 'regular',
3530
+ 1 => 'italic',
3531
+ 2 => '700',
3532
+ 3 => '700italic',
3533
+ 4 => '900',
3534
+ 5 => '900italic',
3535
+ ),
3536
+ 'Podkova' =>
3537
+ array(
3538
+ 0 => 'regular',
3539
+ 1 => '500',
3540
+ 2 => '600',
3541
+ 3 => '700',
3542
+ 4 => '800',
3543
+ ),
3544
+ 'Poiret One' =>
3545
+ array(
3546
+ 0 => 'regular',
3547
+ ),
3548
+ 'Poller One' =>
3549
+ array(
3550
+ 0 => 'regular',
3551
+ ),
3552
+ 'Poly' =>
3553
+ array(
3554
+ 0 => 'regular',
3555
+ 1 => 'italic',
3556
+ ),
3557
+ 'Pompiere' =>
3558
+ array(
3559
+ 0 => 'regular',
3560
+ ),
3561
+ 'Pontano Sans' =>
3562
+ array(
3563
+ 0 => 'regular',
3564
+ ),
3565
+ 'Poppins' =>
3566
+ array(
3567
+ 0 => '100',
3568
+ 1 => '100italic',
3569
+ 2 => '200',
3570
+ 3 => '200italic',
3571
+ 4 => '300',
3572
+ 5 => '300italic',
3573
+ 6 => 'regular',
3574
+ 7 => 'italic',
3575
+ 8 => '500',
3576
+ 9 => '500italic',
3577
+ 10 => '600',
3578
+ 11 => '600italic',
3579
+ 12 => '700',
3580
+ 13 => '700italic',
3581
+ 14 => '800',
3582
+ 15 => '800italic',
3583
+ 16 => '900',
3584
+ 17 => '900italic',
3585
+ ),
3586
+ 'Port Lligat Sans' =>
3587
+ array(
3588
+ 0 => 'regular',
3589
+ ),
3590
+ 'Port Lligat Slab' =>
3591
+ array(
3592
+ 0 => 'regular',
3593
+ ),
3594
+ 'Pragati Narrow' =>
3595
+ array(
3596
+ 0 => 'regular',
3597
+ 1 => '700',
3598
+ ),
3599
+ 'Prata' =>
3600
+ array(
3601
+ 0 => 'regular',
3602
+ ),
3603
+ 'Preahvihear' =>
3604
+ array(
3605
+ 0 => 'regular',
3606
+ ),
3607
+ 'Press Start 2P' =>
3608
+ array(
3609
+ 0 => 'regular',
3610
+ ),
3611
+ 'Pridi' =>
3612
+ array(
3613
+ 0 => '200',
3614
+ 1 => '300',
3615
+ 2 => 'regular',
3616
+ 3 => '500',
3617
+ 4 => '600',
3618
+ 5 => '700',
3619
+ ),
3620
+ 'Princess Sofia' =>
3621
+ array(
3622
+ 0 => 'regular',
3623
+ ),
3624
+ 'Prociono' =>
3625
+ array(
3626
+ 0 => 'regular',
3627
+ ),
3628
+ 'Prompt' =>
3629
+ array(
3630
+ 0 => '100',
3631
+ 1 => '100italic',
3632
+ 2 => '200',
3633
+ 3 => '200italic',
3634
+ 4 => '300',
3635
+ 5 => '300italic',
3636
+ 6 => 'regular',
3637
+ 7 => 'italic',
3638
+ 8 => '500',
3639
+ 9 => '500italic',
3640
+ 10 => '600',
3641
+ 11 => '600italic',
3642
+ 12 => '700',
3643
+ 13 => '700italic',
3644
+ 14 => '800',
3645
+ 15 => '800italic',
3646
+ 16 => '900',
3647
+ 17 => '900italic',
3648
+ ),
3649
+ 'Prosto One' =>
3650
+ array(
3651
+ 0 => 'regular',
3652
+ ),
3653
+ 'Proza Libre' =>
3654
+ array(
3655
+ 0 => 'regular',
3656
+ 1 => 'italic',
3657
+ 2 => '500',
3658
+ 3 => '500italic',
3659
+ 4 => '600',
3660
+ 5 => '600italic',
3661
+ 6 => '700',
3662
+ 7 => '700italic',
3663
+ 8 => '800',
3664
+ 9 => '800italic',
3665
+ ),
3666
+ 'Puritan' =>
3667
+ array(
3668
+ 0 => 'regular',
3669
+ 1 => 'italic',
3670
+ 2 => '700',
3671
+ 3 => '700italic',
3672
+ ),
3673
+ 'Purple Purse' =>
3674
+ array(
3675
+ 0 => 'regular',
3676
+ ),
3677
+ 'Quando' =>
3678
+ array(
3679
+ 0 => 'regular',
3680
+ ),
3681
+ 'Quantico' =>
3682
+ array(
3683
+ 0 => 'regular',
3684
+ 1 => 'italic',
3685
+ 2 => '700',
3686
+ 3 => '700italic',
3687
+ ),
3688
+ 'Quattrocento' =>
3689
+ array(
3690
+ 0 => 'regular',
3691
+ 1 => '700',
3692
+ ),
3693
+ 'Quattrocento Sans' =>
3694
+ array(
3695
+ 0 => 'regular',
3696
+ 1 => 'italic',
3697
+ 2 => '700',
3698
+ 3 => '700italic',
3699
+ ),
3700
+ 'Questrial' =>
3701
+ array(
3702
+ 0 => 'regular',
3703
+ ),
3704
+ 'Quicksand' =>
3705
+ array(
3706
+ 0 => '300',
3707
+ 1 => 'regular',
3708
+ 2 => '500',
3709
+ 3 => '700',
3710
+ ),
3711
+ 'Quintessential' =>
3712
+ array(
3713
+ 0 => 'regular',
3714
+ ),
3715
+ 'Qwigley' =>
3716
+ array(
3717
+ 0 => 'regular',
3718
+ ),
3719
+ 'Racing Sans One' =>
3720
+ array(
3721
+ 0 => 'regular',
3722
+ ),
3723
+ 'Radley' =>
3724
+ array(
3725
+ 0 => 'regular',
3726
+ 1 => 'italic',
3727
+ ),
3728
+ 'Rajdhani' =>
3729
+ array(
3730
+ 0 => '300',
3731
+ 1 => 'regular',
3732
+ 2 => '500',
3733
+ 3 => '600',
3734
+ 4 => '700',
3735
+ ),
3736
+ 'Rakkas' =>
3737
+ array(
3738
+ 0 => 'regular',
3739
+ ),
3740
+ 'Raleway' =>
3741
+ array(
3742
+ 0 => '100',
3743
+ 1 => '100italic',
3744
+ 2 => '200',
3745
+ 3 => '200italic',
3746
+ 4 => '300',
3747
+ 5 => '300italic',
3748
+ 6 => 'regular',
3749
+ 7 => 'italic',
3750
+ 8 => '500',
3751
+ 9 => '500italic',
3752
+ 10 => '600',
3753
+ 11 => '600italic',
3754
+ 12 => '700',
3755
+ 13 => '700italic',
3756
+ 14 => '800',
3757
+ 15 => '800italic',
3758
+ 16 => '900',
3759
+ 17 => '900italic',
3760
+ ),
3761
+ 'Raleway Dots' =>
3762
+ array(
3763
+ 0 => 'regular',
3764
+ ),
3765
+ 'Ramabhadra' =>
3766
+ array(
3767
+ 0 => 'regular',
3768
+ ),
3769
+ 'Ramaraja' =>
3770
+ array(
3771
+ 0 => 'regular',
3772
+ ),
3773
+ 'Rambla' =>
3774
+ array(
3775
+ 0 => 'regular',
3776
+ 1 => 'italic',
3777
+ 2 => '700',
3778
+ 3 => '700italic',
3779
+ ),
3780
+ 'Rammetto One' =>
3781
+ array(
3782
+ 0 => 'regular',
3783
+ ),
3784
+ 'Ranchers' =>
3785
+ array(
3786
+ 0 => 'regular',
3787
+ ),
3788
+ 'Rancho' =>
3789
+ array(
3790
+ 0 => 'regular',
3791
+ ),
3792
+ 'Ranga' =>
3793
+ array(
3794
+ 0 => 'regular',
3795
+ 1 => '700',
3796
+ ),
3797
+ 'Rasa' =>
3798
+ array(
3799
+ 0 => '300',
3800
+ 1 => 'regular',
3801
+ 2 => '500',
3802
+ 3 => '600',
3803
+ 4 => '700',
3804
+ ),
3805
+ 'Rationale' =>
3806
+ array(
3807
+ 0 => 'regular',
3808
+ ),
3809
+ 'Ravi Prakash' =>
3810
+ array(
3811
+ 0 => 'regular',
3812
+ ),
3813
+ 'Redressed' =>
3814
+ array(
3815
+ 0 => 'regular',
3816
+ ),
3817
+ 'Reem Kufi' =>
3818
+ array(
3819
+ 0 => 'regular',
3820
+ ),
3821
+ 'Reenie Beanie' =>
3822
+ array(
3823
+ 0 => 'regular',
3824
+ ),
3825
+ 'Revalia' =>
3826
+ array(
3827
+ 0 => 'regular',
3828
+ ),
3829
+ 'Rhodium Libre' =>
3830
+ array(
3831
+ 0 => 'regular',
3832
+ ),
3833
+ 'Ribeye' =>
3834
+ array(
3835
+ 0 => 'regular',
3836
+ ),
3837
+ 'Ribeye Marrow' =>
3838
+ array(
3839
+ 0 => 'regular',
3840
+ ),
3841
+ 'Righteous' =>
3842
+ array(
3843
+ 0 => 'regular',
3844
+ ),
3845
+ 'Risque' =>
3846
+ array(
3847
+ 0 => 'regular',
3848
+ ),
3849
+ 'Roboto' =>
3850
+ array(
3851
+ 0 => '100',
3852
+ 1 => '100italic',
3853
+ 2 => '300',
3854
+ 3 => '300italic',
3855
+ 4 => 'regular',
3856
+ 5 => 'italic',
3857
+ 6 => '500',
3858
+ 7 => '500italic',
3859
+ 8 => '700',
3860
+ 9 => '700italic',
3861
+ 10 => '900',
3862
+ 11 => '900italic',
3863
+ ),
3864
+ 'Roboto Condensed' =>
3865
+ array(
3866
+ 0 => '300',
3867
+ 1 => '300italic',
3868
+ 2 => 'regular',
3869
+ 3 => 'italic',
3870
+ 4 => '700',
3871
+ 5 => '700italic',
3872
+ ),
3873
+ 'Roboto Mono' =>
3874
+ array(
3875
+ 0 => '100',
3876
+ 1 => '100italic',
3877
+ 2 => '300',
3878
+ 3 => '300italic',
3879
+ 4 => 'regular',
3880
+ 5 => 'italic',
3881
+ 6 => '500',
3882
+ 7 => '500italic',
3883
+ 8 => '700',
3884
+ 9 => '700italic',
3885
+ ),
3886
+ 'Roboto Slab' =>
3887
+ array(
3888
+ 0 => '100',
3889
+ 1 => '300',
3890
+ 2 => 'regular',
3891
+ 3 => '700',
3892
+ ),
3893
+ 'Rochester' =>
3894
+ array(
3895
+ 0 => 'regular',
3896
+ ),
3897
+ 'Rock Salt' =>
3898
+ array(
3899
+ 0 => 'regular',
3900
+ ),
3901
+ 'Rokkitt' =>
3902
+ array(
3903
+ 0 => '100',
3904
+ 1 => '200',
3905
+ 2 => '300',
3906
+ 3 => 'regular',
3907
+ 4 => '500',
3908
+ 5 => '600',
3909
+ 6 => '700',
3910
+ 7 => '800',
3911
+ 8 => '900',
3912
+ ),
3913
+ 'Romanesco' =>
3914
+ array(
3915
+ 0 => 'regular',
3916
+ ),
3917
+ 'Ropa Sans' =>
3918
+ array(
3919
+ 0 => 'regular',
3920
+ 1 => 'italic',
3921
+ ),
3922
+ 'Rosario' =>
3923
+ array(
3924
+ 0 => 'regular',
3925
+ 1 => 'italic',
3926
+ 2 => '700',
3927
+ 3 => '700italic',
3928
+ ),
3929
+ 'Rosarivo' =>
3930
+ array(
3931
+ 0 => 'regular',
3932
+ 1 => 'italic',
3933
+ ),
3934
+ 'Rouge Script' =>
3935
+ array(
3936
+ 0 => 'regular',
3937
+ ),
3938
+ 'Rozha One' =>
3939
+ array(
3940
+ 0 => 'regular',
3941
+ ),
3942
+ 'Rubik' =>
3943
+ array(
3944
+ 0 => '300',
3945
+ 1 => '300italic',
3946
+ 2 => 'regular',
3947
+ 3 => 'italic',
3948
+ 4 => '500',
3949
+ 5 => '500italic',
3950
+ 6 => '700',
3951
+ 7 => '700italic',
3952
+ 8 => '900',
3953
+ 9 => '900italic',
3954
+ ),
3955
+ 'Rubik Mono One' =>
3956
+ array(
3957
+ 0 => 'regular',
3958
+ ),
3959
+ 'Ruda' =>
3960
+ array(
3961
+ 0 => 'regular',
3962
+ 1 => '700',
3963
+ 2 => '900',
3964
+ ),
3965
+ 'Rufina' =>
3966
+ array(
3967
+ 0 => 'regular',
3968
+ 1 => '700',
3969
+ ),
3970
+ 'Ruge Boogie' =>
3971
+ array(
3972
+ 0 => 'regular',
3973
+ ),
3974
+ 'Ruluko' =>
3975
+ array(
3976
+ 0 => 'regular',
3977
+ ),
3978
+ 'Rum Raisin' =>
3979
+ array(
3980
+ 0 => 'regular',
3981
+ ),
3982
+ 'Ruslan Display' =>
3983
+ array(
3984
+ 0 => 'regular',
3985
+ ),
3986
+ 'Russo One' =>
3987
+ array(
3988
+ 0 => 'regular',
3989
+ ),
3990
+ 'Ruthie' =>
3991
+ array(
3992
+ 0 => 'regular',
3993
+ ),
3994
+ 'Rye' =>
3995
+ array(
3996
+ 0 => 'regular',
3997
+ ),
3998
+ 'Sacramento' =>
3999
+ array(
4000
+ 0 => 'regular',
4001
+ ),
4002
+ 'Sahitya' =>
4003
+ array(
4004
+ 0 => 'regular',
4005
+ 1 => '700',
4006
+ ),
4007
+ 'Sail' =>
4008
+ array(
4009
+ 0 => 'regular',
4010
+ ),
4011
+ 'Saira' =>
4012
+ array(
4013
+ 0 => '100',
4014
+ 1 => '200',
4015
+ 2 => '300',
4016
+ 3 => 'regular',
4017
+ 4 => '500',
4018
+ 5 => '600',
4019
+ 6 => '700',
4020
+ 7 => '800',
4021
+ 8 => '900',
4022
+ ),
4023
+ 'Saira Condensed' =>
4024
+ array(
4025
+ 0 => '100',
4026
+ 1 => '200',
4027
+ 2 => '300',
4028
+ 3 => 'regular',
4029
+ 4 => '500',
4030
+ 5 => '600',
4031
+ 6 => '700',
4032
+ 7 => '800',
4033
+ 8 => '900',
4034
+ ),
4035
+ 'Saira Extra Condensed' =>
4036
+ array(
4037
+ 0 => '100',
4038
+ 1 => '200',
4039
+ 2 => '300',
4040
+ 3 => 'regular',
4041
+ 4 => '500',
4042
+ 5 => '600',
4043
+ 6 => '700',
4044
+ 7 => '800',
4045
+ 8 => '900',
4046
+ ),
4047
+ 'Saira Semi Condensed' =>
4048
+ array(
4049
+ 0 => '100',
4050
+ 1 => '200',
4051
+ 2 => '300',
4052
+ 3 => 'regular',
4053
+ 4 => '500',
4054
+ 5 => '600',
4055
+ 6 => '700',
4056
+ 7 => '800',
4057
+ 8 => '900',
4058
+ ),
4059
+ 'Salsa' =>
4060
+ array(
4061
+ 0 => 'regular',
4062
+ ),
4063
+ 'Sanchez' =>
4064
+ array(
4065
+ 0 => 'regular',
4066
+ 1 => 'italic',
4067
+ ),
4068
+ 'Sancreek' =>
4069
+ array(
4070
+ 0 => 'regular',
4071
+ ),
4072
+ 'Sansita' =>
4073
+ array(
4074
+ 0 => 'regular',
4075
+ 1 => 'italic',
4076
+ 2 => '700',
4077
+ 3 => '700italic',
4078
+ 4 => '800',
4079
+ 5 => '800italic',
4080
+ 6 => '900',
4081
+ 7 => '900italic',
4082
+ ),
4083
+ 'Sarala' =>
4084
+ array(
4085
+ 0 => 'regular',
4086
+ 1 => '700',
4087
+ ),
4088
+ 'Sarina' =>
4089
+ array(
4090
+ 0 => 'regular',
4091
+ ),
4092
+ 'Sarpanch' =>
4093
+ array(
4094
+ 0 => 'regular',
4095
+ 1 => '500',
4096
+ 2 => '600',
4097
+ 3 => '700',
4098
+ 4 => '800',
4099
+ 5 => '900',
4100
+ ),
4101
+ 'Satisfy' =>
4102
+ array(
4103
+ 0 => 'regular',
4104
+ ),
4105
+ 'Scada' =>
4106
+ array(
4107
+ 0 => 'regular',
4108
+ 1 => 'italic',
4109
+ 2 => '700',
4110
+ 3 => '700italic',
4111
+ ),
4112
+ 'Scheherazade' =>
4113
+ array(
4114
+ 0 => 'regular',
4115
+ 1 => '700',
4116
+ ),
4117
+ 'Schoolbell' =>
4118
+ array(
4119
+ 0 => 'regular',
4120
+ ),
4121
+ 'Scope One' =>
4122
+ array(
4123
+ 0 => 'regular',
4124
+ ),
4125
+ 'Seaweed Script' =>
4126
+ array(
4127
+ 0 => 'regular',
4128
+ ),
4129
+ 'Secular One' =>
4130
+ array(
4131
+ 0 => 'regular',
4132
+ ),
4133
+ 'Sedgwick Ave' =>
4134
+ array(
4135
+ 0 => 'regular',
4136
+ ),
4137
+ 'Sedgwick Ave Display' =>
4138
+ array(
4139
+ 0 => 'regular',
4140
+ ),
4141
+ 'Sevillana' =>
4142
+ array(
4143
+ 0 => 'regular',
4144
+ ),
4145
+ 'Seymour One' =>
4146
+ array(
4147
+ 0 => 'regular',
4148
+ ),
4149
+ 'Shadows Into Light' =>
4150
+ array(
4151
+ 0 => 'regular',
4152
+ ),
4153
+ 'Shadows Into Light Two' =>
4154
+ array(
4155
+ 0 => 'regular',
4156
+ ),
4157
+ 'Shanti' =>
4158
+ array(
4159
+ 0 => 'regular',
4160
+ ),
4161
+ 'Share' =>
4162
+ array(
4163
+ 0 => 'regular',
4164
+ 1 => 'italic',
4165
+ 2 => '700',
4166
+ 3 => '700italic',
4167
+ ),
4168
+ 'Share Tech' =>
4169
+ array(
4170
+ 0 => 'regular',
4171
+ ),
4172
+ 'Share Tech Mono' =>
4173
+ array(
4174
+ 0 => 'regular',
4175
+ ),
4176
+ 'Shojumaru' =>
4177
+ array(
4178
+ 0 => 'regular',
4179
+ ),
4180
+ 'Short Stack' =>
4181
+ array(
4182
+ 0 => 'regular',
4183
+ ),
4184
+ 'Shrikhand' =>
4185
+ array(
4186
+ 0 => 'regular',
4187
+ ),
4188
+ 'Siemreap' =>
4189
+ array(
4190
+ 0 => 'regular',
4191
+ ),
4192
+ 'Sigmar One' =>
4193
+ array(
4194
+ 0 => 'regular',
4195
+ ),
4196
+ 'Signika' =>
4197
+ array(
4198
+ 0 => '300',
4199
+ 1 => 'regular',
4200
+ 2 => '600',
4201
+ 3 => '700',
4202
+ ),
4203
+ 'Signika Negative' =>
4204
+ array(
4205
+ 0 => '300',
4206
+ 1 => 'regular',
4207
+ 2 => '600',
4208
+ 3 => '700',
4209
+ ),
4210
+ 'Simonetta' =>
4211
+ array(
4212
+ 0 => 'regular',
4213
+ 1 => 'italic',
4214
+ 2 => '900',
4215
+ 3 => '900italic',
4216
+ ),
4217
+ 'Sintony' =>
4218
+ array(
4219
+ 0 => 'regular',
4220
+ 1 => '700',
4221
+ ),
4222
+ 'Sirin Stencil' =>
4223
+ array(
4224
+ 0 => 'regular',
4225
+ ),
4226
+ 'Six Caps' =>
4227
+ array(
4228
+ 0 => 'regular',
4229
+ ),
4230
+ 'Skranji' =>
4231
+ array(
4232
+ 0 => 'regular',
4233
+ 1 => '700',
4234
+ ),
4235
+ 'Slabo 13px' =>
4236
+ array(
4237
+ 0 => 'regular',
4238
+ ),
4239
+ 'Slabo 27px' =>
4240
+ array(
4241
+ 0 => 'regular',
4242
+ ),
4243
+ 'Slackey' =>
4244
+ array(
4245
+ 0 => 'regular',
4246
+ ),
4247
+ 'Smokum' =>
4248
+ array(
4249
+ 0 => 'regular',
4250
+ ),
4251
+ 'Smythe' =>
4252
+ array(
4253
+ 0 => 'regular',
4254
+ ),
4255
+ 'Sniglet' =>
4256
+ array(
4257
+ 0 => 'regular',
4258
+ 1 => '800',
4259
+ ),
4260
+ 'Snippet' =>
4261
+ array(
4262
+ 0 => 'regular',
4263
+ ),
4264
+ 'Snowburst One' =>
4265
+ array(
4266
+ 0 => 'regular',
4267
+ ),
4268
+ 'Sofadi One' =>
4269
+ array(
4270
+ 0 => 'regular',
4271
+ ),
4272
+ 'Sofia' =>
4273
+ array(
4274
+ 0 => 'regular',
4275
+ ),
4276
+ 'Sonsie One' =>
4277
+ array(
4278
+ 0 => 'regular',
4279
+ ),
4280
+ 'Sorts Mill Goudy' =>
4281
+ array(
4282
+ 0 => 'regular',
4283
+ 1 => 'italic',
4284
+ ),
4285
+ 'Source Code Pro' =>
4286
+ array(
4287
+ 0 => '200',
4288
+ 1 => '300',
4289
+ 2 => 'regular',
4290
+ 3 => '500',
4291
+ 4 => '600',
4292
+ 5 => '700',
4293
+ 6 => '900',
4294
+ ),
4295
+ 'Source Sans Pro' =>
4296
+ array(
4297
+ 0 => '200',
4298
+ 1 => '200italic',
4299
+ 2 => '300',
4300
+ 3 => '300italic',
4301
+ 4 => 'regular',
4302
+ 5 => 'italic',
4303
+ 6 => '600',
4304
+ 7 => '600italic',
4305
+ 8 => '700',
4306
+ 9 => '700italic',
4307
+ 10 => '900',
4308
+ 11 => '900italic',
4309
+ ),
4310
+ 'Source Serif Pro' =>
4311
+ array(
4312
+ 0 => 'regular',
4313
+ 1 => '600',
4314
+ 2 => '700',
4315
+ ),
4316
+ 'Space Mono' =>
4317
+ array(
4318
+ 0 => 'regular',
4319
+ 1 => 'italic',
4320
+ 2 => '700',
4321
+ 3 => '700italic',
4322
+ ),
4323
+ 'Special Elite' =>
4324
+ array(
4325
+ 0 => 'regular',
4326
+ ),
4327
+ 'Spectral' =>
4328
+ array(
4329
+ 0 => '200',
4330
+ 1 => '200italic',
4331
+ 2 => '300',
4332
+ 3 => '300italic',
4333
+ 4 => 'regular',
4334
+ 5 => 'italic',
4335
+ 6 => '500',
4336
+ 7 => '500italic',
4337
+ 8 => '600',
4338
+ 9 => '600italic',
4339
+ 10 => '700',
4340
+ 11 => '700italic',
4341
+ 12 => '800',
4342
+ 13 => '800italic',
4343
+ ),
4344
+ 'Spectral SC' =>
4345
+ array(
4346
+ 0 => '200',
4347
+ 1 => '200italic',
4348
+ 2 => '300',
4349
+ 3 => '300italic',
4350
+ 4 => 'regular',
4351
+ 5 => 'italic',
4352
+ 6 => '500',
4353
+ 7 => '500italic',
4354
+ 8 => '600',
4355
+ 9 => '600italic',
4356
+ 10 => '700',
4357
+ 11 => '700italic',
4358
+ 12 => '800',
4359
+ 13 => '800italic',
4360
+ ),
4361
+ 'Spicy Rice' =>
4362
+ array(
4363
+ 0 => 'regular',
4364
+ ),
4365
+ 'Spinnaker' =>
4366
+ array(
4367
+ 0 => 'regular',
4368
+ ),
4369
+ 'Spirax' =>
4370
+ array(
4371
+ 0 => 'regular',
4372
+ ),
4373
+ 'Squada One' =>
4374
+ array(
4375
+ 0 => 'regular',
4376
+ ),
4377
+ 'Sree Krushnadevaraya' =>
4378
+ array(
4379
+ 0 => 'regular',
4380
+ ),
4381
+ 'Sriracha' =>
4382
+ array(
4383
+ 0 => 'regular',
4384
+ ),
4385
+ 'Stalemate' =>
4386
+ array(
4387
+ 0 => 'regular',
4388
+ ),
4389
+ 'Stalinist One' =>
4390
+ array(
4391
+ 0 => 'regular',
4392
+ ),
4393
+ 'Stardos Stencil' =>
4394
+ array(
4395
+ 0 => 'regular',
4396
+ 1 => '700',
4397
+ ),
4398
+ 'Stint Ultra Condensed' =>
4399
+ array(
4400
+ 0 => 'regular',
4401
+ ),
4402
+ 'Stint Ultra Expanded' =>
4403
+ array(
4404
+ 0 => 'regular',
4405
+ ),
4406
+ 'Stoke' =>
4407
+ array(
4408
+ 0 => '300',
4409
+ 1 => 'regular',
4410
+ ),
4411
+ 'Strait' =>
4412
+ array(
4413
+ 0 => 'regular',
4414
+ ),
4415
+ 'Sue Ellen Francisco' =>
4416
+ array(
4417
+ 0 => 'regular',
4418
+ ),
4419
+ 'Suez One' =>
4420
+ array(
4421
+ 0 => 'regular',
4422
+ ),
4423
+ 'Sumana' =>
4424
+ array(
4425
+ 0 => 'regular',
4426
+ 1 => '700',
4427
+ ),
4428
+ 'Sunshiney' =>
4429
+ array(
4430
+ 0 => 'regular',
4431
+ ),
4432
+ 'Supermercado One' =>
4433
+ array(
4434
+ 0 => 'regular',
4435
+ ),
4436
+ 'Sura' =>
4437
+ array(
4438
+ 0 => 'regular',
4439
+ 1 => '700',
4440
+ ),
4441
+ 'Suranna' =>
4442
+ array(
4443
+ 0 => 'regular',
4444
+ ),
4445
+ 'Suravaram' =>
4446
+ array(
4447
+ 0 => 'regular',
4448
+ ),
4449
+ 'Suwannaphum' =>
4450
+ array(
4451
+ 0 => 'regular',
4452
+ ),
4453
+ 'Swanky and Moo Moo' =>
4454
+ array(
4455
+ 0 => 'regular',
4456
+ ),
4457
+ 'Syncopate' =>
4458
+ array(
4459
+ 0 => 'regular',
4460
+ 1 => '700',
4461
+ ),
4462
+ 'Tangerine' =>
4463
+ array(
4464
+ 0 => 'regular',
4465
+ 1 => '700',
4466
+ ),
4467
+ 'Taprom' =>
4468
+ array(
4469
+ 0 => 'regular',
4470
+ ),
4471
+ 'Tauri' =>
4472
+ array(
4473
+ 0 => 'regular',
4474
+ ),
4475
+ 'Taviraj' =>
4476
+ array(
4477
+ 0 => '100',
4478
+ 1 => '100italic',
4479
+ 2 => '200',
4480
+ 3 => '200italic',
4481
+ 4 => '300',
4482
+ 5 => '300italic',
4483
+ 6 => 'regular',
4484
+ 7 => 'italic',
4485
+ 8 => '500',
4486
+ 9 => '500italic',
4487
+ 10 => '600',
4488
+ 11 => '600italic',
4489
+ 12 => '700',
4490
+ 13 => '700italic',
4491
+ 14 => '800',
4492
+ 15 => '800italic',
4493
+ 16 => '900',
4494
+ 17 => '900italic',
4495
+ ),
4496
+ 'Teko' =>
4497
+ array(
4498
+ 0 => '300',
4499
+ 1 => 'regular',
4500
+ 2 => '500',
4501
+ 3 => '600',
4502
+ 4 => '700',
4503
+ ),
4504
+ 'Telex' =>
4505
+ array(
4506
+ 0 => 'regular',
4507
+ ),
4508
+ 'Tenali Ramakrishna' =>
4509
+ array(
4510
+ 0 => 'regular',
4511
+ ),
4512
+ 'Tenor Sans' =>
4513
+ array(
4514
+ 0 => 'regular',
4515
+ ),
4516
+ 'Text Me One' =>
4517
+ array(
4518
+ 0 => 'regular',
4519
+ ),
4520
+ 'The Girl Next Door' =>
4521
+ array(
4522
+ 0 => 'regular',
4523
+ ),
4524
+ 'Tienne' =>
4525
+ array(
4526
+ 0 => 'regular',
4527
+ 1 => '700',
4528
+ 2 => '900',
4529
+ ),
4530
+ 'Tillana' =>
4531
+ array(
4532
+ 0 => 'regular',
4533
+ 1 => '500',
4534
+ 2 => '600',
4535
+ 3 => '700',
4536
+ 4 => '800',
4537
+ ),
4538
+ 'Timmana' =>
4539
+ array(
4540
+ 0 => 'regular',
4541
+ ),
4542
+ 'Tinos' =>
4543
+ array(
4544
+ 0 => 'regular',
4545
+ 1 => 'italic',
4546
+ 2 => '700',
4547
+ 3 => '700italic',
4548
+ ),
4549
+ 'Titan One' =>
4550
+ array(
4551
+ 0 => 'regular',
4552
+ ),
4553
+ 'Titillium Web' =>
4554
+ array(
4555
+ 0 => '200',
4556
+ 1 => '200italic',
4557
+ 2 => '300',
4558
+ 3 => '300italic',
4559
+ 4 => 'regular',
4560
+ 5 => 'italic',
4561
+ 6 => '600',
4562
+ 7 => '600italic',
4563
+ 8 => '700',
4564
+ 9 => '700italic',
4565
+ 10 => '900',
4566
+ ),
4567
+ 'Trade Winds' =>
4568
+ array(
4569
+ 0 => 'regular',
4570
+ ),
4571
+ 'Trirong' =>
4572
+ array(
4573
+ 0 => '100',
4574
+ 1 => '100italic',
4575
+ 2 => '200',
4576
+ 3 => '200italic',
4577
+ 4 => '300',
4578
+ 5 => '300italic',
4579
+ 6 => 'regular',
4580
+ 7 => 'italic',
4581
+ 8 => '500',
4582
+ 9 => '500italic',
4583
+ 10 => '600',
4584
+ 11 => '600italic',
4585
+ 12 => '700',
4586
+ 13 => '700italic',
4587
+ 14 => '800',
4588
+ 15 => '800italic',
4589
+ 16 => '900',
4590
+ 17 => '900italic',
4591
+ ),
4592
+ 'Trocchi' =>
4593
+ array(
4594
+ 0 => 'regular',
4595
+ ),
4596
+ 'Trochut' =>
4597
+ array(
4598
+ 0 => 'regular',
4599
+ 1 => 'italic',
4600
+ 2 => '700',
4601
+ ),
4602
+ 'Trykker' =>
4603
+ array(
4604
+ 0 => 'regular',
4605
+ ),
4606
+ 'Tulpen One' =>
4607
+ array(
4608
+ 0 => 'regular',
4609
+ ),
4610
+ 'Ubuntu' =>
4611
+ array(
4612
+ 0 => '300',
4613
+ 1 => '300italic',
4614
+ 2 => 'regular',
4615
+ 3 => 'italic',
4616
+ 4 => '500',
4617
+ 5 => '500italic',
4618
+ 6 => '700',
4619
+ 7 => '700italic',
4620
+ ),
4621
+ 'Ubuntu Condensed' =>
4622
+ array(
4623
+ 0 => 'regular',
4624
+ ),
4625
+ 'Ubuntu Mono' =>
4626
+ array(
4627
+ 0 => 'regular',
4628
+ 1 => 'italic',
4629
+ 2 => '700',
4630
+ 3 => '700italic',
4631
+ ),
4632
+ 'Ultra' =>
4633
+ array(
4634
+ 0 => 'regular',
4635
+ ),
4636
+ 'Uncial Antiqua' =>
4637
+ array(
4638
+ 0 => 'regular',
4639
+ ),
4640
+ 'Underdog' =>
4641
+ array(
4642
+ 0 => 'regular',
4643
+ ),
4644
+ 'Unica One' =>
4645
+ array(
4646
+ 0 => 'regular',
4647
+ ),
4648
+ 'UnifrakturCook' =>
4649
+ array(
4650
+ 0 => '700',
4651
+ ),
4652
+ 'UnifrakturMaguntia' =>
4653
+ array(
4654
+ 0 => 'regular',
4655
+ ),
4656
+ 'Unkempt' =>
4657
+ array(
4658
+ 0 => 'regular',
4659
+ 1 => '700',
4660
+ ),
4661
+ 'Unlock' =>
4662
+ array(
4663
+ 0 => 'regular',
4664
+ ),
4665
+ 'Unna' =>
4666
+ array(
4667
+ 0 => 'regular',
4668
+ 1 => 'italic',
4669
+ 2 => '700',
4670
+ 3 => '700italic',
4671
+ ),
4672
+ 'VT323' =>
4673
+ array(
4674
+ 0 => 'regular',
4675
+ ),
4676
+ 'Vampiro One' =>
4677
+ array(
4678
+ 0 => 'regular',
4679
+ ),
4680
+ 'Varela' =>
4681
+ array(
4682
+ 0 => 'regular',
4683
+ ),
4684
+ 'Varela Round' =>
4685
+ array(
4686
+ 0 => 'regular',
4687
+ ),
4688
+ 'Vast Shadow' =>
4689
+ array(
4690
+ 0 => 'regular',
4691
+ ),
4692
+ 'Vesper Libre' =>
4693
+ array(
4694
+ 0 => 'regular',
4695
+ 1 => '500',
4696
+ 2 => '700',
4697
+ 3 => '900',
4698
+ ),
4699
+ 'Vibur' =>
4700
+ array(
4701
+ 0 => 'regular',
4702
+ ),
4703
+ 'Vidaloka' =>
4704
+ array(
4705
+ 0 => 'regular',
4706
+ ),
4707
+ 'Viga' =>
4708
+ array(
4709
+ 0 => 'regular',
4710
+ ),
4711
+ 'Voces' =>
4712
+ array(
4713
+ 0 => 'regular',
4714
+ ),
4715
+ 'Volkhov' =>
4716
+ array(
4717
+ 0 => 'regular',
4718
+ 1 => 'italic',
4719
+ 2 => '700',
4720
+ 3 => '700italic',
4721
+ ),
4722
+ 'Vollkorn' =>
4723
+ array(
4724
+ 0 => 'regular',
4725
+ 1 => 'italic',
4726
+ 2 => '600',
4727
+ 3 => '600italic',
4728
+ 4 => '700',
4729
+ 5 => '700italic',
4730
+ 6 => '900',
4731
+ 7 => '900italic',
4732
+ ),
4733
+ 'Vollkorn SC' =>
4734
+ array(
4735
+ 0 => 'regular',
4736
+ 1 => '600',
4737
+ 2 => '700',
4738
+ 3 => '900',
4739
+ ),
4740
+ 'Voltaire' =>
4741
+ array(
4742
+ 0 => 'regular',
4743
+ ),
4744
+ 'Waiting for the Sunrise' =>
4745
+ array(
4746
+ 0 => 'regular',
4747
+ ),
4748
+ 'Wallpoet' =>
4749
+ array(
4750
+ 0 => 'regular',
4751
+ ),
4752
+ 'Walter Turncoat' =>
4753
+ array(
4754
+ 0 => 'regular',
4755
+ ),
4756
+ 'Warnes' =>
4757
+ array(
4758
+ 0 => 'regular',
4759
+ ),
4760
+ 'Wellfleet' =>
4761
+ array(
4762
+ 0 => 'regular',
4763
+ ),
4764
+ 'Wendy One' =>
4765
+ array(
4766
+ 0 => 'regular',
4767
+ ),
4768
+ 'Wire One' =>
4769
+ array(
4770
+ 0 => 'regular',
4771
+ ),
4772
+ 'Work Sans' =>
4773
+ array(
4774
+ 0 => '100',
4775
+ 1 => '200',
4776
+ 2 => '300',
4777
+ 3 => 'regular',
4778
+ 4 => '500',
4779
+ 5 => '600',
4780
+ 6 => '700',
4781
+ 7 => '800',
4782
+ 8 => '900',
4783
+ ),
4784
+ 'Yanone Kaffeesatz' =>
4785
+ array(
4786
+ 0 => '200',
4787
+ 1 => '300',
4788
+ 2 => 'regular',
4789
+ 3 => '700',
4790
+ ),
4791
+ 'Yantramanav' =>
4792
+ array(
4793
+ 0 => '100',
4794
+ 1 => '300',
4795
+ 2 => 'regular',
4796
+ 3 => '500',
4797
+ 4 => '700',
4798
+ 5 => '900',
4799
+ ),
4800
+ 'Yatra One' =>
4801
+ array(
4802
+ 0 => 'regular',
4803
+ ),
4804
+ 'Yellowtail' =>
4805
+ array(
4806
+ 0 => 'regular',
4807
+ ),
4808
+ 'Yeseva One' =>
4809
+ array(
4810
+ 0 => 'regular',
4811
+ ),
4812
+ 'Yesteryear' =>
4813
+ array(
4814
+ 0 => 'regular',
4815
+ ),
4816
+ 'Yrsa' =>
4817
+ array(
4818
+ 0 => '300',
4819
+ 1 => 'regular',
4820
+ 2 => '500',
4821
+ 3 => '600',
4822
+ 4 => '700',
4823
+ ),
4824
+ 'Zeyada' =>
4825
+ array(
4826
+ 0 => 'regular',
4827
+ ),
4828
+ 'Zilla Slab' =>
4829
+ array(
4830
+ 0 => '300',
4831
+ 1 => '300italic',
4832
+ 2 => 'regular',
4833
+ 3 => 'italic',
4834
+ 4 => '500',
4835
+ 5 => '500italic',
4836
+ 6 => '600',
4837
+ 7 => '600italic',
4838
+ 8 => '700',
4839
+ 9 => '700italic',
4840
+ ),
4841
+ 'Zilla Slab Highlight' =>
4842
+ array(
4843
+ 0 => 'regular',
4844
+ 1 => '700',
4845
+ ),
4846
+ );
base/inc/less-functions.php CHANGED
@@ -1,41 +1,41 @@
1
- <?php
2
-
3
- /**
4
- * Class siteorigin_lessc
5
- *
6
- * An extension to the SiteOrigin_LessC class that adds a few custom functions
7
- */
8
- class SiteOrigin_Widgets_Less_Functions {
9
-
10
- private $widget;
11
- private $widget_instance;
12
-
13
- function __construct($widget, $widget_instance){
14
- $this->widget = $widget;
15
- $this->widget_instance = $widget_instance;
16
- }
17
-
18
- /**
19
- * @param SiteOrigin_LessC $c
20
- *
21
- * Register less functions in a SiteOrigin_LessC object
22
- */
23
- function registerFunctions(&$c){
24
- if( method_exists( $c, 'registerFunction' ) ) {
25
- $c->registerFunction( 'length', array($this, 'length') );
26
- }
27
- }
28
-
29
- /**
30
- * Very basic length function that checks the length of a list. Might need some more checks for other types.
31
- *
32
- * @param $arg
33
- *
34
- * @return int
35
- */
36
- function length($arg){
37
- if(empty($arg[0]) || empty($arg[2]) || $arg[0] != 'list') return 1;
38
- return count($arg[2]);
39
- }
40
-
41
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class siteorigin_lessc
5
+ *
6
+ * An extension to the SiteOrigin_LessC class that adds a few custom functions
7
+ */
8
+ class SiteOrigin_Widgets_Less_Functions {
9
+
10
+ private $widget;
11
+ private $widget_instance;
12
+
13
+ function __construct($widget, $widget_instance){
14
+ $this->widget = $widget;
15
+ $this->widget_instance = $widget_instance;
16
+ }
17
+
18
+ /**
19
+ * @param SiteOrigin_LessC $c
20
+ *
21
+ * Register less functions in a SiteOrigin_LessC object
22
+ */
23
+ function registerFunctions(&$c){
24
+ if( method_exists( $c, 'registerFunction' ) ) {
25
+ $c->registerFunction( 'length', array($this, 'length') );
26
+ }
27
+ }
28
+
29
+ /**
30
+ * Very basic length function that checks the length of a list. Might need some more checks for other types.
31
+ *
32
+ * @param $arg
33
+ *
34
+ * @return int
35
+ */
36
+ function length($arg){
37
+ if(empty($arg[0]) || empty($arg[2]) || $arg[0] != 'list') return 1;
38
+ return count($arg[2]);
39
+ }
40
+
41
+ }
base/inc/lessc.inc.php CHANGED
@@ -1,283 +1,283 @@
1
- <?php
2
- /**
3
- * This file provides the part of lessphp API (https://github.com/leafo/lessphp)
4
- * to be a drop-in replacement for following products:
5
- * - Drupal 7, by the less module v3.0+ (https://drupal.org/project/less)
6
- * - Symfony 2
7
- *
8
- * @SiteOrigin: We originally used leafo/lessphp (https://github.com/leafo/lessphp), until we found it wasn't
9
- * maintained and missed some newer LESS features. We then migrated to a more recent and maintained repo
10
- * (https://github.com/oyejorge/less.php) simply replacing leafo's lessc.inc.php with the one from oyejorge. This
11
- * worked well until users started running PHP 7 compatibility checkers which found some issues, so now we have our own
12
- * fork here: https://github.com/siteorigin/less.php We have fixed the PHP 7 compatibility issues and will only make
13
- * more changes if there are severe issues.
14
- */
15
-
16
- // Register autoloader for non-composer installations
17
- if ( !class_exists( 'Less_Parser' ) ) {
18
- require_once dirname( __FILE__ ) . '/lib/Less/Autoloader.php';
19
- Less_Autoloader::register();
20
- }
21
-
22
- class SiteOrigin_LessC {
23
-
24
- static public $VERSION = Less_Version::less_version;
25
-
26
- public $importDir = '';
27
- protected $allParsedFiles = array();
28
- protected $libFunctions = array();
29
- protected $registeredVars = array();
30
- private $formatterName;
31
- private $options = array();
32
-
33
- public function __construct( $lessc=null, $sourceName=null ) {}
34
-
35
- public function setImportDir( $dirs ) {
36
- $this->importDir = (array)$dirs;
37
- }
38
-
39
- public function addImportDir( $dir ) {
40
- $this->importDir = (array)$this->importDir;
41
- $this->importDir[] = $dir;
42
- }
43
-
44
- public function setFormatter( $name ) {
45
- $this->formatterName = $name;
46
- }
47
-
48
- public function setPreserveComments( $preserve ) {}
49
-
50
- public function registerFunction( $name, $func ) {
51
- $this->libFunctions[$name] = $func;
52
- }
53
-
54
- public function unregisterFunction( $name ) {
55
- unset( $this->libFunctions[$name] );
56
- }
57
-
58
- public function setVariables( $variables ){
59
- foreach ( $variables as $name => $value ) {
60
- $this->setVariable( $name, $value );
61
- }
62
- }
63
-
64
- public function setVariable( $name, $value ) {
65
- $this->registeredVars[$name] = $value;
66
- }
67
-
68
- public function unsetVariable( $name ) {
69
- unset( $this->registeredVars[$name] );
70
- }
71
-
72
- public function setOptions( $options ) {
73
- foreach ( $options as $name => $value ) {
74
- $this->setOption( $name, $value);
75
- }
76
- }
77
-
78
- public function setOption( $name, $value ) {
79
- $this->options[$name] = $value;
80
- }
81
-
82
- public function parse( $buffer, $presets = array() ) {
83
-
84
- $this->setVariables( $presets );
85
-
86
- $parser = new Less_Parser( $this->getOptions() );
87
- $parser->setImportDirs( $this->getImportDirs() );
88
- foreach ( $this->libFunctions as $name => $func ) {
89
- $parser->registerFunction( $name, $func );
90
- }
91
- $parser->parse($buffer);
92
- if ( count( $this->registeredVars ) ) {
93
- $parser->ModifyVars( $this->registeredVars );
94
- }
95
-
96
- return $parser->getCss();
97
- }
98
-
99
- protected function getOptions() {
100
- $options = array( 'relativeUrls'=>false );
101
- switch( $this->formatterName ) {
102
- case 'compressed':
103
- $options['compress'] = true;
104
- break;
105
- }
106
- if (is_array($this->options))
107
- {
108
- $options = array_merge($options, $this->options);
109
- }
110
- return $options;
111
- }
112
-
113
- protected function getImportDirs() {
114
- $dirs_ = (array)$this->importDir;
115
- $dirs = array();
116
- foreach ( $dirs_ as $dir ) {
117
- $dirs[$dir] = '';
118
- }
119
- return $dirs;
120
- }
121
-
122
- public function compile( $string, $name = null ) {
123
-
124
- $oldImport = $this->importDir;
125
- $this->importDir = (array)$this->importDir;
126
-
127
- $this->allParsedFiles = array();
128
-
129
- $parser = new Less_Parser( $this->getOptions() );
130
- $parser->SetImportDirs( $this->getImportDirs() );
131
- if ( count( $this->registeredVars ) ) {
132
- $parser->ModifyVars( $this->registeredVars );
133
- }
134
- foreach ( $this->libFunctions as $name => $func ) {
135
- $parser->registerFunction( $name, $func );
136
- }
137
- $parser->parse( $string );
138
- $out = $parser->getCss();
139
-
140
- $parsed = Less_Parser::AllParsedFiles();
141
- foreach ( $parsed as $file ) {
142
- $this->addParsedFile( $file );
143
- }
144
-
145
- $this->importDir = $oldImport;
146
-
147
- return $out;
148
- }
149
-
150
- public function compileFile( $fname, $outFname = null ) {
151
- if ( !is_readable( $fname ) ) {
152
- throw new Exception( 'load error: failed to find '.$fname );
153
- }
154
-
155
- $pi = pathinfo( $fname );
156
-
157
- $oldImport = $this->importDir;
158
-
159
- $this->importDir = (array)$this->importDir;
160
- $this->importDir[] = Less_Parser::AbsPath( $pi['dirname'] ).'/';
161
-
162
- $this->allParsedFiles = array();
163
- $this->addParsedFile( $fname );
164
-
165
- $parser = new Less_Parser( $this->getOptions() );
166
- $parser->SetImportDirs( $this->getImportDirs() );
167
- if ( count( $this->registeredVars ) ) {
168
- $parser->ModifyVars( $this->registeredVars );
169
- }
170
- foreach ( $this->libFunctions as $name => $func ) {
171
- $parser->registerFunction( $name, $func );
172
- }
173
- $parser->parseFile( $fname );
174
- $out = $parser->getCss();
175
-
176
- $parsed = Less_Parser::AllParsedFiles();
177
- foreach ( $parsed as $file ) {
178
- $this->addParsedFile( $file );
179
- }
180
-
181
- $this->importDir = $oldImport;
182
-
183
- if ( $outFname !== null ) {
184
- return file_put_contents( $outFname, $out );
185
- }
186
-
187
- return $out;
188
- }
189
-
190
- public function checkedCompile( $in, $out ) {
191
- if ( !is_file( $out ) || filemtime( $in ) > filemtime( $out ) ) {
192
- $this->compileFile($in, $out);
193
- return true;
194
- }
195
- return false;
196
- }
197
-
198
-
199
- /**
200
- * Execute lessphp on a .less file or a lessphp cache structure
201
- *
202
- * The lessphp cache structure contains information about a specific
203
- * less file having been parsed. It can be used as a hint for future
204
- * calls to determine whether or not a rebuild is required.
205
- *
206
- * The cache structure contains two important keys that may be used
207
- * externally:
208
- *
209
- * compiled: The final compiled CSS
210
- * updated: The time (in seconds) the CSS was last compiled
211
- *
212
- * The cache structure is a plain-ol' PHP associative array and can
213
- * be serialized and unserialized without a hitch.
214
- *
215
- * @param mixed $in Input
216
- * @param bool $force Force rebuild?
217
- * @return array lessphp cache structure
218
- */
219
- public function cachedCompile( $in, $force = false ) {
220
- // assume no root
221
- $root = null;
222
-
223
- if ( is_string( $in ) ) {
224
- $root = $in;
225
- } elseif ( is_array( $in ) and isset( $in['root'] ) ) {
226
- if ( $force or ! isset( $in['files'] ) ) {
227
- // If we are forcing a recompile or if for some reason the
228
- // structure does not contain any file information we should
229
- // specify the root to trigger a rebuild.
230
- $root = $in['root'];
231
- } elseif ( isset( $in['files'] ) and is_array( $in['files'] ) ) {
232
- foreach ( $in['files'] as $fname => $ftime ) {
233
- if ( !file_exists( $fname ) or filemtime( $fname ) > $ftime ) {
234
- // One of the files we knew about previously has changed
235
- // so we should look at our incoming root again.
236
- $root = $in['root'];
237
- break;
238
- }
239
- }
240
- }
241
- } else {
242
- // TODO: Throw an exception? We got neither a string nor something
243
- // that looks like a compatible lessphp cache structure.
244
- return null;
245
- }
246
-
247
- if ( $root !== null ) {
248
- // If we have a root value which means we should rebuild.
249
- $out = array();
250
- $out['root'] = $root;
251
- $out['compiled'] = $this->compileFile($root);
252
- $out['files'] = $this->allParsedFiles();
253
- $out['updated'] = time();
254
- return $out;
255
- } else {
256
- // No changes, pass back the structure
257
- // we were given initially.
258
- return $in;
259
- }
260
- }
261
-
262
- public function ccompile( $in, $out, $less = null ) {
263
- if ( $less === null ) {
264
- $less = new self;
265
- }
266
- return $less->checkedCompile( $in, $out );
267
- }
268
-
269
- public static function cexecute( $in, $force = false, $less = null ) {
270
- if ( $less === null ) {
271
- $less = new self;
272
- }
273
- return $less->cachedCompile($in, $force);
274
- }
275
-
276
- public function allParsedFiles() {
277
- return $this->allParsedFiles;
278
- }
279
-
280
- protected function addParsedFile( $file ) {
281
- $this->allParsedFiles[Less_Parser::AbsPath( $file )] = filemtime( $file );
282
- }
283
- }
1
+ <?php
2
+ /**
3
+ * This file provides the part of lessphp API (https://github.com/leafo/lessphp)
4
+ * to be a drop-in replacement for following products:
5
+ * - Drupal 7, by the less module v3.0+ (https://drupal.org/project/less)
6
+ * - Symfony 2
7
+ *
8
+ * @SiteOrigin: We originally used leafo/lessphp (https://github.com/leafo/lessphp), until we found it wasn't
9
+ * maintained and missed some newer LESS features. We then migrated to a more recent and maintained repo
10
+ * (https://github.com/oyejorge/less.php) simply replacing leafo's lessc.inc.php with the one from oyejorge. This
11
+ * worked well until users started running PHP 7 compatibility checkers which found some issues, so now we have our own
12
+ * fork here: https://github.com/siteorigin/less.php We have fixed the PHP 7 compatibility issues and will only make
13
+ * more changes if there are severe issues.
14
+ */
15
+
16
+ // Register autoloader for non-composer installations
17
+ if ( !class_exists( 'Less_Parser' ) ) {
18
+ require_once dirname( __FILE__ ) . '/lib/Less/Autoloader.php';
19
+ Less_Autoloader::register();
20
+ }
21
+
22
+ class SiteOrigin_LessC {
23
+
24
+ static public $VERSION = Less_Version::less_version;
25
+
26
+ public $importDir = '';
27
+ protected $allParsedFiles = array();
28
+ protected $libFunctions = array();
29
+ protected $registeredVars = array();
30
+ private $formatterName;
31
+ private $options = array();
32
+
33
+ public function __construct( $lessc=null, $sourceName=null ) {}
34
+
35
+ public function setImportDir( $dirs ) {
36
+ $this->importDir = (array)$dirs;
37
+ }
38
+
39
+ public function addImportDir( $dir ) {
40
+ $this->importDir = (array)$this->importDir;
41
+ $this->importDir[] = $dir;
42
+ }
43
+
44
+ public function setFormatter( $name ) {
45
+ $this->formatterName = $name;
46
+ }
47
+
48
+ public function setPreserveComments( $preserve ) {}
49
+
50
+ public function registerFunction( $name, $func ) {
51
+ $this->libFunctions[$name] = $func;
52
+ }
53
+
54
+ public function unregisterFunction( $name ) {
55
+ unset( $this->libFunctions[$name] );
56
+ }
57
+
58
+ public function setVariables( $variables ){
59
+ foreach ( $variables as $name => $value ) {
60
+ $this->setVariable( $name, $value );
61
+ }
62
+ }
63
+
64
+ public function setVariable( $name, $value ) {
65
+ $this->registeredVars[$name] = $value;
66
+ }
67
+
68
+ public function unsetVariable( $name ) {
69
+ unset( $this->registeredVars[$name] );
70
+ }
71
+
72
+ public function setOptions( $options ) {
73
+ foreach ( $options as $name => $value ) {
74
+ $this->setOption( $name, $value);
75
+ }
76
+ }
77
+
78
+ public function setOption( $name, $value ) {
79
+ $this->options[$name] = $value;
80
+ }
81
+
82
+ public function parse( $buffer, $presets = array() ) {
83
+
84
+ $this->setVariables( $presets );
85
+
86
+ $parser = new Less_Parser( $this->getOptions() );
87
+ $parser->setImportDirs( $this->getImportDirs() );
88
+ foreach ( $this->libFunctions as $name => $func ) {
89
+ $parser->registerFunction( $name, $func );
90
+ }
91
+ $parser->parse($buffer);
92
+ if ( count( $this->registeredVars ) ) {
93
+ $parser->ModifyVars( $this->registeredVars );
94
+ }
95
+
96
+ return $parser->getCss();
97
+ }
98
+
99
+ protected function getOptions() {
100
+ $options = array( 'relativeUrls'=>false );
101
+ switch( $this->formatterName ) {
102
+ case 'compressed':
103
+ $options['compress'] = true;
104
+ break;
105
+ }
106
+ if (is_array($this->options))
107
+ {
108
+ $options = array_merge($options, $this->options);
109
+ }
110
+ return $options;
111
+ }
112
+
113
+ protected function getImportDirs() {
114
+ $dirs_ = (array)$this->importDir;
115
+ $dirs = array();
116
+ foreach ( $dirs_ as $dir ) {
117
+ $dirs[$dir] = '';
118
+ }
119
+ return $dirs;
120
+ }
121
+
122
+ public function compile( $string, $name = null ) {
123
+
124
+ $oldImport = $this->importDir;
125
+ $this->importDir = (array)$this->importDir;
126
+
127
+ $this->allParsedFiles = array();
128
+
129
+ $parser = new Less_Parser( $this->getOptions() );
130
+ $parser->SetImportDirs( $this->getImportDirs() );
131
+ if ( count( $this->registeredVars ) ) {
132
+ $parser->ModifyVars( $this->registeredVars );
133
+ }
134
+ foreach ( $this->libFunctions as $name => $func ) {
135
+ $parser->registerFunction( $name, $func );
136
+ }
137
+ $parser->parse( $string );
138
+ $out = $parser->getCss();
139
+
140
+ $parsed = Less_Parser::AllParsedFiles();
141
+ foreach ( $parsed as $file ) {
142
+ $this->addParsedFile( $file );
143
+ }
144
+
145
+ $this->importDir = $oldImport;
146
+
147
+ return $out;
148
+ }
149
+
150
+ public function compileFile( $fname, $outFname = null ) {
151
+ if ( !is_readable( $fname ) ) {
152
+ throw new Exception( 'load error: failed to find '.$fname );
153
+ }
154
+
155
+ $pi = pathinfo( $fname );
156
+
157
+ $oldImport = $this->importDir;
158
+
159
+ $this->importDir = (array)$this->importDir;
160
+ $this->importDir[] = Less_Parser::AbsPath( $pi['dirname'] ).'/';
161
+
162
+ $this->allParsedFiles = array();
163
+ $this->addParsedFile( $fname );
164
+
165
+ $parser = new Less_Parser( $this->getOptions() );
166
+ $parser->SetImportDirs( $this->getImportDirs() );
167
+ if ( count( $this->registeredVars ) ) {
168
+ $parser->ModifyVars( $this->registeredVars );
169
+ }
170
+ foreach ( $this->libFunctions as $name => $func ) {
171
+ $parser->registerFunction( $name, $func );
172
+ }
173
+ $parser->parseFile( $fname );
174
+ $out = $parser->getCss();
175
+
176
+ $parsed = Less_Parser::AllParsedFiles();
177
+ foreach ( $parsed as $file ) {
178
+ $this->addParsedFile( $file );
179
+ }
180
+
181
+ $this->importDir = $oldImport;
182
+
183
+ if ( $outFname !== null ) {
184
+ return file_put_contents( $outFname, $out );
185
+ }
186
+
187
+ return $out;
188
+ }
189
+
190
+ public function checkedCompile( $in, $out ) {
191
+ if ( !is_file( $out ) || filemtime( $in ) > filemtime( $out ) ) {
192
+ $this->compileFile($in, $out);
193
+ return true;
194
+ }
195
+ return false;
196
+ }
197
+
198
+
199
+ /**
200
+ * Execute lessphp on a .less file or a lessphp cache structure
201
+ *
202
+ * The lessphp cache structure contains information about a specific
203
+ * less file having been parsed. It can be used as a hint for future
204
+ * calls to determine whether or not a rebuild is required.
205
+ *
206
+ * The cache structure contains two important keys that may be used
207
+ * externally:
208
+ *
209
+ * compiled: The final compiled CSS
210
+ * updated: The time (in seconds) the CSS was last compiled
211
+ *
212
+ * The cache structure is a plain-ol' PHP associative array and can
213
+ * be serialized and unserialized without a hitch.
214
+ *
215
+ * @param mixed $in Input
216
+ * @param bool $force Force rebuild?
217
+ * @return array lessphp cache structure
218
+ */
219
+ public function cachedCompile( $in, $force = false ) {
220
+ // assume no root
221
+ $root = null;
222
+
223
+ if ( is_string( $in ) ) {
224
+ $root = $in;
225
+ } elseif ( is_array( $in ) and isset( $in['root'] ) ) {
226
+ if ( $force or ! isset( $in['files'] ) ) {
227
+ // If we are forcing a recompile or if for some reason the
228
+ // structure does not contain any file information we should
229
+ // specify the root to trigger a rebuild.
230
+ $root = $in['root'];
231
+ } elseif ( isset( $in['files'] ) and is_array( $in['files'] ) ) {
232
+ foreach ( $in['files'] as $fname => $ftime ) {
233
+ if ( !file_exists( $fname ) or filemtime( $fname ) > $ftime ) {
234
+ // One of the files we knew about previously has changed
235
+ // so we should look at our incoming root again.
236
+ $root = $in['root'];
237
+ break;
238
+ }
239
+ }
240
+ }
241
+ } else {
242
+ // TODO: Throw an exception? We got neither a string nor something
243
+ // that looks like a compatible lessphp cache structure.
244
+ return null;
245
+ }
246
+
247
+ if ( $root !== null ) {
248
+ // If we have a root value which means we should rebuild.
249
+ $out = array();
250
+ $out['root'] = $root;
251
+ $out['compiled'] = $this->compileFile($root);
252
+ $out['files'] = $this->allParsedFiles();
253
+ $out['updated'] = time();
254
+ return $out;
255
+ } else {
256
+ // No changes, pass back the structure
257
+ // we were given initially.
258
+ return $in;
259
+ }
260
+ }
261
+
262
+ public function ccompile( $in, $out, $less = null ) {
263
+ if ( $less === null ) {
264
+ $less = new self;
265
+ }
266
+ return $less->checkedCompile( $in, $out );
267
+ }
268
+
269
+ public static function cexecute( $in, $force = false, $less = null ) {
270
+ if ( $less === null ) {
271
+ $less = new self;
272
+ }
273
+ return $less->cachedCompile($in, $force);
274
+ }
275
+
276
+ public function allParsedFiles() {
277
+ return $this->allParsedFiles;
278
+ }
279
+
280
+ protected function addParsedFile( $file ) {
281
+ $this->allParsedFiles[Less_Parser::AbsPath( $file )] = filemtime( $file );
282
+ }
283
+ }
base/inc/lib/Less/Exception/Chunk.php CHANGED
@@ -1,198 +1,198 @@
1
- <?php
2
-
3
- /**
4
- * Chunk Exception
5
- *
6
- * @package Less
7
- * @subpackage exception
8
- */
9
- class Less_Exception_Chunk extends Less_Exception_Parser{
10
-
11
-
12
- protected $parserCurrentIndex = 0;
13
-
14
- protected $emitFrom = 0;
15
-
16
- protected $input_len;
17
-
18
-
19
- /**
20
- * Constructor
21
- *
22
- * @param string $input
23
- * @param Exception $previous Previous exception
24
- * @param integer $index The current parser index
25
- * @param Less_FileInfo|string $currentFile The file
26
- * @param integer $code The exception code
27
- */
28
- public function __construct($input, Exception $previous = null, $index = null, $currentFile = null, $code = 0){
29
-
30
- $this->message = 'ParseError: Unexpected input'; //default message
31
-
32
- $this->index = $index;
33
-
34
- $this->currentFile = $currentFile;
35
-
36
- $this->input = $input;
37
- $this->input_len = strlen($input);
38
-
39
- $this->Chunks();
40
- $this->genMessage();
41
- }
42
-
43
-
44
- /**
45
- * See less.js chunks()
46
- * We don't actually need the chunks
47
- *
48
- */
49
- protected function Chunks(){
50
- $level = 0;
51
- $parenLevel = 0;
52
- $lastMultiCommentEndBrace = null;
53
- $lastOpening = null;
54
- $lastMultiComment = null;
55
- $lastParen = null;
56
-
57
- for( $this->parserCurrentIndex = 0; $this->parserCurrentIndex < $this->input_len; $this->parserCurrentIndex++ ){
58
- $cc = $this->CharCode($this->parserCurrentIndex);
59
- if ((($cc >= 97) && ($cc <= 122)) || ($cc < 34)) {
60
- // a-z or whitespace
61
- continue;
62
- }
63
-
64
- switch ($cc) {
65
-
66
- // (
67
- case 40:
68
- $parenLevel++;
69
- $lastParen = $this->parserCurrentIndex;
70
- break;
71
- // )
72
- case 41:
73
- $parenLevel--;
74
- if( $parenLevel < 0 ){
75
- return $this->fail("missing opening `(`");
76
- }
77
- break;
78
- // ;
79
- case 59:
80
- //if (!$parenLevel) { $this->emitChunk(); }
81
- break;
82
- // {
83
- case 123:
84
- $level++;
85
- $lastOpening = $this->parserCurrentIndex;
86
- break;
87
- // }
88
- case 125:
89
- $level--;
90
- if( $level < 0 ){
91
- return $this->fail("missing opening `{`");
92
-
93
- }
94
- //if (!$level && !$parenLevel) { $this->emitChunk(); }
95
- break;
96
- // \
97
- case 92:
98
- if ($this->parserCurrentIndex < $this->input_len - 1) { $this->parserCurrentIndex++; break; }
99
- return $this->fail("unescaped `\\`");
100
-
101
- // ", ' and `
102
- case 34:
103
- case 39:
104
- case 96:
105
- $matched = 0;
106
- $currentChunkStartIndex = $this->parserCurrentIndex;
107
- for ($this->parserCurrentIndex = $this->parserCurrentIndex + 1; $this->parserCurrentIndex < $this->input_len; $this->parserCurrentIndex++) {
108
- $cc2 = $this->CharCode($this->parserCurrentIndex);
109
- if ($cc2 > 96) { continue; }
110
- if ($cc2 == $cc) { $matched = 1; break; }
111
- if ($cc2 == 92) { // \
112
- if ($this->parserCurrentIndex == $this->input_len - 1) {
113
- return $this->fail("unescaped `\\`");
114
- }
115
- $this->parserCurrentIndex++;
116
- }
117
- }
118
- if ($matched) { break; }
119
- return $this->fail("unmatched `" . chr($cc) . "`", $currentChunkStartIndex);
120
-
121
- // /, check for comment
122
- case 47:
123
- if ($parenLevel || ($this->parserCurrentIndex == $this->input_len - 1)) { break; }
124
- $cc2 = $this->CharCode($this->parserCurrentIndex+1);
125
- if ($cc2 == 47) {
126
- // //, find lnfeed
127
- for ($this->parserCurrentIndex = $this->parserCurrentIndex + 2; $this->parserCurrentIndex < $this->input_len; $this->parserCurrentIndex++) {
128
- $cc2 = $this->CharCode($this->parserCurrentIndex);
129
- if (($cc2 <= 13) && (($cc2 == 10) || ($cc2 == 13))) { break; }
130
- }
131
- } else if ($cc2 == 42) {
132
- // /*, find */
133
- $lastMultiComment = $currentChunkStartIndex = $this->parserCurrentIndex;
134
- for ($this->parserCurrentIndex = $this->parserCurrentIndex + 2; $this->parserCurrentIndex < $this->input_len - 1; $this->parserCurrentIndex++) {
135
- $cc2 = $this->CharCode($this->parserCurrentIndex);
136
- if ($cc2 == 125) { $lastMultiCommentEndBrace = $this->parserCurrentIndex; }
137
- if ($cc2 != 42) { continue; }
138
- if ($this->CharCode($this->parserCurrentIndex+1) == 47) { break; }
139
- }
140
- if ($this->parserCurrentIndex == $this->input_len - 1) {
141
- return $this->fail("missing closing `*/`", $currentChunkStartIndex);
142
- }
143
- }
144
- break;
145
- // *, check for unmatched */
146
- case 42:
147
- if (($this->parserCurrentIndex < $this->input_len - 1) && ($this->CharCode($this->parserCurrentIndex+1) == 47)) {
148
- return $this->fail("unmatched `/*`");
149
- }
150
- break;
151
- }
152
- }
153
-
154
- if( $level !== 0 ){
155
- if( ($lastMultiComment > $lastOpening) && ($lastMultiCommentEndBrace > $lastMultiComment) ){
156
- return $this->fail("missing closing `}` or `*/`", $lastOpening);
157
- } else {
158
- return $this->fail("missing closing `}`", $lastOpening);
159
- }
160
- } else if ( $parenLevel !== 0 ){
161
- return $this->fail("missing closing `)`", $lastParen);
162
- }
163
-
164
-
165
- //chunk didn't fail
166
-
167
-
168
- //$this->emitChunk(true);
169
- }
170
-
171
- public function CharCode($pos){
172
- return ord($this->input[$pos]);
173
- }
174
-
175
-
176
- public function fail( $msg, $index = null ){
177
-
178
- if( !$index ){
179
- $this->index = $this->parserCurrentIndex;
180
- }else{
181
- $this->index = $index;
182
- }
183
- $this->message = 'ParseError: '.$msg;
184
- }
185
-
186
-
187
- /*
188
- function emitChunk( $force = false ){
189
- $len = $this->parserCurrentIndex - $this->emitFrom;
190
- if ((($len < 512) && !$force) || !$len) {
191
- return;
192
- }
193
- $chunks[] = substr($this->input, $this->emitFrom, $this->parserCurrentIndex + 1 - $this->emitFrom );
194
- $this->emitFrom = $this->parserCurrentIndex + 1;
195
- }
196
- */
197
-
198
- }
1
+ <?php
2
+
3
+ /**
4
+ * Chunk Exception
5
+ *
6
+ * @package Less
7
+ * @subpackage exception
8
+ */
9
+ class Less_Exception_Chunk extends Less_Exception_Parser{
10
+
11
+
12
+ protected $parserCurrentIndex = 0;
13
+
14
+ protected $emitFrom = 0;
15
+
16
+ protected $input_len;
17
+
18
+
19
+ /**
20
+ * Constructor
21
+ *
22
+ * @param string $input
23
+ * @param Exception $previous Previous exception
24
+ * @param integer $index The current parser index
25
+ * @param Less_FileInfo|string $currentFile The file
26
+ * @param integer $code The exception code
27
+ */
28
+ public function __construct($input, Exception $previous = null, $index = null, $currentFile = null, $code = 0){
29
+
30
+ $this->message = 'ParseError: Unexpected input'; //default message
31
+
32
+ $this->index = $index;
33
+
34
+ $this->currentFile = $currentFile;
35
+
36
+ $this->input = $input;
37
+ $this->input_len = strlen($input);
38
+
39
+ $this->Chunks();
40
+ $this->genMessage();
41
+ }
42
+
43
+
44
+ /**
45
+ * See less.js chunks()
46
+ * We don't actually need the chunks
47
+ *
48
+ */
49
+ protected function Chunks(){
50
+ $level = 0;
51
+ $parenLevel = 0;
52
+ $lastMultiCommentEndBrace = null;
53
+ $lastOpening = null;
54
+ $lastMultiComment = null;
55
+ $lastParen = null;
56
+
57
+ for( $this->parserCurrentIndex = 0; $this->parserCurrentIndex < $this->input_len; $this->parserCurrentIndex++ ){
58
+ $cc = $this->CharCode($this->parserCurrentIndex);
59
+ if ((($cc >= 97) && ($cc <= 122)) || ($cc < 34)) {
60
+ // a-z or whitespace
61
+ continue;
62
+ }
63
+
64
+ switch ($cc) {
65
+
66
+ // (
67
+ case 40:
68
+ $parenLevel++;
69
+ $lastParen = $this->parserCurrentIndex;
70
+ break;
71
+ // )
72
+ case 41:
73
+ $parenLevel--;
74
+ if( $parenLevel < 0 ){
75
+ return $this->fail("missing opening `(`");
76
+ }
77
+ break;
78
+ // ;
79
+ case 59:
80
+ //if (!$parenLevel) { $this->emitChunk(); }
81
+ break;
82
+ // {
83
+ case 123:
84
+ $level++;
85
+ $lastOpening = $this->parserCurrentIndex;
86
+ break;
87
+ // }
88
+ case 125:
89
+ $level--;
90
+ if( $level < 0 ){
91
+ return $this->fail("missing opening `{`");
92
+
93
+ }
94
+ //if (!$level && !$parenLevel) { $this->emitChunk(); }
95
+ break;
96
+ // \
97
+ case 92:
98
+ if ($this->parserCurrentIndex < $this->input_len - 1) { $this->parserCurrentIndex++; break; }
99
+ return $this->fail("unescaped `\\`");
100
+
101
+ // ", ' and `
102
+ case 34:
103
+ case 39:
104
+ case 96:
105
+ $matched = 0;
106
+ $currentChunkStartIndex = $this->parserCurrentIndex;
107
+ for ($this->parserCurrentIndex = $this->parserCurrentIndex + 1; $this->parserCurrentIndex < $this->input_len; $this->parserCurrentIndex++) {
108
+ $cc2 = $this->CharCode($this->parserCurrentIndex);
109
+ if ($cc2 > 96) { continue; }
110
+ if ($cc2 == $cc) { $matched = 1; break; }
111
+ if ($cc2 == 92) { // \
112
+ if ($this->parserCurrentIndex == $this->input_len - 1) {
113
+ return $this->fail("unescaped `\\`");
114
+ }
115
+ $this->parserCurrentIndex++;
116
+ }
117
+ }
118
+ if ($matched) { break; }
119
+ return $this->fail("unmatched `" . chr($cc) . "`", $currentChunkStartIndex);
120
+
121
+ // /, check for comment
122
+ case 47:
123
+ if ($parenLevel || ($this->parserCurrentIndex == $this->input_len - 1)) { break; }
124
+ $cc2 = $this->CharCode($this->parserCurrentIndex+1);
125
+ if ($cc2 == 47) {
126
+ // //, find lnfeed
127
+ for ($this->parserCurrentIndex = $this->parserCurrentIndex + 2; $this->parserCurrentIndex < $this->input_len; $this->parserCurrentIndex++) {
128
+ $cc2 = $this->CharCode($this->parserCurrentIndex);
129
+ if (($cc2 <= 13) && (($cc2 == 10) || ($cc2 == 13))) { break; }
130
+ }
131
+ } else if ($cc2 == 42) {
132
+ // /*, find */
133
+ $lastMultiComment = $currentChunkStartIndex = $this->parserCurrentIndex;
134
+ for ($this->parserCurrentIndex = $this->parserCurrentIndex + 2; $this->parserCurrentIndex < $this->input_len - 1; $this->parserCurrentIndex++) {
135
+ $cc2 = $this->CharCode($this->parserCurrentIndex);
136
+ if ($cc2 == 125) { $lastMultiCommentEndBrace = $this->parserCurrentIndex; }
137
+ if ($cc2 != 42) { continue; }
138
+ if ($this->CharCode($this->parserCurrentIndex+1) == 47) { break; }
139
+ }
140
+ if ($this->parserCurrentIndex == $this->input_len - 1) {
141
+ return $this->fail("missing closing `*/`", $currentChunkStartIndex);
142
+ }
143
+ }
144
+ break;
145
+ // *, check for unmatched */
146
+ case 42:
147
+ if (($this->parserCurrentIndex < $this->input_len - 1) && ($this->CharCode($this->parserCurrentIndex+1) == 47)) {
148
+ return $this->fail("unmatched `/*`");
149
+ }
150
+ break;
151
+ }
152
+ }
153
+
154
+ if( $level !== 0 ){
155
+ if( ($lastMultiComment > $lastOpening) && ($lastMultiCommentEndBrace > $lastMultiComment) ){
156
+ return $this->fail("missing closing `}` or `*/`", $lastOpening);
157
+ } else {
158
+ return $this->fail("missing closing `}`", $lastOpening);
159
+ }
160
+ } else if ( $parenLevel !== 0 ){
161
+ return $this->fail("missing closing `)`", $lastParen);
162
+ }
163
+
164
+
165
+ //chunk didn't fail
166
+
167
+
168
+ //$this->emitChunk(true);
169
+ }
170
+
171
+ public function CharCode($pos){
172
+ return ord($this->input[$pos]);
173
+ }
174
+
175
+
176
+ public function fail( $msg, $index = null ){
177
+
178
+ if( !$index ){
179
+ $this->index = $this->parserCurrentIndex;
180
+ }else{
181
+ $this->index = $index;
182
+ }
183
+ $this->message = 'ParseError: '.$msg;
184
+ }
185
+
186
+
187
+ /*
188
+ function emitChunk( $force = false ){
189
+ $len = $this->parserCurrentIndex - $this->emitFrom;
190
+ if ((($len < 512) && !$force) || !$len) {
191
+ return;
192
+ }
193
+ $chunks[] = substr($this->input, $this->emitFrom, $this->parserCurrentIndex + 1 - $this->emitFrom );
194
+ $this->emitFrom = $this->parserCurrentIndex + 1;
195
+ }
196
+ */
197
+
198
+ }
base/inc/meta-box-manager.php CHANGED
@@ -1,177 +1,177 @@
1
- <?php
2
-
3
- class SiteOrigin_Widget_Meta_Box_Manager extends SiteOrigin_Widget {
4
-
5
- const POST_META_KEY = 'siteorigin-widgets-post-meta';
6
-
7
- /**
8
- * @var array Fields which have been added for each widget.
9
- */
10
- private $widget_form_fields;
11
-
12
- /**
13
- * @var array Post types for which fields have been added.
14
- */
15
- private $post_types;
16
-
17
- /**
18
- * Get the single instance.
19
- *
20
- * @return SiteOrigin_Widget_Meta_Box_Manager
21
- */
22
- static function single(){
23
- static $single = false;
24
- if( empty($single) ) $single = new SiteOrigin_Widget_Meta_Box_Manager();
25
-
26
- return $single;
27
- }
28
-
29
- /**
30
- * Private
31
- */
32
- public function __construct() {
33
- parent::__construct(
34
- 'sow-meta-box-manager',
35
- __('SiteOrigin Meta Box Manager', 'so-widgets-bundle'),
36
- array(
37
- 'has_preview' => false,
38
- 'help' => false
39
- ),
40
- array(),
41
- array()
42
- );
43
- }
44
-
45
- function initialize() {
46
- // Initialize number for field name attributes.
47
- $this->number = 1;
48
- $this->post_types = array();
49
- $this->widget_form_fields = array();
50
-
51
- add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
52
- add_action( 'save_post', array( $this, 'save_widget_post_meta' ), 10, 3 );
53
- }
54
-
55
- /**
56
- * This handles the 'add_meta_boxes' action. It merges widget fields into the form_options array before adding the
57
- * meta box
58
- *
59
- * @param $post_type
60
- */
61
- public function add_meta_boxes( $post_type ) {
62
-
63
- $this->form_options = array();
64
- foreach ( $this->widget_form_fields as $widget_id => $post_type_form_fields ) {
65
- foreach( $post_type_form_fields as $form_fields ) {
66
- if ( in_array( 'all', $form_fields['post_types'] ) || in_array( $post_type, $form_fields['post_types'] ) ) {
67
- foreach ( $form_fields['fields'] as $field_name => $field ) {
68
- $this->form_options[$widget_id . '_' . $field_name] = $field;
69
- }
70
- }
71
- }
72
- }
73
-
74
- if ( ! empty( $this->form_options ) ) {
75
- add_meta_box(
76
- 'siteorigin-widgets-meta-box',
77
- __( 'Widgets Bundle Post Meta Data', 'so-widgets-bundle' ),
78
- array( $this, 'render_widgets_meta_box' ),
79
- $post_type,
80
- 'advanced',
81
- 'default',
82
- array(
83
- '__back_compat_meta_box' => true,
84
- '__block_editor_compatible_meta_box' => false,
85
- )
86
- );
87
-
88
- }
89
- }
90
-
91
- /**
92
- * This is the callback used by add_meta_box to render the widgets meta box form and enqueue any necessary scripts.
93
- *
94
- * @param $post
95
- */
96
- public function render_widgets_meta_box( $post ) {
97
- wp_enqueue_script(
98
- 'sow-meta-box-manager-js',
99
- plugin_dir_url(SOW_BUNDLE_BASE_FILE).'base/js/meta-box-manager' . SOW_BUNDLE_JS_SUFFIX . '.js',
100
- array( 'jquery' ),
101
- SOW_BUNDLE_VERSION,
102
- true
103
- );
104
- $widget_post_meta = get_post_meta( $post->ID, self::POST_META_KEY, true );
105
- if ( empty( $widget_post_meta ) ) {
106
- $widget_post_meta = array();
107
- }
108
- $this->form( $widget_post_meta );
109
- ?><input type="hidden" id="widget_post_meta" name="widget_post_meta"> <?php
110
- wp_nonce_field( 'widget_post_meta_save', '_widget_post_meta_nonce' );
111
- }
112
-
113
- /**
114
- * This method should be called by any widgets that want to be able to store post meta data. It may be called
115
- * multiple times by a widget and the additional fields for a widget will be appended and rendered.
116
- *
117
- * @param string $widget_id Base id of the widget adding the fields.
118
- * @param array $fields The fields to add.
119
- * @param string|array $post_types A post type string, 'all' or an array of post types
120
- */
121
- public function append_to_form( $widget_id, $fields, $post_types = 'all' ) {
122
- if( empty( $fields ) || empty( $post_types ) ) return;
123
-
124
- if( $post_types == 'all' ) {
125
- $post_types = array( 'all' );
126
- }
127
-
128
- foreach( $post_types as $post_type ) {
129
- if( !in_array( $post_type, $this->post_types ) ) {
130
- $this->post_types[] = $post_type;
131
- }
132
- }
133
-
134
- if( ! isset( $this->widget_form_fields[$widget_id] ) ) {
135
- $this->widget_form_fields[$widget_id] = array();
136
- }
137
-
138
- $this->widget_form_fields[$widget_id][] = array(
139
- 'post_types' => $post_types,
140
- 'fields' => $fields
141
- );
142
- }
143
-
144
- /**
145
- * This handles the 'save_post' action. It checks for a nonce, checks user permissions, and filters the input data
146
- * and decodes it from the JSON format before storing it in the post's meta data.
147
- *
148
- * @param $post_id
149
- */
150
- public function save_widget_post_meta( $post_id ) {
151
- if ( empty( $_POST['_widget_post_meta_nonce'] ) || !wp_verify_nonce( $_POST['_widget_post_meta_nonce'], 'widget_post_meta_save' ) ) return;
152
- if ( !current_user_can( 'edit_post', $post_id ) ) return;
153
-
154
- $widget_post_meta = isset( $_POST['widget_post_meta'] ) ? stripslashes_deep( $_POST['widget_post_meta'] ) : '';
155
- $widget_post_meta = json_decode( $widget_post_meta, true);
156
-
157
- update_post_meta( $post_id, self::POST_META_KEY, $widget_post_meta );
158
-
159
- }
160
-
161
- /**
162
- * This function is used to retrieve a widget's post meta data.
163
- *
164
- * @param $post_id string The id of the post for which the meta data is stored.
165
- * @param $widget_id string The id of the widget for which the meta data is stored.
166
- * @param $meta_key string The key of the meta data value which is to be retrieved.
167
- *
168
- * @return mixed An empty string if the meta data is not found, else the meta data in whatever format it was stored.
169
- */
170
- public function get_widget_post_meta( $post_id, $widget_id, $meta_key ) {
171
- $widget_post_meta = get_post_meta( $post_id, self::POST_META_KEY, true );
172
- if( empty( $widget_post_meta ) ) return '';
173
- $widget_post_meta_field = $widget_id . '_' . $meta_key;
174
- if( ! isset( $widget_post_meta[$widget_post_meta_field] ) ) return '';
175
- return $widget_post_meta[$widget_post_meta_field];
176
- }
177
- }
1
+ <?php
2
+
3
+ class SiteOrigin_Widget_Meta_Box_Manager extends SiteOrigin_Widget {
4
+
5
+ const POST_META_KEY = 'siteorigin-widgets-post-meta';
6
+
7
+ /**
8
+ * @var array Fields which have been added for each widget.
9
+ */
10
+ private $widget_form_fields;
11
+
12
+ /**
13
+ * @var array Post types for which fields have been added.
14
+ */
15
+ private $post_types;
16
+
17
+ /**
18
+ * Get the single instance.
19
+ *
20
+ * @return SiteOrigin_Widget_Meta_Box_Manager
21
+ */
22
+ static function single(){
23
+ static $single = false;
24
+ if( empty($single) ) $single = new SiteOrigin_Widget_Meta_Box_Manager();
25
+
26
+ return $single;
27
+ }
28
+
29
+ /**
30
+ * Private
31
+ */
32
+ public function __construct() {
33
+ parent::__construct(
34
+ 'sow-meta-box-manager',
35
+ __('SiteOrigin Meta Box Manager', 'so-widgets-bundle'),
36
+ array(
37
+ 'has_preview' => false,
38
+ 'help' => false
39
+ ),
40
+ array(),
41
+ array()
42
+ );
43
+ }
44
+
45
+ function initialize() {
46
+ // Initialize number for field name attributes.
47
+ $this->number = 1;
48
+ $this->post_types = array();
49
+ $this->widget_form_fields = array();
50
+
51
+ add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
52
+ add_action( 'save_post', array( $this, 'save_widget_post_meta' ), 10, 3 );
53
+ }
54
+
55
+ /**
56
+ * This handles the 'add_meta_boxes' action. It merges widget fields into the form_options array before adding the
57
+ * meta box
58
+ *
59
+ * @param $post_type
60
+ */
61
+ public function add_meta_boxes( $post_type ) {
62
+
63
+ $this->form_options = array();
64
+ foreach ( $this->widget_form_fields as $widget_id => $post_type_form_fields ) {
65
+ foreach( $post_type_form_fields as $form_fields ) {
66
+ if ( in_array( 'all', $form_fields['post_types'] ) || in_array( $post_type, $form_fields['post_types'] ) ) {
67
+ foreach ( $form_fields['fields'] as $field_name => $field ) {
68
+ $this->form_options[$widget_id . '_' . $field_name] = $field;
69
+ }
70
+ }
71
+ }
72
+ }
73
+
74
+ if ( ! empty( $this->form_options ) ) {
75
+ add_meta_box(
76
+ 'siteorigin-widgets-meta-box',
77
+ __( 'Widgets Bundle Post Meta Data', 'so-widgets-bundle' ),
78
+ array( $this, 'render_widgets_meta_box' ),
79
+ $post_type,
80
+ 'advanced',
81
+ 'default',
82
+ array(
83
+ '__back_compat_meta_box' => true,
84
+ '__block_editor_compatible_meta_box' => false,
85
+ )
86
+ );
87
+
88
+ }
89
+ }
90
+
91
+ /**
92
+ * This is the callback used by add_meta_box to render the widgets meta box form and enqueue any necessary scripts.
93
+ *
94
+ * @param $post
95
+ */
96
+ public function render_widgets_meta_box( $post ) {
97
+ wp_enqueue_script(
98
+ 'sow-meta-box-manager-js',
99
+ plugin_dir_url(SOW_BUNDLE_BASE_FILE).'base/js/meta-box-manager' . SOW_BUNDLE_JS_SUFFIX . '.js',
100
+ array( 'jquery' ),
101
+ SOW_BUNDLE_VERSION,
102
+ true
103
+ );
104
+ $widget_post_meta = get_post_meta( $post->ID, self::POST_META_KEY, true );
105
+ if ( empty( $widget_post_meta ) ) {
106
+ $widget_post_meta = array();
107
+ }
108
+ $this->form( $widget_post_meta );
109
+ ?><input type="hidden" id="widget_post_meta" name="widget_post_meta"> <?php
110
+ wp_nonce_field( 'widget_post_meta_save', '_widget_post_meta_nonce' );
111
+ }
112
+
113
+ /**
114
+ * This method should be called by any widgets that want to be able to store post meta data. It may be called
115
+ * multiple times by a widget and the additional fields for a widget will be appended and rendered.
116
+ *
117
+ * @param string $widget_id Base id of the widget adding the fields.
118
+ * @param array $fields The fields to add.
119
+ * @param string|array $post_types A post type string, 'all' or an array of post types
120
+ */
121
+ public function append_to_form( $widget_id, $fields, $post_types = 'all' ) {
122
+ if( empty( $fields ) || empty( $post_types ) ) return;
123
+
124
+ if( $post_types == 'all' ) {
125
+ $post_types = array( 'all' );
126
+ }
127
+
128
+ foreach( $post_types as $post_type ) {
129
+ if( !in_array( $post_type, $this->post_types ) ) {
130
+ $this->post_types[] = $post_type;
131
+ }
132
+ }
133
+
134
+ if( ! isset( $this->widget_form_fields[$widget_id] ) ) {
135
+ $this->widget_form_fields[$widget_id] = array();
136
+ }
137
+
138
+ $this->widget_form_fields[$widget_id][] = array(
139
+ 'post_types' => $post_types,
140
+ 'fields' => $fields
141
+ );
142
+ }
143
+
144
+ /**
145
+ * This handles the 'save_post' action. It checks for a nonce, checks user permissions, and filters the input data
146
+ * and decodes it from the JSON format before storing it in the post's meta data.
147
+ *
148
+ * @param $post_id
149
+ */
150
+ public function save_widget_post_meta( $post_id ) {
151
+ if ( empty( $_POST['_widget_post_meta_nonce'] ) || !wp_verify_nonce( $_POST['_widget_post_meta_nonce'], 'widget_post_meta_save' ) ) return;
152
+ if ( !current_user_can( 'edit_post', $post_id ) ) return;
153
+
154
+ $widget_post_meta = isset( $_POST['widget_post_meta'] ) ? stripslashes_deep( $_POST['widget_post_meta'] ) : '';
155
+ $widget_post_meta = json_decode( $widget_post_meta, true);
156
+
157
+ update_post_meta( $post_id, self::POST_META_KEY, $widget_post_meta );
158
+
159
+ }
160
+
161
+ /**
162
+ * This function is used to retrieve a widget's post meta data.
163
+ *
164
+ * @param $post_id string The id of the post for which the meta data is stored.
165
+ * @param $widget_id string The id of the widget for which the meta data is stored.
166
+ * @param $meta_key string The key of the meta data value which is to be retrieved.
167
+ *
168
+ * @return mixed An empty string if the meta data is not found, else the meta data in whatever format it was stored.
169
+ */
170
+ public function get_widget_post_meta( $post_id, $widget_id, $meta_key ) {
171
+ $widget_post_meta = get_post_meta( $post_id, self::POST_META_KEY, true );
172
+ if( empty( $widget_post_meta ) ) return '';
173
+ $widget_post_meta_field = $widget_id . '_' . $meta_key;
174
+ if( ! isset( $widget_post_meta[$widget_post_meta_field] ) ) return '';
175
+ return $widget_post_meta[$widget_post_meta_field];
176
+ }
177
+ }
base/inc/post-selector.php CHANGED
@@ -1,134 +1,134 @@
1
- <?php
2
-
3
- /**
4
- * Filter a query created from the post selector field into an array that will work properly with get_posts
5
- *
6
- * @param $query
7
- *
8
- * @return mixed
9
- */
10
- function siteorigin_widget_post_selector_process_query( $query ){
11
- $query = wp_parse_args($query,
12
- array(
13
- 'post_status' => 'publish',
14
- 'posts_per_page' => 10,
15
- )
16
- );
17
-
18
- if( !empty( $query['post_type'] ) ) {
19
- if($query['post_type'] == '_all') $query['post_type'] = siteorigin_widget_post_selector_all_post_types();
20
- $query['post_type'] = strpos( $query['post_type'], ',' ) !== false ? explode( ',', $query['post_type'] ) : $query['post_type'];
21
- }
22
- if( !empty( $query['post_type'] ) && $query['post_type'] == 'attachment' && $query['post_status'] == 'publish' ) {
23
- $query['post_status'] = 'inherit';
24
- }
25
-
26
-
27
- if(!empty($query['post__in'])) {
28
- $query['post__in'] = explode(',', $query['post__in']);
29
- $query['post__in'] = array_map('intval', $query['post__in']);
30
- }
31
-
32
- if(!empty($query['tax_query'])) {
33
- $tax_queries = explode(',', $query['tax_query']);
34
-
35
- $query['tax_query'] = array();
36
- $query['tax_query']['relation'] = 'OR';
37
- foreach($tax_queries as $tq) {
38
- list($tax, $term) = explode(':', $tq);
39
-
40
- if( empty($tax) || empty($term) ) continue;
41
- $query['tax_query'][] = array(
42
- 'taxonomy' => $tax,
43
- 'field' => 'slug',
44
- 'terms' => $term
45
- );
46
- }
47
- }
48
-
49
- if ( isset( $query['date_type'] ) && $query['date_type'] == 'relative' ) {
50
-
51
- $date_query_rel = json_decode(
52
- stripslashes( $query['date_query_relative'] ),
53
- true
54
- );
55
- $value_after = new DateTime(
56
- $date_query_rel['from']['value'] . ' ' . $date_query_rel['from']['unit'] . ' ago'
57
- );
58
- $value['after'] = $value_after->format( 'Y-m-d' );
59
- $value_before = new DateTime(
60
- $date_query_rel['to']['value'] . ' ' . $date_query_rel['to']['unit'] . ' ago'
61
- );
62
- $value['before'] = $value_before->format( 'Y-m-d' );
63
- $query['date_query'] = $value;
64
- unset( $query['date_type'] );
65
- unset( $query['date_query_relative'] );
66
- } else if ( ! empty( $query['date_query'] ) ) {
67
- $query['date_query'] = json_decode( stripslashes( $query['date_query'] ), true );
68
- }
69
-
70
- if ( ! empty( $query['date_query'] ) ) {
71
- $query['date_query']['inclusive'] = true;
72
- }
73
-
74
- if ( ! empty( $query['sticky'] ) ) {
75
- switch($query['sticky']){
76
- case 'ignore' :
77
- $query['ignore_sticky_posts'] = 1;
78
- break;
79
- case 'only' :
80
- $post_in = empty( $query['post__in'] ) ? array() : $query['post__in'];
81
- $query['post__in'] = array_merge( $post_in, get_option( 'sticky_posts' ) );
82
- break;
83
- case 'exclude' :
84
- $query['post__not_in'] = get_option( 'sticky_posts' );
85
- break;
86
- }
87
- unset( $query['sticky'] );
88
- }
89
-
90
- // Exclude the current post (if applicable) to avoid any issues associated with showing the same post again
91
- if( is_singular() && get_the_id() != false ){
92
- $query['post__not_in'][] = get_the_id();
93
- }
94
-
95
- if ( ! empty( $query['additional'] ) ) {
96
- $query = wp_parse_args( $query['additional'], $query );
97
- unset( $query['additional'] );
98
-
99
- // If post_not_in is set, we need to convert it to an array to avoid issues with the query.
100
- if( !empty( $query['post__not_in'] ) && !is_array( $query['post__not_in'] ) ){
101
- $query['post__not_in'] = explode( ',', $query['post__not_in'] );
102
- $query['post__not_in'] = array_map( 'intval', $query['post__not_in'] );
103
- }
104
- }
105
-
106
- return apply_filters( 'siteorigin_widgets_posts_selector_query', $query );
107
- }
108
-
109
-
110
- /**
111
- * Just return a comma separated list of all available post types.
112
- *
113
- * @return string
114
- */
115
- function siteorigin_widget_post_selector_all_post_types(){
116
- $post_types = array();
117
- foreach( get_post_types( array( 'public' => true ), 'objects' ) as $id => $type ) {
118
- $post_types[] = $id;
119
- }
120
-
121
- return implode(',', $post_types);
122
- }
123
-
124
- /**
125
- * Tells us how many posts this query has
126
- *
127
- * @param $query
128
- * @return int
129
- */
130
- function siteorigin_widget_post_selector_count_posts( $query ) {
131
- $query = siteorigin_widget_post_selector_process_query( $query );
132
- $posts = new WP_Query($query);
133
- return $posts->found_posts;
134
- }
1
+ <?php
2
+
3
+ /**
4
+ * Filter a query created from the post selector field into an array that will work properly with get_posts
5
+ *
6
+ * @param $query
7
+ *
8
+ * @return mixed
9
+ */
10
+ function siteorigin_widget_post_selector_process_query( $query ){
11
+ $query = wp_parse_args($query,
12
+ array(
13
+ 'post_status' => 'publish',
14
+ 'posts_per_page' => 10,
15
+ )
16
+ );
17
+
18
+ if( !empty( $query['post_type'] ) ) {
19
+ if($query['post_type'] == '_all') $query['post_type'] = siteorigin_widget_post_selector_all_post_types();
20
+ $query['post_type'] = strpos( $query['post_type'], ',' ) !== false ? explode( ',', $query['post_type'] ) : $query['post_type'];
21
+ }
22
+ if( !empty( $query['post_type'] ) && $query['post_type'] == 'attachment' && $query['post_status'] == 'publish' ) {
23
+ $query['post_status'] = 'inherit';
24
+ }
25
+
26
+
27
+ if(!empty($query['post__in'])) {
28
+ $query['post__in'] = explode(',', $query['post__in']);
29
+ $query['post__in'] = array_map('intval', $query['post__in']);
30
+ }
31
+
32
+ if(!empty($query['tax_query'])) {
33
+ $tax_queries = explode(',', $query['tax_query']);
34
+
35
+ $query['tax_query'] = array();
36
+ $query['tax_query']['relation'] = 'OR';
37
+ foreach($tax_queries as $tq) {
38
+ list($tax, $term) = explode(':', $tq);
39
+
40
+ if( empty($tax) || empty($term) ) continue;
41
+ $query['tax_query'][] = array(
42
+ 'taxonomy' => $tax,
43
+ 'field' => 'slug',
44
+ 'terms' => $term
45
+ );
46
+ }
47
+ }
48
+
49
+ if ( isset( $query['date_type'] ) && $query['date_type'] == 'relative' ) {
50
+
51
+ $date_query_rel = json_decode(
52
+ stripslashes( $query['date_query_relative'] ),
53
+ true
54
+ );
55
+ $value_after = new DateTime(
56
+ $date_query_rel['from']['value'] . ' ' . $date_query_rel['from']['unit'] . ' ago'
57
+ );
58
+ $value['after'] = $value_after->format( 'Y-m-d' );
59
+ $value_before = new DateTime(
60
+ $date_query_rel['to']['value'] . ' ' . $date_query_rel['to']['unit'] . ' ago'
61
+ );
62
+ $value['before'] = $value_before->format( 'Y-m-d' );
63
+ $query['date_query'] = $value;
64
+ unset( $query['date_type'] );
65
+ unset( $query['date_query_relative'] );
66
+ } else if ( ! empty( $query['date_query'] ) ) {
67
+ $query['date_query'] = json_decode( stripslashes( $query['date_query'] ), true );
68
+ }
69
+
70
+ if ( ! empty( $query['date_query'] ) ) {
71
+ $query['date_query']['inclusive'] = true;
72
+ }
73
+
74
+ if ( ! empty( $query['sticky'] ) ) {
75
+ switch($query['sticky']){
76
+ case 'ignore' :
77
+ $query['ignore_sticky_posts'] = 1;
78
+ break;
79
+ case 'only' :
80
+ $post_in = empty( $query['post__in'] ) ? array() : $query['post__in'];
81
+ $query['post__in'] = array_merge( $post_in, get_option( 'sticky_posts' ) );
82
+ break;
83
+ case 'exclude' :
84
+ $query['post__not_in'] = get_option( 'sticky_posts' );
85
+ break;
86
+ }
87
+ unset( $query['sticky'] );
88
+ }
89
+
90
+ // Exclude the current post (if applicable) to avoid any issues associated with showing the same post again
91
+ if( is_singular() && get_the_id() != false ){
92
+ $query['post__not_in'][] = get_the_id();
93
+ }
94
+
95
+ if ( ! empty( $query['additional'] ) ) {
96
+ $query = wp_parse_args( $query['additional'], $query );
97
+ unset( $query['additional'] );
98
+
99
+ // If post_not_in is set, we need to convert it to an array to avoid issues with the query.
100
+ if( !empty( $query['post__not_in'] ) && !is_array( $query['post__not_in'] ) ){
101
+ $query['post__not_in'] = explode( ',', $query['post__not_in'] );
102
+ $query['post__not_in'] = array_map( 'intval', $query['post__not_in'] );
103
+ }
104
+ }
105
+
106
+ return apply_filters( 'siteorigin_widgets_posts_selector_query', $query );
107
+ }
108
+
109
+
110
+ /**
111
+ * Just return a comma separated list of all available post types.
112
+ *
113
+ * @return string
114
+ */
115
+ function siteorigin_widget_post_selector_all_post_types(){
116
+ $post_types = array();
117
+ foreach( get_post_types( array( 'public' => true ), 'objects' ) as $id => $type ) {
118
+ $post_types[] = $id;
119
+ }
120
+
121
+ return implode(',', $post_types);
122
+ }
123
+
124
+ /**
125
+ * Tells us how many posts this query has
126
+ *
127
+ * @param $query
128
+ * @return int
129
+ */
130
+ function siteorigin_widget_post_selector_count_posts( $query ) {
131
+ $query = siteorigin_widget_post_selector_process_query( $query );
132
+ $posts = new WP_Query($query);
133
+ return $posts->found_posts;
134
+ }
base/inc/routes/siteorigin-widgets-resource.class.php CHANGED
@@ -1,172 +1,172 @@
1
- <?php
2
- /**
3
- * Resource for SiteOrigin widgets.
4
- */
5
-
6
- class SiteOrigin_Widgets_Resource extends WP_REST_Controller {
7
-
8
- public function register_routes() {
9
- $version = '1';
10
- $namespace = 'sowb/v' . $version;
11
- $resource = 'widgets';
12
-
13
- $subresource = 'forms';
14
- register_rest_route( $namespace, '/' . $resource . '/' . $subresource, array(
15
- 'methods' => WP_REST_Server::CREATABLE,
16
- 'callback' => array( $this, 'get_widget_form'),
17
- 'args' => array(
18
- 'widgetClass' => array(
19
- 'validate_callback' => array( $this, 'validate_widget_class'),
20
- ),
21
- 'widgetData' => array(
22
- 'validate_callback' => array( $this, 'validate_widget_data'),
23
- ),
24
- ),
25
- 'permission_callback' => array( $this, 'permissions_check' ),
26
- ) );
27
-
28
- $subresource = 'previews';
29
- register_rest_route( $namespace, '/' . $resource . '/' . $subresource, array(
30
- 'methods' => WP_REST_Server::CREATABLE,
31
- 'callback' => array( $this, 'get_widget_preview'),
32
- 'args' => array(
33
- 'widgetClass' => array(
34
- 'validate_callback' => array( $this, 'validate_widget_class'),
35
- ),
36
- 'widgetData' => array(
37
- 'validate_callback' => array( $this, 'validate_widget_data'),
38
- ),
39
- ),
40
- 'permission_callback' => array( $this, 'permissions_check' ),
41
- ) );
42
- }
43
-
44
- /**
45
- *
46
- * @param WP_REST_Request $request Request.
47
- * @return true|WP_Error True if the request has read access, WP_Error object otherwise.
48
- */
49
- public function permissions_check( $request ) {
50
-
51
- if ( ! current_user_can( 'edit_posts' ) ) {
52
- $status_code = rest_authorization_required_code();
53
- return new WP_Error(
54
- $status_code,
55
- __( 'Insufficient permissions.', 'so-widgets-bundle' ),
56
- array(
57
- 'status' => $status_code,
58
- )
59
- );
60
- }
61
-
62
- return true;
63
- }
64
-
65
- /**
66
- * Validate passed in widgetClass arg only contains alphanumeric and underscores.
67
- *
68
- * @param $param
69
- * @param $request
70
- * @param $key
71
- *
72
- * @return bool
73
- */
74
- function validate_widget_class( $param, $request, $key ) {
75
- return preg_match( '/\w+/', $param ) == 1;
76
- }
77
-
78
- /**
79
- * Get the collection of widgets.
80
- *
81
- * @param WP_REST_Request $request
82
- *
83
- * @return WP_Error|WP_REST_Response
84
- */
85
- public function get_widget_form( $request ) {
86
- $widget_class = $request['widgetClass'];
87
- $widget_data = empty( $request['widgetData'] ) ? array() : $request['widgetData'];
88
-
89
- /* @var $widget SiteOrigin_Widget */
90
- $widget = SiteOrigin_Widgets_Widget_Manager::get_widget_instance( $widget_class );
91
-
92
- if ( ! empty( $widget ) && is_object( $widget ) && is_subclass_of( $widget, 'SiteOrigin_Widget' ) ) {
93
- $widget_data = $widget->update( $widget_data, $widget_data );
94
- ob_start();
95
- $widget->form( $widget_data );
96
- $widget_form = ob_get_clean();
97
- } else {
98
- $widget_form = new WP_Error(
99
- 400,
100
- 'Invalid or missing widget class: ' . $widget_class,
101
- array(
102
- 'status' => 400,
103
- )
104
- );
105
- }
106
-
107
- return rest_ensure_response( $widget_form );
108
- }
109
-
110
- /**
111
- * For now widget data is validated in the below `get_widget_preview` function.
112
- * Leaving this here for possible later implementation.
113
- *
114
- * @param $param
115
- * @param $request
116
- * @param $key
117
- *
118
- * @return bool
119
- */
120
- function validate_widget_data( $param, $request, $key ) {
121
- return true;
122
- }
123
-
124
- /**
125
- * Get the collection of widgets.
126
- *
127
- * @param WP_REST_Request $request
128
- *
129
- * @return WP_Error|WP_REST_Response
130
- */
131
- public function get_widget_preview( $request ) {
132
- $widget_class = $request['widgetClass'];
133
- $widget_data = $request['widgetData'];
134
-
135
- $widget = SiteOrigin_Widgets_Widget_Manager::get_widget_instance( $widget_class );
136
- // This ensures styles are added inline.
137
- add_filter( 'siteorigin_widgets_is_preview', '__return_true' );
138
-
139
- $valid_widget_class = ! empty( $widget ) &&
140
- is_object( $widget ) &&
141
- is_subclass_of( $widget, 'SiteOrigin_Widget' );
142
-
143
- if ( $valid_widget_class && ! empty( $widget_data ) ) {
144
- ob_start();
145
- /* @var $widget SiteOrigin_Widget */
146
- $instance = $widget->update( $widget_data, $widget_data );
147
- $widget->widget( array(), $instance );
148
- $rendered_widget = ob_get_clean();
149
- } else {
150
- if ( empty( $valid_widget_class ) ) {
151
- $rendered_widget = new WP_Error(
152
- 400,
153
- 'Invalid or missing widget class: ' . $widget_class,
154
- array(
155
- 'status' => 400,
156
- )
157
- );
158
- } else if ( empty( $widget_data ) ) {
159
- $rendered_widget = new WP_Error(
160
- 400,
161
- 'Unable to render preview. Invalid or missing widget data.',
162
- array(
163
- 'status' => 400,
164
- )
165
- );
166
-
167
- }
168
- }
169
-
170
- return rest_ensure_response( $rendered_widget );
171
- }
172
- }
1
+ <?php
2
+ /**
3
+ * Resource for SiteOrigin widgets.
4
+ */
5
+
6
+ class SiteOrigin_Widgets_Resource extends WP_REST_Controller {
7
+
8
+ public function register_routes() {
9
+ $version = '1';
10
+ $namespace = 'sowb/v' . $version;
11
+ $resource = 'widgets';
12
+
13
+ $subresource = 'forms';
14
+ register_rest_route( $namespace, '/' . $resource . '/' . $subresource, array(
15
+ 'methods' => WP_REST_Server::CREATABLE,
16
+ 'callback' => array( $this, 'get_widget_form'),
17
+ 'args' => array(
18
+ 'widgetClass' => array(
19
+ 'validate_callback' => array( $this, 'validate_widget_class'),
20
+ ),
21
+ 'widgetData' => array(
22
+ 'validate_callback' => array( $this, 'validate_widget_data'),
23
+ ),
24
+ ),
25
+ 'permission_callback' => array( $this, 'permissions_check' ),
26
+ ) );
27
+
28
+ $subresource = 'previews';
29
+ register_rest_route( $namespace, '/' . $resource . '/' . $subresource, array(
30
+ 'methods' => WP_REST_Server::CREATABLE,
31
+ 'callback' => array( $this, 'get_widget_preview'),
32
+ 'args' => array(
33
+ 'widgetClass' => array(
34
+ 'validate_callback' => array( $this, 'validate_widget_class'),
35
+ ),
36
+ 'widgetData' => array(
37
+ 'validate_callback' => array( $this, 'validate_widget_data'),
38
+ ),
39
+ ),
40
+ 'permission_callback' => array( $this, 'permissions_check' ),
41
+ ) );
42
+ }
43
+
44
+ /**
45
+ *
46
+ * @param WP_REST_Request $request Request.
47
+ * @return true|WP_Error True if the request has read access, WP_Error object otherwise.
48
+ */
49
+ public function permissions_check( $request ) {
50
+
51
+ if ( ! current_user_can( 'edit_posts' ) ) {
52
+ $status_code = rest_authorization_required_code();
53
+ return new WP_Error(
54
+ $status_code,
55
+ __( 'Insufficient permissions.', 'so-widgets-bundle' ),
56
+ array(
57
+ 'status' => $status_code,
58
+ )
59
+ );
60
+ }
61
+
62
+ return true;
63
+ }
64
+
65
+ /**
66
+ * Validate passed in widgetClass arg only contains alphanumeric and underscores.
67
+ *
68
+ * @param $param
69
+ * @param $request
70
+ * @param $key
71
+ *
72
+ * @return bool
73
+ */
74
+ function validate_widget_class( $param, $request, $key ) {
75
+ return preg_match( '/\w+/', $param ) == 1;
76
+ }
77
+
78
+ /**
79
+ * Get the collection of widgets.
80
+ *
81
+ * @param WP_REST_Request $request
82
+ *
83
+ * @return WP_Error|WP_REST_Response
84
+ */
85
+ public function get_widget_form( $request ) {
86
+ $widget_class = $request['widgetClass'];
87
+ $widget_data = empty( $request['widgetData'] ) ? array() : $request['widgetData'];
88
+
89
+ /* @var $widget SiteOrigin_Widget */
90
+ $widget = SiteOrigin_Widgets_Widget_Manager::get_widget_instance( $widget_class );
91
+
92
+ if ( ! empty( $widget ) && is_object( $widget ) && is_subclass_of( $widget, 'SiteOrigin_Widget' ) ) {
93
+ $widget_data = $widget->update( $widget_data, $widget_data );
94
+ ob_start();
95
+ $widget->form( $widget_data );
96
+ $widget_form = ob_get_clean();
97
+ } else {
98
+ $widget_form = new WP_Error(
99
+ 400,
100
+ 'Invalid or missing widget class: ' . $widget_class,
101
+ array(
102
+ 'status' => 400,
103
+ )
104
+ );
105
+ }
106
+
107
+ return rest_ensure_response( $widget_form );
108
+ }
109
+
110
+ /**
111
+ * For now widget data is validated in the below `get_widget_preview` function.
112
+ * Leaving this here for possible later implementation.
113
+ *
114
+ * @param $param
115
+ * @param $request
116
+ * @param $key
117
+ *
118
+ * @return bool
119
+ */
120
+ function validate_widget_data( $param, $request, $key ) {
121
+ return true;
122
+ }
123
+
124
+ /**
125
+ * Get the collection of widgets.
126
+ *
127
+ * @param WP_REST_Request $request
128
+ *
129
+ * @return WP_Error|WP_REST_Response
130
+ */
131
+ public function get_widget_preview( $request ) {
132
+ $widget_class = $request['widgetClass'];
133
+ $widget_data = $request['widgetData'];
134
+
135
+ $widget = SiteOrigin_Widgets_Widget_Manager::get_widget_instance( $widget_class );
136
+ // This ensures styles are added inline.
137
+ add_filter( 'siteorigin_widgets_is_preview', '__return_true' );
138
+
139
+ $valid_widget_class = ! empty( $widget ) &&
140
+ is_object( $widget ) &&
141
+ is_subclass_of( $widget, 'SiteOrigin_Widget' );
142
+
143
+ if ( $valid_widget_class && ! empty( $widget_data ) ) {
144
+ ob_start();
145
+ /* @var $widget SiteOrigin_Widget */
146
+ $instance = $widget->update( $widget_data, $widget_data );
147
+ $widget->widget( array(), $instance );
148
+ $rendered_widget = ob_get_clean();
149
+ } else {
150
+ if ( empty( $valid_widget_class ) ) {
151
+ $rendered_widget = new WP_Error(
152
+ 400,
153
+ 'Invalid or missing widget class: ' . $widget_class,
154
+ array(
155
+ 'status' => 400,
156
+ )
157
+ );
158
+ } else if ( empty( $widget_data ) ) {
159
+ $rendered_widget = new WP_Error(
160
+ 400,
161
+ 'Unable to render preview. Invalid or missing widget data.',
162
+ array(
163
+ 'status' => 400,
164
+ )
165
+ );
166
+
167
+ }
168
+ }
169
+
170
+ return rest_ensure_response( $rendered_widget );
171
+ }
172
+ }
base/inc/routes/sowb-rest-routes.php CHANGED
@@ -1,50 +1,50 @@
1
- <?php
2
-
3
- /**
4
- * Handles registering Widgets Bundle custom REST endpoints.
5
- *
6
- * Class SiteOrigin_Widgets_Rest_Routes
7
- */
8
-
9
- class SiteOrigin_Widgets_Rest_Routes {
10
-
11
- function __construct() {
12
-
13
- global $wp_version;
14
- if ( version_compare( $wp_version, '4.7', '>=' ) && class_exists( 'WP_REST_Controller' ) ) {
15
- include plugin_dir_path(__FILE__).'siteorigin-widgets-resource.class.php';
16
- add_action( 'rest_api_init', array( $this, 'register_rest_routes') );
17
- }
18
- }
19
-
20
- /**
21
- * Singleton
22
- *
23
- * @return SiteOrigin_Widgets_Rest_Routes
24
- */
25
- static function single() {
26
- static $single;
27
-
28
- if( empty($single) ) {
29
- $single = new self();
30
- }
31
-
32
- return $single;
33
- }
34
-
35
- /**
36
- * Register all our REST resources.
37
- */
38
- function register_rest_routes() {
39
- $resources = array(
40
- new SiteOrigin_Widgets_Resource(),
41
- );
42
-
43
- foreach ( $resources as $resource ) {
44
- /* @var WP_REST_Controller $resource */
45
- $resource->register_routes();
46
- }
47
- }
48
-
49
- }
50
- SiteOrigin_Widgets_Rest_Routes::single();
1
+ <?php
2
+
3
+ /**
4
+ * Handles registering Widgets Bundle custom REST endpoints.
5
+ *
6
+ * Class SiteOrigin_Widgets_Rest_Routes
7
+ */
8
+
9
+ class SiteOrigin_Widgets_Rest_Routes {
10
+
11
+ function __construct() {
12
+
13
+ global $wp_version;
14
+ if ( version_compare( $wp_version, '4.7', '>=' ) && class_exists( 'WP_REST_Controller' ) ) {
15
+ include plugin_dir_path(__FILE__).'siteorigin-widgets-resource.class.php';
16
+ add_action( 'rest_api_init', array( $this, 'register_rest_routes') );
17
+ }
18
+ }
19
+
20
+ /**
21
+ * Singleton
22
+ *
23
+ * @return SiteOrigin_Widgets_Rest_Routes
24
+ */
25
+ static function single() {
26
+ static $single;
27
+
28
+ if( empty($single) ) {
29
+ $single = new self();
30
+ }
31
+
32
+ return $single;
33
+ }
34
+
35
+ /**
36
+ * Register all our REST resources.
37
+ */
38
+ function register_rest_routes() {
39
+ $resources = array(
40
+ new SiteOrigin_Widgets_Resource(),
41
+ );
42
+
43
+ foreach ( $resources as $resource ) {
44
+ /* @var WP_REST_Controller $resource */
45
+ $resource->register_routes();
46
+ }
47
+ }
48
+
49
+ }
50
+ SiteOrigin_Widgets_Rest_Routes::single();
base/inc/video.php CHANGED
@@ -1,99 +1,99 @@
1
- <?php
2
-
3
- /**
4
- * This class handles video related functionality.
5
- *
6
- * Class SiteOrigin_Video
7
- */
8
-
9
- class SiteOrigin_Video {
10
-
11
- /**
12
- * Check whether it's possible to oEmbed by testing if a provider URL can be obtained.
13
- *
14
- * @param string $url The URL of the video to be embedded.
15
- *
16
- * @return bool Whether it's possible to embed this video.
17
- */
18
- function can_oembed( $url ) {
19
- $wp_oembed = new WP_oEmbed();
20
- $provider = $wp_oembed->get_provider( $url, array( 'discover' => false ) );
21
-
22
- return ! empty( $provider );
23
- }
24
-
25
- /**
26
- * Gets a video source embed
27
- *
28
- * @param string $src The URL of the video.
29
- * @param bool $autoplay Whether to start playing the video automatically once loaded. ( YouTube only )
30
- * @param bool $related_videos Whether to show related videos after the video has finished playing. ( YouTube only )
31
- *
32
- * @return false|mixed|null|string|string[]
33
- */
34
- function get_video_oembed( $src, $autoplay = false, $related_videos = true ) {
35
- if ( empty( $src ) ) {
36
- return '';
37
- }
38
-
39
- global $content_width;
40
-
41
- $video_width = ! empty( $content_width ) ? $content_width : 640;
42
-
43
- $hash = md5( serialize( array(
44
- 'src' => $src,
45
- 'width' => $video_width,
46
- 'autoplay' => $autoplay,
47
- ) ) );
48
-
49
- // Convert embed format to standard format to be compatible with wp_oembed_get
50
- $src = preg_replace('/https?:\/\/www.youtube.com\/embed\/([^\/]+)/', 'https://www.youtube.com/watch?v=$1', $src);
51
-
52
- $html = get_transient( 'sow-vid-embed[' . $hash . ']' );
53
- if ( empty( $html ) ) {
54
- $html = wp_oembed_get( $src, array( 'width' => $video_width ) );
55
-
56
- if ( $autoplay ) {
57
- $html = preg_replace_callback( '/src=["\'](http[^"\']*)["\']/', array(
58
- $this,
59
- 'autoplay_callback'
60
- ), $html );
61
- }
62
-
63
- if ( empty( $related_videos ) ) {
64
- $html = preg_replace_callback( '/src=["\'](http[^"\']*)["\']/', array(
65
- $this,
66
- 'remove_related_videos'
67
- ), $html );
68
- }
69
-
70
- if ( ! empty( $html ) ) {
71
- set_transient( 'sow-vid-embed[' . $hash . ']', $html, 30 * 86400 );
72
- }
73
- }
74
-
75
- return $html;
76
- }
77
-
78
- /**
79
- * The preg_replace callback that adds autoplay.
80
- *
81
- * @param $match
82
- *
83
- * @return mixed
84
- */
85
- function autoplay_callback( $match ) {
86
- return str_replace( $match[1], add_query_arg( 'autoplay', 1, $match[1] ), $match[0] );
87
- }
88
-
89
- /**
90
- * The preg_replace callback that adds the rel param for YouTube videos.
91
- *
92
- * @param $match
93
- *
94
- * @return mixed
95
- */
96
- function remove_related_videos( $match ) {
97
- return str_replace( $match[1], add_query_arg( 'rel', 0, $match[1] ), $match[0] );
98
- }
99
- }
1
+ <?php
2
+
3
+ /**
4
+ * This class handles video related functionality.
5
+ *
6
+ * Class SiteOrigin_Video
7
+ */
8
+
9
+ class SiteOrigin_Video {
10
+
11
+ /**
12
+ * Check whether it's possible to oEmbed by testing if a provider URL can be obtained.
13
+ *
14
+ * @param string $url The URL of the video to be embedded.
15
+ *
16
+ * @return bool Whether it's possible to embed this video.
17
+ */
18
+ function can_oembed( $url ) {
19
+ $wp_oembed = new WP_oEmbed();
20
+ $provider = $wp_oembed->get_provider( $url, array( 'discover' => false ) );
21
+
22
+ return ! empty( $provider );
23
+ }
24
+
25
+ /**
26
+ * Gets a video source embed
27
+ *
28
+ * @param string $src The URL of the video.
29
+ * @param bool $autoplay Whether to start playing the video automatically once loaded. ( YouTube only )
30
+ * @param bool $related_videos Whether to show related videos after the video has finished playing. ( YouTube only )
31
+ *
32
+ * @return false|mixed|null|string|string[]
33
+ */
34
+ function get_video_oembed( $src, $autoplay = false, $related_videos = true ) {
35
+ if ( empty( $src ) ) {
36
+ return '';
37
+ }
38
+
39
+ global $content_width;
40
+
41
+ $video_width = ! empty( $content_width ) ? $content_width : 640;
42
+
43
+ $hash = md5( serialize( array(
44
+ 'src' => $src,
45
+ 'width' => $video_width,
46
+ 'autoplay' => $autoplay,
47
+ ) ) );
48
+
49
+ // Convert embed format to standard format to be compatible with wp_oembed_get
50
+ $src = preg_replace('/https?:\/\/www.youtube.com\/embed\/([^\/]+)/', 'https://www.youtube.com/watch?v=$1', $src);
51
+
52
+ $html = get_transient( 'sow-vid-embed[' . $hash . ']' );
53
+ if ( empty( $html ) ) {
54
+ $html = wp_oembed_get( $src, array( 'width' => $video_width ) );
55
+
56
+ if ( $autoplay ) {
57
+ $html = preg_replace_callback( '/src=["\'](http[^"\']*)["\']/', array(
58
+ $this,
59
+ 'autoplay_callback'
60
+ ), $html );
61
+ }
62
+
63
+ if ( empty( $related_videos ) ) {
64
+ $html = preg_replace_callback( '/src=["\'](http[^"\']*)["\']/', array(
65
+ $this,
66
+ 'remove_related_videos'
67
+ ), $html );
68
+ }
69
+
70
+ if ( ! empty( $html ) ) {
71
+ set_transient( 'sow-vid-embed[' . $hash . ']', $html, 30 * 86400 );
72
+ }
73
+ }
74
+
75
+ return $html;
76
+ }
77
+
78
+ /**
79
+ * The preg_replace callback that adds autoplay.
80
+ *
81
+ * @param $match
82
+ *
83
+ * @return mixed
84
+ */
85
+ function autoplay_callback( $match ) {
86
+ return str_replace( $match[1], add_query_arg( 'autoplay', 1, $match[1] ), $match[0] );
87
+ }
88
+
89
+ /**
90
+ * The preg_replace callback that adds the rel param for YouTube videos.
91
+ *
92
+ * @param $match
93
+ *
94
+ * @return mixed
95
+ */
96
+ function remove_related_videos( $match ) {
97
+ return str_replace( $match[1], add_query_arg( 'rel', 0, $match[1] ), $match[0] );
98
+ }
99
+ }
base/inc/widget-manager.class.php CHANGED
@@ -1,198 +1,198 @@
1
- <?php
2
-
3
- /**
4
- * Handles registering Widgets Bundle widgets.
5
- *
6
- * Class SiteOrigin_Widgets_Widget_Manager
7
- */
8
- class SiteOrigin_Widgets_Widget_Manager {
9
- /**
10
- * Regsitered widgets
11
- *
12
- * @var
13
- */
14
- private $registered;
15
-
16
- function __construct(){
17
- $this->registered = array();
18
- add_action( 'widgets_init', array( $this, 'widgets_init' ) );
19
- }
20
-
21
- /**
22
- * Get the single instance.
23
- *
24
- * @return SiteOrigin_Widgets_Widget_Manager
25
- */
26
- static function single() {
27
- static $single;
28
-
29
- if( empty($single) ) {
30
- $single = new self();
31
- }
32
-
33
- return $single;
34
- }
35
-
36
- /**
37
- * @param $id
38
- * @param $path
39
- * @param bool|false $class
40
- * @return mixed
41
- */
42
- public function register( $id, $path, $class = false ){
43
- $path = wp_normalize_path( $path );
44
- if ( empty( $class ) ) {
45
- $class = 'SiteOrigin_Widget_' . str_replace( ' ', '', ucwords( str_replace('-', ' ', $id) ) ) . '_Widget';
46
- }
47
-
48
- $this->registered[ $id ] = new stdClass();
49
- $this->registered[ $id ]->path = $path;
50
- $this->registered[ $id ]->class = $class;
51
- $this->registered[ $id ]->registered = false;
52
-
53
- return $this->registered[ $id ];
54
- }
55
-
56
- /**
57
- * Initialize all the widgets.
58
- */
59
- public function widgets_init(){
60
- foreach( $this->registered as $id => & $info ) {
61
- if( $info->registered ) continue;
62
- register_widget( $info->class );
63
- $info->registered = true;
64
- }
65
- }
66
-
67
- /**
68
- * Get the path of the widget
69
- *
70
- * @param $id
71
- *
72
- * @return bool
73
- */
74
- public function get_plugin_path( $id ) {
75
- if( empty( $this->registered[ $id ] ) ) {
76
- // This call might be using the incorrect ID convention.
77
- if( substr($id, 0, 4) == 'sow-' ) $id = substr($id, 4);
78
- else $id = 'sow-' . $id;
79
- }
80
-
81
- return !empty($this->registered[$id]) ? $this->registered[$id]->path : false;
82
- }
83
-
84
- /**
85
- * @param $id
86
- *
87
- * @return string
88
- *
89
- * @todo examine this when using a widget in a theme folder.
90
- */
91
- function get_plugin_dir_path( $id ){
92
- return plugin_dir_path( $this->get_plugin_path( $id ) );
93
- }
94
-
95
- function get_plugin_dir_url( $id ){
96
- return plugin_dir_url( $this->get_plugin_path( $id ) );
97
- }
98
-
99
- /**
100
- * Get a widget ID from a file path
101
- *
102
- * @param string $path The file path.
103
- *
104
- * @return string The ID.
105
- */
106
- function get_id_from_path( $path ){
107
- foreach( $this->registered as $id => $r ) {
108
- if( $r->path == $path ) return $id;
109
- }
110
- return false;
111
- }
112
-
113
- /**
114
- * Get the class name of a widget from the
115
- *
116
- * @param $path
117
- * @return mixed
118
- */
119
- function get_class_from_path( $path ) {
120
- foreach( $this->registered as $id => $r ) {
121
- if( $r->path == $path ) return $r->class;
122
- }
123
- return false;
124
- }
125
-
126
- /**
127
- * Get the list of registered widgets.
128
- *
129
- * @return array
130
- */
131
- function get_registered_widgets() {
132
- return $this->registered;
133
- }
134
-
135
- /**
136
- * Get the registered widget instance by it's class name or the hash generated when it was registered.
137
- *
138
- * @param $class_or_hash
139
- *
140
- * @return array
141
- *
142
- */
143
- static function get_widget_instance( $class_or_hash ) {
144
- global $wp_widget_factory;
145
- if ( isset( $wp_widget_factory->widgets[ $class_or_hash ] ) ) {
146
- return $wp_widget_factory->widgets[ $class_or_hash ];
147
- } else {
148
- foreach ( $wp_widget_factory->widgets as $widget_instance ) {
149
- if ( $widget_instance instanceof $class_or_hash ) {
150
- return $widget_instance;
151
- }
152
- }
153
- }
154
- return null;
155
- }
156
- }
157
- SiteOrigin_Widgets_Widget_Manager::single();
158
-
159
- /**
160
- * Register a widget
161
- *
162
- * @param string $id The ID of the widget
163
- * @param string $path The path of the widget
164
- * @param bool|string $class The name of the class
165
- */
166
- function siteorigin_widget_register( $id, $path, $class = false ){
167
- SiteOrigin_Widgets_Widget_Manager::single()->register( $id, $path, $class );
168
- }
169
-
170
- /**
171
- * Get the base file of a widget plugin
172
- *
173
- * @param $name
174
- * @return bool
175
- */
176
- function siteorigin_widget_get_plugin_path($id){
177
- return SiteOrigin_Widgets_Widget_Manager::single()->get_plugin_path( $id );
178
- }
179
-
180
- /**
181
- * Get the base path folder of a widget plugin.
182
- *
183
- * @param $id
184
- * @return string
185
- */
186
- function siteorigin_widget_get_plugin_dir_path($id){
187
- return SiteOrigin_Widgets_Widget_Manager::single()->get_plugin_dir_path( $id );
188
- }
189
-
190
- /**
191
- * Get the base path URL of a widget plugin.
192
- *
193
- * @param $id
194
- * @return string
195
- */
196
- function siteorigin_widget_get_plugin_dir_url($id){
197
- return SiteOrigin_Widgets_Widget_Manager::single()->get_plugin_dir_url( $id );
198
- }
1
+ <?php
2
+
3
+ /**
4
+ * Handles registering Widgets Bundle widgets.
5
+ *
6
+ * Class SiteOrigin_Widgets_Widget_Manager
7
+ */
8
+ class SiteOrigin_Widgets_Widget_Manager {
9
+ /**
10
+ * Regsitered widgets
11
+ *
12
+ * @var
13
+ */
14
+ private $registered;
15
+
16
+ function __construct(){
17
+ $this->registered = array();
18
+ add_action( 'widgets_init', array( $this, 'widgets_init' ) );
19
+ }
20
+
21
+ /**
22
+ * Get the single instance.
23
+ *
24
+ * @return SiteOrigin_Widgets_Widget_Manager
25
+ */
26
+ static function single() {
27
+ static $single;
28
+
29
+ if( empty($single) ) {
30
+ $single = new self();
31
+ }
32
+
33
+ return $single;
34
+ }
35
+
36
+ /**
37
+ * @param $id
38
+ * @param $path
39
+ * @param bool|false $class
40
+ * @return mixed
41
+ */
42
+ public function register( $id, $path, $class = false ){
43
+ $path = wp_normalize_path( $path );
44
+ if ( empty( $class ) ) {
45
+ $class = 'SiteOrigin_Widget_' . str_replace( ' ', '', ucwords( str_replace('-', ' ', $id) ) ) . '_Widget';
46
+ }
47
+
48
+ $this->registered[ $id ] = new stdClass();
49
+ $this->registered[ $id ]->path = $path;
50
+ $this->registered[ $id ]->class = $class;
51
+ $this->registered[ $id ]->registered = false;
52
+
53
+ return $this->registered[ $id ];
54
+ }
55
+
56
+ /**
57
+ * Initialize all the widgets.
58
+ */
59
+ public function widgets_init(){
60
+ foreach( $this->registered as $id => & $info ) {
61
+ if( $info->registered ) continue;
62
+ register_widget( $info->class );
63
+ $info->registered = true;
64
+ }
65
+ }
66
+
67
+ /**
68
+ * Get the path of the widget
69
+ *
70
+ * @param $id
71
+ *
72
+ * @return bool
73
+ */
74
+ public function get_plugin_path( $id ) {
75
+ if( empty( $this->registered[ $id ] ) ) {
76
+ // This call might be using the incorrect ID convention.
77
+ if( substr($id, 0, 4) == 'sow-' ) $id = substr($id, 4);
78
+ else $id = 'sow-' . $id;
79
+ }
80
+
81
+ return !empty($this->registered[$id]) ? $this->registered[$id]->path : false;
82
+ }
83
+
84
+ /**
85
+ * @param $id
86
+ *
87
+ * @return string
88
+ *
89
+ * @todo examine this when using a widget in a theme folder.
90
+ */
91
+ function get_plugin_dir_path( $id ){
92
+ return plugin_dir_path( $this->get_plugin_path( $id ) );
93
+ }
94
+
95
+ function get_plugin_dir_url( $id ){
96
+ return plugin_dir_url( $this->get_plugin_path( $id ) );
97
+ }
98
+
99
+ /**
100
+ * Get a widget ID from a file path
101
+ *
102
+ * @param string $path The file path.
103
+ *
104
+ * @return string The ID.
105
+ */
106
+ function get_id_from_path( $path ){
107
+ foreach( $this->registered as $id => $r ) {
108
+ if( $r->path == $path ) return $id;
109
+ }
110
+ return false;
111
+ }
112
+
113
+ /**
114
+ * Get the class name of a widget from the
115
+ *
116
+ * @param $path
117
+ * @return mixed
118
+ */
119
+ function get_class_from_path( $path ) {
120
+ foreach( $this->registered as $id => $r ) {
121
+ if( $r->path == $path ) return $r->class;
122
+ }
123
+ return false;
124
+ }
125
+
126
+ /**
127
+ * Get the list of registered widgets.
128
+ *
129
+ * @return array
130
+ */
131
+ function get_registered_widgets() {
132
+ return $this->registered;
133
+ }
134
+
135
+ /**
136
+ * Get the registered widget instance by it's class name or the hash generated when it was registered.
137
+ *
138
+ * @param $class_or_hash
139
+ *
140
+ * @return array
141
+ *
142
+ */
143
+ static function get_widget_instance( $class_or_hash ) {
144
+ global $wp_widget_factory;
145
+ if ( isset( $wp_widget_factory->widgets[ $class_or_hash ] ) ) {
146
+ return $wp_widget_factory->widgets[ $class_or_hash ];
147
+ } else {
148
+ foreach ( $wp_widget_factory->widgets as $widget_instance ) {
149
+ if ( $widget_instance instanceof $class_or_hash ) {
150
+ return $widget_instance;
151
+ }
152
+ }
153
+ }
154
+ return null;
155
+ }
156
+ }
157
+ SiteOrigin_Widgets_Widget_Manager::single();
158
+
159
+ /**
160
+ * Register a widget
161
+ *
162
+ * @param string $id The ID of the widget
163
+ * @param string $path The path of the widget
164
+ * @param bool|string $class The name of the class
165
+ */
166
+ function siteorigin_widget_register( $id, $path, $class = false ){
167
+ SiteOrigin_Widgets_Widget_Manager::single()->register( $id, $path, $class );
168
+ }
169
+
170
+ /**
171
+ * Get the base file of a widget plugin
172
+ *
173
+ * @param $name
174
+ * @return bool
175
+ */
176
+ function siteorigin_widget_get_plugin_path($id){
177
+ return SiteOrigin_Widgets_Widget_Manager::single()->get_plugin_path( $id );
178
+ }
179
+
180
+ /**
181
+ * Get the base path folder of a widget plugin.
182
+ *
183
+ * @param $id
184
+ * @return string
185
+ */
186
+ function siteorigin_widget_get_plugin_dir_path($id){
187
+ return SiteOrigin_Widgets_Widget_Manager::single()->get_plugin_dir_path( $id );
188
+ }
189
+
190
+ /**
191
+ * Get the base path URL of a widget plugin.
192
+ *
193
+ * @param $id
194
+ * @return string
195
+ */
196
+ function siteorigin_widget_get_plugin_dir_url($id){
197
+ return SiteOrigin_Widgets_Widget_Manager::single()->get_plugin_dir_url( $id );
198
+ }
base/inc/widgets/base-slider.class.php CHANGED
@@ -1,370 +1,370 @@
1
- <?php
2
-
3
- abstract class SiteOrigin_Widget_Base_Slider extends SiteOrigin_Widget {
4
-
5
- /**
6
- * Register all the frontend scripts and styles for the base slider.
7
- */
8
- function initialize() {
9
-
10
- $frontend_scripts = array();
11
- $frontend_scripts[] = array(
12
- 'sow-slider-slider-cycle2',
13
- plugin_dir_url( SOW_BUNDLE_BASE_FILE ) . 'js/jquery.cycle' . SOW_BUNDLE_JS_SUFFIX . '.js',
14
- array( 'jquery' ),
15
- SOW_BUNDLE_VERSION
16
- );
17
- if( function_exists('wp_is_mobile') && wp_is_mobile() ) {
18
- $frontend_scripts[] = array(
19
- 'sow-slider-slider-cycle2-swipe',
20
- plugin_dir_url( SOW_BUNDLE_BASE_FILE ) . 'js/jquery.cycle.swipe' . SOW_BUNDLE_JS_SUFFIX . '.js',
21
- array( 'jquery' ),
22
- SOW_BUNDLE_VERSION
23
- );
24
- }
25
- $frontend_scripts[] = array(
26
- 'sow-slider-slider',
27
- plugin_dir_url( SOW_BUNDLE_BASE_FILE ) . 'js/slider/jquery.slider' . SOW_BUNDLE_JS_SUFFIX . '.js',
28
- array( 'jquery' ),
29
- SOW_BUNDLE_VERSION
30
- );
31
-
32
- $this->register_frontend_scripts( $frontend_scripts );
33
- $this->register_frontend_styles(
34
- array(
35
- array(
36
- 'sow-slider-slider',
37
- plugin_dir_url( SOW_BUNDLE_BASE_FILE ) . 'css/slider/slider.css',
38
- array(),
39
- SOW_BUNDLE_VERSION
40
- )
41
- )
42
- );
43
- }
44
-
45
- /**
46
- * The control array required for the slider
47
- *
48
- * @return array
49
- */
50
- function control_form_fields(){
51
- return array(
52
- 'speed' => array(
53
- 'type' => 'number',
54
- 'label' => __('Animation speed', 'so-widgets-bundle'),
55
- 'description' => __('Animation speed in milliseconds.', 'so-widgets-bundle'),
56
- 'default' => 800,
57
- ),
58
-
59
- 'timeout' => array(
60
- 'type' => 'number',
61
- 'label' => __('Timeout', 'so-widgets-bundle'),
62
- 'description' => __('How long each frame is displayed for in milliseconds.', 'so-widgets-bundle'),
63
- 'default' => 8000,
64
- ),
65
-
66
- 'nav_color_hex' => array(
67
- 'type' => 'color',
68
- 'label' => __('Navigation color', 'so-widgets-bundle'),
69
- 'default' => '#FFFFFF',
70
- ),
71
-
72
- 'nav_style' => array(
73
- 'type' => 'select',
74
- 'label' => __('Navigation style', 'so-widgets-bundle'),
75
- 'default' => 'thin',
76
- 'options' => array(
77
- 'ultra-thin' => __('Ultra thin', 'so-widgets-bundle'),
78
- 'thin' => __('Thin', 'so-widgets-bundle'),
79
- 'medium' => __('Medium', 'so-widgets-bundle'),
80
- 'thick' => __('Thick', 'so-widgets-bundle'),
81
- 'ultra-thin-rounded' => __('Rounded ultra thin', 'so-widgets-bundle'),
82
- 'thin-rounded' => __('Rounded thin', 'so-widgets-bundle'),
83
- 'medium-rounded' => __('Rounded medium', 'so-widgets-bundle'),
84
- 'thick-rounded' => __('Rounded thick', 'so-widgets-bundle'),
85
- )
86
- ),
87
-
88
- 'nav_size' => array(
89
- 'type' => 'number',
90
- 'label' => __('Navigation size', 'so-widgets-bundle'),
91
- 'default' => '25',
92
- ),
93
-
94
- 'nav_always_show_mobile' => array(
95
- 'type' => 'checkbox',
96
- 'label' => __( 'Always show navigation on mobile', 'so-widgets-bundle' ),
97
- ),
98
-
99
- 'swipe' => array(
100
- 'type' => 'checkbox',
101
- 'label' => __( 'Swipe control', 'so-widgets-bundle' ),
102
- 'description' => __( 'Allow users to swipe through frames on mobile devices.', 'so-widgets-bundle' ),
103
- 'default' => true,
104
- ),
105
-
106
- 'background_video_mobile' => array(
107
- 'type' => 'checkbox',
108
- 'label' => __( 'Show slide background videos on mobile', 'so-widgets-bundle' ),
109
- 'description' => __( 'Allow slide background videos to appear on mobile devices that support autoplay.', 'so-widgets-bundle' ),
110
- )
111
- );
112
- }
113
-
114
- function video_form_fields(){
115
- return array(
116
- 'file' => array(
117
- 'type' => 'media',
118
- 'library' => 'video',
119
- 'label' => __('Video file', 'so-widgets-bundle'),
120
- ),
121
-
122
- 'url' => array(
123
- 'type' => 'text',
124
- 'sanitize' => 'url',
125
- 'label' => __('Video URL', 'so-widgets-bundle'),
126
- 'optional' => 'true',
127
- 'description' => __('An external URL of the video. Overrides video file.', 'so-widgets-bundle')
128
- ),
129
-
130
- 'autoplay' => array(
131
- 'type' => 'checkbox',
132
- 'label' => __( 'Autoplay', 'so-widgets-bundle' ),
133
- 'default' => false,
134
- 'description' => __( 'Currently only for YouTube videos.', 'so-widgets-bundle' ),
135
- ),
136
-
137
- 'format' => array(
138
- 'type' => 'select',
139
- 'label' => __('Video format', 'so-widgets-bundle'),
140
- 'options' => array(
141
- 'video/mp4' => 'MP4',
142
- 'video/webm' => 'WebM',
143
- 'video/ogg' => 'Ogg',
144
- ),
145
- ),
146
- );
147
- }
148
-
149
- function get_settings_form() {
150
- return array(
151
- 'responsive_breakpoint' => array(
152
- 'type' => 'measurement',
153
- 'label' => __( 'Responsive Breakpoint', 'so-widgets-bundle' ),
154
- 'default' => '780px',
155
- 'description' => __( "This setting controls when the Slider will switch to the responsive mode. This breakpoint will only be used if always show navigation on mobile is enabled. The default value is 780px.", 'so-widgets-bundle' )
156
- )
157
- );
158
- }
159
-
160
- function slider_settings( $controls ){
161
- return array(
162
- 'pagination' => true,
163
- 'speed' => empty( $controls['speed'] ) ? 1 : $controls['speed'],
164
- 'timeout' => $controls['timeout'],
165
- 'swipe' => $controls['swipe'],
166
- 'nav_always_show_mobile' => ! empty( $controls['nav_always_show_mobile'] ) ? true : '',
167
- 'breakpoint' => ! empty( $controls['breakpoint'] ) ? $controls['breakpoint'] : '780px',
168
- );
169
- }
170
-
171
- function render_template( $controls, $frames ){
172
- $this->render_template_part('before_slider', $controls, $frames);
173
- $this->render_template_part('before_slides', $controls, $frames);
174
-
175
- foreach( $frames as $i => $frame ) {
176
- $this->render_frame( $i, $frame, $controls );
177
- }
178
-
179
- $this->render_template_part('after_slides', $controls, $frames);
180
- $this->render_template_part('navigation', $controls, $frames);
181
- $this->render_template_part('after_slider', $controls, $frames);
182
- }
183
-
184
- function render_template_part( $part, $controls, $frames ) {
185
- switch( $part ) {
186
- case 'before_slider':
187
- ?><div class="sow-slider-base <?php if( wp_is_mobile() ) echo 'sow-slider-is-mobile' ?>" style="display: none"><?php
188
- break;
189
- case 'before_slides':
190
- $settings = $this->slider_settings( $controls );
191
- ?><ul class="sow-slider-images" data-settings="<?php echo esc_attr( json_encode($settings) ) ?>"><?php
192
- break;
193
- case 'after_slides':
194
- ?></ul><?php
195
- break;
196
- case 'navigation':
197
- ?>
198
- <ol class="sow-slider-pagination">
199
- <?php foreach($frames as $i => $frame) : ?>
200
- <li><a href="#" data-goto="<?php echo $i ?>" aria-label="<?php printf( __( 'display slide %s', 'so-widgets-bundle' ), $i+1 ) ?>"><?php echo $i+1 ?></a></li>
201
- <?php endforeach; ?>
202
- </ol>
203
-
204
- <div class="sow-slide-nav sow-slide-nav-next">
205
- <a href="#" data-goto="next" aria-label="<?php _e( 'next slide', 'so-widgets-bundle' ) ?>" data-action="next">
206
- <em class="sow-sld-icon-<?php echo sanitize_html_class( $controls['nav_style'] ) ?>-right"></em>
207
- </a>
208
- </div>
209
-
210
- <div class="sow-slide-nav sow-slide-nav-prev">
211
- <a href="#" data-goto="previous" aria-label="<?php _e( 'previous slide', 'so-widgets-bundle' ) ?>" data-action="prev">
212
- <em class="sow-sld-icon-<?php echo sanitize_html_class( $controls['nav_style'] ) ?>-left"></em>
213
- </a>
214
- </div>
215
- <?php
216
- break;
217
- case 'after_slider':
218
- ?></div><?php
219
- break;
220
- }
221
- }
222
-
223
- /**
224
- * Get the frame background information from the frame. This can be overwritten by child classes.
225
- *
226
- * @param $frame
227
- *
228
- * @return array
229
- */
230
- function get_frame_background( $i, $frame ) {
231
- return array( );
232
- }
233
-
234
- /**
235
- * This is mainly for rendering the frame wrapper
236
- *
237
- * @param $i
238
- * @param $frame
239
- */
240
- function render_frame( $i, $frame, $controls ){
241
- $background = wp_parse_args( $this->get_frame_background( $i, $frame ), array(
242
- 'color' => false,
243
- 'image' => false,
244
- 'image-width' => 0,
245
- 'image-height' => 0,
246
- 'opacity' => 1,
247
- 'url' => false,
248
- 'new_window' => false,
249
- 'image-sizing' => 'cover', // options for image sizing are cover and contain
250
- 'videos' => false,
251
- 'videos-sizing' => 'background', // options for video sizing are background or full
252
- ) );
253
-
254
- $wrapper_attributes = array(
255
- 'class' => array( 'sow-slider-image' ),
256
- 'style' => array(),
257
- );
258
-
259
- if( !empty($background['color']) ) {
260
- $wrapper_attributes['style'][] = 'background-color: ' . esc_attr($background['color']);
261
- }
262
-
263
- if( $background['opacity'] >= 1 ) {
264
- if( !empty($background['image']) ) {
265
- $wrapper_attributes['style'][] = 'background-image: url(' . esc_url($background['image']) . ')';
266
- }
267
- }
268
-
269
- if( ! empty( $background['url'] ) ) {
270
- $wrapper_attributes['style'][] = 'cursor: pointer;';
271
- }
272
-
273
- if( !empty($background['image']) && !empty($background['image-sizing']) ) {
274
- $wrapper_attributes['class'][] = ' ' . 'sow-slider-image-' . $background['image-sizing'];
275
- }
276
- if( !empty( $background['url'] ) ) {
277
- $wrapper_attributes['data-url'] = json_encode( array(
278
- 'url' => sow_esc_url($background['url']),
279
- 'new_window' => !empty( $background['new_window'] )
280
- ) );
281
- }
282
- $wrapper_attributes = apply_filters( 'siteorigin_widgets_slider_wrapper_attributes', $wrapper_attributes, $frame, $background );
283
-
284
- $wrapper_attributes['class'] = implode( ' ', $wrapper_attributes['class'] );
285
- $wrapper_attributes['style'] = implode( ';', $wrapper_attributes['style'] );
286
-
287
- ?>
288
- <li <?php foreach( $wrapper_attributes as $attr => $val ) echo $attr . '="' . esc_attr( $val ) . '" '; ?>>
289
- <?php
290
- $this->render_frame_contents( $i, $frame );
291
- if( !empty( $background['videos'] ) ) {
292
-
293
- $classes = array( 'sow-' . $background['video-sizing'] . '-element' );
294
- if ( ! empty( $controls['background_video_mobile'] ) ) {
295
- $classes[] = 'sow-mobile-video_enabled';
296
- }
297
-
298
- $this->video_code( $background['videos'], $classes );
299
- }
300
-
301
- if( $background['opacity'] < 1 && !empty($background['image']) ) {
302
- $overlay_attributes = array(
303
- 'class' => array( 'sow-slider-image-overlay', 'sow-slider-image-' . $background['image-sizing'] ),
304
- 'style' => array(
305
- 'background-image: url(' . $background['image'] . ')',
306
- 'opacity: ' . floatval( $background['opacity'] ),
307
- )
308
- );
309
- $overlay_attributes = apply_filters( 'siteorigin_widgets_slider_overlay_attributes', $overlay_attributes, $frame, $background );
310
-
311
- $overlay_attributes['class'] = implode( ' ', $overlay_attributes['class'] );
312
- $overlay_attributes['style'] = implode( ';', $overlay_attributes['style'] );
313
-
314
- ?><div <?php foreach( $overlay_attributes as $attr => $val ) echo $attr . '="' . esc_attr( $val ) . '" '; ?> ></div><?php
315
- }
316
-
317
- ?>
318
- </li>
319
- <?php
320
-
321
- }
322
-
323
- /**
324
- * Render the actual content of the frame.
325
- *
326
- * @param $i
327
- * @param $frame
328
- */
329
- abstract function render_frame_contents( $i, $frame );
330
-
331
- /**
332
- * Render the background videos
333
- *
334
- * @param $videos
335
- * @param array $classes
336
- */
337
- function video_code( $videos, $classes = array() ){
338
- if( empty( $videos ) ) return;
339
- $video_element = '<video class="' . esc_attr( implode( ' ', $classes ) ) . '" autoplay loop muted playsinline>';
340
-
341
- $so_video = new SiteOrigin_Video();
342
- foreach( $videos as $video ) {
343
- if( empty( $video['file'] ) && empty ( $video['url'] ) ) continue;
344
- // If video is an external file, try and display it using oEmbed
345
- if( !empty( $video['url'] ) ) {
346
-
347
- $can_oembed = $so_video->can_oembed( $video['url'] );
348
-
349
- // Check if we can oEmbed the video or not
350
- if( ! $can_oembed ) {
351
- $video_file = sow_esc_url( $video['url'] );
352
- } else {
353
- echo $so_video->get_video_oembed( $video['url'], ! empty( $video['autoplay'] ) );
354
- continue;
355
- }
356
- }
357
-
358
- // If $video_file isn't set video is a local file
359
- if( !isset( $video_file ) ) {
360
- $video_file = wp_get_attachment_url( $video['file'] );
361
- }
362
- $video_element .= '<source src="' . sow_esc_url( $video_file ) . '" type="' . esc_attr( $video['format'] ) . '">';
363
- }
364
- if ( strpos( $video_element, 'source' ) !== false ) {
365
- $video_element .= '</video>';
366
- echo $video_element;
367
- }
368
- }
369
-
370
- }
1
+ <?php
2
+
3
+ abstract class SiteOrigin_Widget_Base_Slider extends SiteOrigin_Widget {
4
+
5
+ /**
6
+ * Register all the frontend scripts and styles for the base slider.
7
+ */
8
+ function initialize() {
9
+
10
+ $frontend_scripts = array();
11
+ $frontend_scripts[] = array(
12
+ 'sow-slider-slider-cycle2',
13
+ plugin_dir_url( SOW_BUNDLE_BASE_FILE ) . 'js/jquery.cycle' . SOW_BUNDLE_JS_SUFFIX . '.js',
14
+ array( 'jquery' ),
15
+ SOW_BUNDLE_VERSION
16
+ );
17
+ if( function_exists('wp_is_mobile') && wp_is_mobile() ) {
18
+ $frontend_scripts[] = array(
19
+ 'sow-slider-slider-cycle2-swipe',
20
+ plugin_dir_url( SOW_BUNDLE_BASE_FILE ) . 'js/jquery.cycle.swipe' . SOW_BUNDLE_JS_SUFFIX . '.js',
21
+ array( 'jquery' ),
22
+ SOW_BUNDLE_VERSION
23
+ );
24
+ }
25
+ $frontend_scripts[] = array(
26
+ 'sow-slider-slider',
27
+ plugin_dir_url( SOW_BUNDLE_BASE_FILE ) . 'js/slider/jquery.slider' . SOW_BUNDLE_JS_SUFFIX . '.js',
28
+ array( 'jquery' ),
29
+ SOW_BUNDLE_VERSION
30
+ );
31
+
32
+ $this->register_frontend_scripts( $frontend_scripts );
33
+ $this->register_frontend_styles(
34
+ array(
35
+ array(
36
+ 'sow-slider-slider',
37
+ plugin_dir_url( SOW_BUNDLE_BASE_FILE ) . 'css/slider/slider.css',
38
+ array(),
39
+ SOW_BUNDLE_VERSION
40
+ )
41
+ )
42
+ );
43
+ }
44
+
45
+ /**
46
+ * The control array required for the slider
47
+ *
48
+ * @return array
49
+ */
50
+ function control_form_fields(){
51
+ return array(
52
+ 'speed' => array(
53
+ 'type' => 'number',
54
+ 'label' => __('Animation speed', 'so-widgets-bundle'),
55
+ 'description' => __('Animation speed in milliseconds.', 'so-widgets-bundle'),
56
+ 'default' => 800,
57
+ ),
58
+
59
+ 'timeout' => array(
60
+ 'type' => 'number',
61
+ 'label' => __('Timeout', 'so-widgets-bundle'),
62
+ 'description' => __('How long each frame is displayed for in milliseconds.', 'so-widgets-bundle'),
63
+ 'default' => 8000,
64
+ ),
65
+
66
+ 'nav_color_hex' => array(
67
+ 'type' => 'color',
68
+ 'label' => __('Navigation color', 'so-widgets-bundle'),
69
+ 'default' => '#FFFFFF',
70
+ ),
71
+
72
+ 'nav_style' => array(
73
+ 'type' => 'select',
74
+ 'label' => __('Navigation style', 'so-widgets-bundle'),
75
+ 'default' => 'thin',
76
+ 'options' => array(
77
+ 'ultra-thin' => __('Ultra thin', 'so-widgets-bundle'),
78
+ 'thin' => __('Thin', 'so-widgets-bundle'),
79
+ 'medium' => __('Medium', 'so-widgets-bundle'),
80
+ 'thick' => __('Thick', 'so-widgets-bundle'),
81
+ 'ultra-thin-rounded' => __('Rounded ultra thin', 'so-widgets-bundle'),
82
+ 'thin-rounded' => __('Rounded thin', 'so-widgets-bundle'),
83
+ 'medium-rounded' => __('Rounded medium', 'so-widgets-bundle'),
84
+ 'thick-rounded' => __('Rounded thick', 'so-widgets-bundle'),
85
+ )
86
+ ),
87
+
88
+ 'nav_size' => array(
89
+ 'type' => 'number',
90
+ 'label' => __('Navigation size', 'so-widgets-bundle'),
91
+ 'default' => '25',
92
+ ),
93
+
94
+ 'nav_always_show_mobile' => array(
95
+ 'type' => 'checkbox',
96
+ 'label' => __( 'Always show navigation on mobile', 'so-widgets-bundle' ),
97
+ ),
98
+
99
+ 'swipe' => array(
100
+ 'type' => 'checkbox',
101
+ 'label' => __( 'Swipe control', 'so-widgets-bundle' ),
102
+ 'description' => __( 'Allow users to swipe through frames on mobile devices.', 'so-widgets-bundle' ),
103
+ 'default' => true,
104
+ ),
105
+
106
+ 'background_video_mobile' => array(
107
+ 'type' => 'checkbox',
108
+ 'label' => __( 'Show slide background videos on mobile', 'so-widgets-bundle' ),
109
+ 'description' => __( 'Allow slide background videos to appear on mobile devices that support autoplay.', 'so-widgets-bundle' ),
110
+ )
111
+ );
112
+ }
113
+
114
+ function video_form_fields(){
115
+ return array(
116
+ 'file' => array(
117
+ 'type' => 'media',
118
+ 'library' => 'video',
119
+ 'label' => __('Video file', 'so-widgets-bundle'),
120
+ ),
121
+
122
+ 'url' => array(
123
+ 'type' => 'text',
124
+ 'sanitize' => 'url',
125
+ 'label' => __('Video URL', 'so-widgets-bundle'),
126
+ 'optional' => 'true',
127
+ 'description' => __('An external URL of the video. Overrides video file.', 'so-widgets-bundle')
128
+ ),
129
+
130
+ 'autoplay' => array(
131
+ 'type' => 'checkbox',
132
+ 'label' => __( 'Autoplay', 'so-widgets-bundle' ),
133
+ 'default' => false,
134
+ 'description' => __( 'Currently only for YouTube videos.', 'so-widgets-bundle' ),
135
+ ),
136
+
137
+ 'format' => array(
138
+ 'type' => 'select',
139
+ 'label' => __('Video format', 'so-widgets-bundle'),
140
+ 'options' => array(
141
+ 'video/mp4' => 'MP4',
142
+ 'video/webm' => 'WebM',
143
+ 'video/ogg' => 'Ogg',
144
+ ),
145
+ ),
146
+ );
147
+ }
148
+
149
+ function get_settings_form() {
150
+ return array(
151
+ 'responsive_breakpoint' => array(
152
+ 'type' => 'measurement',
153
+ 'label' => __( 'Responsive Breakpoint', 'so-widgets-bundle' ),
154
+ 'default' => '780px',
155
+ 'description' => __( "This setting controls when the Slider will switch to the responsive mode. This breakpoint will only be used if always show navigation on mobile is enabled. The default value is 780px.", 'so-widgets-bundle' )
156
+ )
157
+ );
158
+ }
159
+
160
+ function slider_settings( $controls ){
161
+ return array(
162
+ 'pagination' => true,
163
+ 'speed' => empty( $controls['speed'] ) ? 1 : $controls['speed'],
164
+ 'timeout' => $controls['timeout'],
165
+ 'swipe' => $controls['swipe'],
166
+ 'nav_always_show_mobile' => ! empty( $controls['nav_always_show_mobile'] ) ? true : '',
167
+ 'breakpoint' => ! empty( $controls['breakpoint'] ) ? $controls['breakpoint'] : '780px',
168
+ );
169
+ }
170
+
171
+ function render_template( $controls, $frames ){
172
+ $this->render_template_part('before_slider', $controls, $frames);
173
+ $this->render_template_part('before_slides', $controls, $frames);
174
+
175
+ foreach( $frames as $i => $frame ) {
176
+ $this->render_frame( $i, $frame, $controls );
177
+ }
178
+
179
+ $this->render_template_part('after_slides', $controls, $frames);
180
+ $this->render_template_part('navigation', $controls, $frames);
181
+ $this->render_template_part('after_slider', $controls, $frames);
182
+ }
183
+
184
+ function render_template_part( $part, $controls, $frames ) {
185
+ switch( $part ) {
186
+ case 'before_slider':
187
+ ?><div class="sow-slider-base <?php if( wp_is_mobile() ) echo 'sow-slider-is-mobile' ?>" style="display: none"><?php
188
+ break;
189
+ case 'before_slides':
190
+ $settings = $this->slider_settings( $controls );
191
+ ?><ul class="sow-slider-images" data-settings="<?php echo esc_attr( json_encode($settings) ) ?>"><?php
192
+ break;
193
+ case 'after_slides':
194
+ ?></ul><?php
195
+ break;
196
+ case 'navigation':
197
+ ?>
198
+ <ol class="sow-slider-pagination">
199
+ <?php foreach($frames as $i => $frame) : ?>
200
+ <li><a href="#" data-goto="<?php echo $i ?>" aria-label="<?php printf( __( 'display slide %s', 'so-widgets-bundle' ), $i+1 ) ?>"><?php echo $i+1 ?></a></li>
201
+ <?php endforeach; ?>
202
+ </ol>
203
+
204
+ <div class="sow-slide-nav sow-slide-nav-next">
205
+ <a href="#" data-goto="next" aria-label="<?php _e( 'next slide', 'so-widgets-bundle' ) ?>" data-action="next">
206
+ <em class="sow-sld-icon-<?php echo sanitize_html_class( $controls['nav_style'] ) ?>-right"></em>
207
+ </a>
208
+ </div>
209
+
210
+ <div class="sow-slide-nav sow-slide-nav-prev">
211
+ <a href="#" data-goto="previous" aria-label="<?php _e( 'previous slide', 'so-widgets-bundle' ) ?>" data-action="prev">
212
+ <em class="sow-sld-icon-<?php echo sanitize_html_class( $controls['nav_style'] ) ?>-left"></em>
213
+ </a>
214
+ </div>
215
+ <?php
216
+ break;
217
+ case 'after_slider':
218
+ ?></div><?php
219
+ break;
220
+ }
221
+ }
222
+
223
+ /**
224
+ * Get the frame background information from the frame. This can be overwritten by child classes.
225
+ *
226
+ * @param $frame
227
+ *
228
+ * @return array
229
+ */
230
+ function get_frame_background( $i, $frame ) {
231
+ return array( );
232
+ }
233
+
234
+ /**
235
+ * This is mainly for rendering the frame wrapper
236
+ *
237
+ * @param $i
238
+ * @param $frame
239
+ */
240
+ function render_frame( $i, $frame, $controls ){
241
+ $background = wp_parse_args( $this->get_frame_background( $i, $frame ), array(
242
+ 'color' => false,
243
+ 'image' => false,
244
+ 'image-width' => 0,
245
+ 'image-height' => 0,
246
+ 'opacity' => 1,
247
+ 'url' => false,
248
+ 'new_window' => false,
249
+ 'image-sizing' => 'cover', // options for image sizing are cover and contain
250
+ 'videos' => false,
251
+ 'videos-sizing' => 'background', // options for video sizing are background or full
252
+ ) );
253
+
254
+ $wrapper_attributes = array(
255
+ 'class' => array( 'sow-slider-image' ),
256
+ 'style' => array(),
257
+ );
258
+
259
+ if( !empty($background['color']) ) {
260
+ $wrapper_attributes['style'][] = 'background-color: ' . esc_attr($background['color']);
261
+ }
262
+
263
+ if( $background['opacity'] >= 1 ) {
264
+ if( !empty($background['image']) ) {
265
+ $wrapper_attributes['style'][] = 'background-image: url(' . esc_url($background['image']) . ')';
266
+ }
267
+ }
268
+
269
+ if( ! empty( $background['url'] ) ) {
270
+ $wrapper_attributes['style'][] = 'cursor: pointer;';
271
+ }
272
+
273
+ if( !empty($background['image']) && !empty($background['image-sizing']) ) {
274
+ $wrapper_attributes['class'][] = ' ' . 'sow-slider-image-' . $background['image-sizing'];
275
+ }
276
+ if( !empty( $background['url'] ) ) {
277
+ $wrapper_attributes['data-url'] = json_encode( array(
278
+ 'url' => sow_esc_url($background['url']),
279
+ 'new_window' => !empty( $background['new_window'] )
280
+ ) );
281
+ }
282
+ $wrapper_attributes = apply_filters( 'siteorigin_widgets_slider_wrapper_attributes', $wrapper_attributes, $frame, $background );
283
+
284
+ $wrapper_attributes['class'] = implode( ' ', $wrapper_attributes['class'] );
285
+ $wrapper_attributes['style'] = implode( ';', $wrapper_attributes['style'] );
286
+
287
+ ?>
288
+ <li <?php foreach( $wrapper_attributes as $attr => $val ) echo $attr . '="' . esc_attr( $val ) . '" '; ?>>
289
+ <?php
290
+ $this->render_frame_contents( $i, $frame );
291
+ if( !empty( $background['videos'] ) ) {
292
+
293
+ $classes = array( 'sow-' . $background['video-sizing'] . '-element' );
294
+ if ( ! empty( $controls['background_video_mobile'] ) ) {
295
+ $classes[] = 'sow-mobile-video_enabled';
296
+ }
297
+
298
+ $this->video_code( $background['videos'], $classes );
299
+ }
300
+
301
+ if( $background['opacity'] < 1 && !empty($background['image']) ) {
302
+ $overlay_attributes = array(
303
+ 'class' => array( 'sow-slider-image-overlay', 'sow-slider-image-' . $background['image-sizing'] ),
304
+ 'style' => array(
305
+ 'background-image: url(' . $background['image'] . ')',
306
+ 'opacity: ' . floatval( $background['opacity'] ),
307
+ )
308
+ );
309
+ $overlay_attributes = apply_filters( 'siteorigin_widgets_slider_overlay_attributes', $overlay_attributes, $frame, $background );
310
+
311
+ $overlay_attributes['class'] = implode( ' ', $overlay_attributes['class'] );
312
+ $overlay_attributes['style'] = implode( ';', $overlay_attributes['style'] );
313
+
314
+ ?><div <?php foreach( $overlay_attributes as $attr => $val ) echo $attr . '="' . esc_attr( $val ) . '" '; ?> ></div><?php
315
+ }
316
+
317
+ ?>
318
+ </li>
319
+ <?php
320
+
321
+ }
322
+
323
+ /**
324
+ * Render the actual content of the frame.
325
+ *
326
+ * @param $i
327
+ * @param $frame
328
+ */
329
+ abstract function render_frame_contents( $i, $frame );
330
+
331
+ /**
332
+ * Render the background videos
333
+ *
334
+ * @param $videos
335
+ * @param array $classes
336
+ */
337
+ function video_code( $videos, $classes = array() ){
338
+ if( empty( $videos ) ) return;
339
+ $video_element = '<video class="' . esc_attr( implode( ' ', $classes ) ) . '" autoplay loop muted playsinline>';
340
+
341
+ $so_video = new SiteOrigin_Video();
342
+ foreach( $videos as $video ) {
343
+ if( empty( $video['file'] ) && empty ( $video['url'] ) ) continue;
344
+ // If video is an external file, try and display it using oEmbed
345
+ if( !empty( $video['url'] ) ) {
346
+
347
+ $can_oembed = $so_video->can_oembed( $video['url'] );
348
+
349
+ // Check if we can oEmbed the video or not
350
+ if( ! $can_oembed ) {
351
+ $video_file = sow_esc_url( $video['url'] );
352
+ } else {
353
+ echo $so_video->get_video_oembed( $video['url'], ! empty( $video['autoplay'] ) );
354
+ continue;
355
+ }
356
+ }
357
+
358
+ // If $video_file isn't set video is a local file
359
+ if( !isset( $video_file ) ) {
360
+ $video_file = wp_get_attachment_url( $video['file'] );
361
+ }
362
+ $video_element .= '<source src="' . sow_esc_url( $video_file ) . '" type="' . esc_attr( $video['format'] ) . '">';
363
+ }
364
+ if ( strpos( $video_element, 'source' ) !== false ) {
365
+ $video_element .= '</video>';
366
+ echo $video_element;
367
+ }
368
+ }
369
+
370
+ }
base/js/admin.js CHANGED
@@ -1,1453 +1,1456 @@
1
- /* globals wp, jQuery, _, soWidgets, confirm, tinymce, sowbForms */
2
-
3
- var sowbForms = window.sowbForms || {};
4
-
5
- (function ($) {
6
-
7
- $.fn.sowSetupForm = function () {
8
-
9
- return $(this).each(function (i, el) {
10
- var $el = $(el),
11
- $mainForm,
12
- formId,
13
- formInitializing = true;
14
-
15
- var $body = $( 'body' );
16
- // Skip this if the widget has any fields with an __i__
17
- var $inputs = $el.find('input[name]');
18
- if ($inputs.length && $inputs.attr('name').indexOf('__i__') !== -1) {
19
- return this;
20
- }
21
-
22
- // Skip this if we've already set up the form
23
- if ( $el.is('.siteorigin-widget-form-main') ) {
24
- if ($el.data('sow-form-setup') === true) {
25
- return true;
26
- }
27
- // If we're in the main widgets interface and the form isn't visible and it isn't contained in a
28
- // panels dialog (when using the Layout Builder widget), don't worry about setting it up.
29
- if ($body.hasClass('widgets-php') && !$el.is(':visible') && $el.closest('.panel-dialog').length === 0) {
30
- return true;
31
- }
32
-
33
- // Listen for a state change event if this is the main form wrapper
34
- $el.on('sowstatechange', function (e, incomingGroup, incomingState) {
35
-
36
- // Find all wrappers that have state handlers on them
37
- $el.find('[data-state-handler]').each(function () {
38
- var $$ = $(this);
39
- // Create a copy of the current state handlers. Add in initial handlers if the form is initializing.
40
- var handler = $.extend({}, $$.data('state-handler'), formInitializing ? $$.data('state-handler-initial') : {});
41
- if (Object.keys(handler).length === 0) {
42
- return true;
43
- }
44
-
45
- // We need to figure out what the incoming state is
46
- var handlerStateParts, handlerState, thisHandler, $$f, runHandler, handlerStateNames;
47
-
48
- // Indicates if the handler has run
49
- var handlerRun = {};
50
-
51
- var repeaterIndex = sowbForms.getContainerFieldId( $$, 'repeater', '.siteorigin-widget-field-repeater-item' );
52
- if (repeaterIndex !== false) {
53
- var repeaterHandler = {};
54
- for ( var rptrState in handler) {
55
- repeaterHandler[rptrState.replace('{$repeater}', repeaterIndex)] = handler[rptrState];
56
- }
57
- handler = repeaterHandler;
58
- }
59
-
60
- var widgetFieldId = sowbForms.getContainerFieldId( $$, 'widget', '.siteorigin-widget-widget' );
61
- if ( widgetFieldId !== false ) {
62
- var widgetFieldHandler = {};
63
- for ( var wdgFldState in handler) {
64
- var stMatches = wdgFldState.match( /_else\[(.*)\]|(.*)\[(.*)\]/ );
65
- var st = '';
66
- if ( stMatches && stMatches.length && stMatches[1] === undefined ) {
67
- st = stMatches[ 2 ] + '_' + widgetFieldId + '[' + stMatches[ 3 ] + ']';
68
- } else {
69
- st = '_else[' + stMatches[ 1 ] + '_' + widgetFieldId + ']';
70
- }
71
-
72
- widgetFieldHandler[st] = handler[wdgFldState];
73
- }
74
- handler = widgetFieldHandler;
75
- }
76
-
77
- // Go through all the handlers
78
- for (var state in handler) {
79
- runHandler = false;
80
-
81
- // Parse the handler state parts
82
- handlerStateParts = state.match(/^([a-zA-Z0-9_-]+)(\[([a-zA-Z0-9_\-,]+)\])?(\[\])?$/);
83
- if (handlerStateParts === null) {
84
- // Skip this if there's a problem with the state parts
85
- continue;
86
- }
87
-
88
- handlerState = {
89
- 'group': 'default',
90
- 'name': '',
91
- 'multi': false
92
- };
93
-
94
- // Assign the handlerState attributes based on the parsed state
95
- if (handlerStateParts[2] !== undefined) {
96
- handlerState.group = handlerStateParts[1];
97
- handlerState.name = handlerStateParts[3];
98
- }
99
- else {
100
- handlerState.name = handlerStateParts[0];
101
- }
102
- handlerState.multi = (handlerStateParts[4] !== undefined);
103
-
104
- if (handlerState.group === '_else') {
105
- // This is the special case of an group else handler
106
- // Always run if no handlers from the current group have been run yet
107
- handlerState.group = handlerState.name;
108
- handlerState.name = '';
109
-
110
- // We will run this handler because none have run for it yet
111
- runHandler = ( handlerState.group === incomingGroup && typeof handlerRun[handlerState.group] === 'undefined' );
112
- }
113
- else {
114
- // Evaluate if we're in the current state
115
- handlerStateNames = handlerState.name.split(',').map(function (a) {
116
- return a.trim()
117
- });
118
- for (var i = 0; i < handlerStateNames.length; i++) {
119
- runHandler = (handlerState.group === incomingGroup && handlerStateNames[i] === incomingState);
120
- if (runHandler) break;
121
- }
122
- }
123
-
124
- // Run the handler if previous checks have determined we should
125
- if (runHandler) {
126
- thisHandler = handler[state];
127
-
128
- // Now we can handle the the handler
129
- if (!handlerState.multi) {
130
- thisHandler = [thisHandler];
131
- }
132
-
133
- for (var i = 0; i < thisHandler.length; i++) {
134
- // Choose the item we'll be acting on here
135
- if (typeof thisHandler[i][1] !== 'undefined' && Boolean(thisHandler[i][1])) {
136
- // thisHandler[i][1] is the sub selector
137
- $$f = $$.find(thisHandler[i][1]);
138
- }
139
- else {
140
- $$f = $$;
141
- }
142
-
143
- // Call the function on the wrapper we've selected
144
- $$f[thisHandler[i][0]].apply($$f, typeof thisHandler[i][2] !== 'undefined' ? thisHandler[i][2] : []);
145
-
146
- if ( $$f.is( '.siteorigin-widget-field:visible' ) ) {
147
- if ( $$f.is( '.siteorigin-widget-field-type-section' ) ) {
148
- var $fields = $$f.find( '> .siteorigin-widget-section > .siteorigin-widget-field' );
149
- $fields.trigger( 'sowsetupformfield' );
150
- } else {
151
- $$f.trigger( 'sowsetupformfield' );
152
- }
153
- }
154
-
155
- }
156
-
157
- // Store that we've run a handler
158
- handlerRun[handlerState.group] = true;
159
- }
160
- }
161
-
162
- });
163
- });
164
-
165
- // Lets set up the preview
166
- $el.sowSetupPreview();
167
- $mainForm = $el;
168
-
169
- var $teaser = $el.find('.siteorigin-widget-teaser');
170
- $teaser.find('.dashicons-dismiss').click(function () {
171
- var $$ = $(this);
172
- $.get($$.data('dismiss-url'));
173
-
174
- $teaser.slideUp('normal', function () {
175
- $teaser.remove();
176
- });
177
- });
178
-
179
-
180
- if ( ! $el.data( 'backupDisabled' ) ) {
181
- var _sow_form_id = $el.find( '> .siteorigin-widgets-form-id' ).val();
182
- var $timestampField = $el.find( '> .siteorigin-widgets-form-timestamp' );
183
- var _sow_form_timestamp = parseInt( $timestampField.val() || 0 );
184
- var data = JSON.parse( sessionStorage.getItem( _sow_form_id ) );
185
- if ( data ) {
186
- if ( data['_sow_form_timestamp'] > _sow_form_timestamp ) {
187
- sowbForms.displayNotice(
188
- $el,
189
- soWidgets.backup.newerVersion,
190
- soWidgets.backup.replaceWarning,
191
- [
192
- {
193
- label: soWidgets.backup.restore,
194
- callback: function ( $notice ) {
195
- sowbForms.setWidgetFormValues( $mainForm, data );
196
- $notice.slideUp( 'fast', function () {
197
- $notice.remove();
198
- } );
199
- },
200
- },
201
- {
202
- label: soWidgets.backup.dismiss,
203
- callback: function ( $notice ) {
204
- $notice.slideUp( 'fast', function () {
205
- sessionStorage.removeItem( _sow_form_id );
206
- $notice.remove();
207
- } );
208
- },
209
- },
210
- ]
211
- );
212
- } else {
213
- sessionStorage.removeItem( _sow_form_id );
214
- }
215
- }
216
- $el.change( function () {
217
- $timestampField.val( new Date().getTime() );
218
- var data = sowbForms.getWidgetFormValues( $el );
219
- sessionStorage.setItem( _sow_form_id, JSON.stringify( data ) );
220
- } );
221
- }
222
- }
223
- else {
224
- $mainForm = $el.closest('.siteorigin-widget-form-main');
225
- }
226
- formId = $mainForm.find('> .siteorigin-widgets-form-id').val();
227
-
228
- // Find any field or sub widget fields.
229
- var $fields = $el.find('> .siteorigin-widget-field');
230
-
231
- // Process any sub sections
232
- $fields.find('> .siteorigin-widget-section').sowSetupForm();
233
-
234
- var $subwidgetFields = $fields.find('> .siteorigin-widget-widget');
235
- $subwidgetFields.find('> .siteorigin-widget-section').sowSetupForm();
236
-
237
- // Process any sub widgets whose fields aren't contained in a section
238
- $subwidgetFields.filter(':not(:has(> .siteorigin-widget-section))').sowSetupForm();
239
-
240
- // Store the field names
241
- $fields.find('.siteorigin-widget-input').each(function (i, input) {
242
- if ($(input).data('original-name') === null) {
243
- $(input).data('original-name', $(input).attr('name'));
244
- }
245
- });
246
-
247
- // Setup all the repeaters
248
- $fields.find('> .siteorigin-widget-field-repeater').sowSetupRepeater();
249
-
250
- // For any repeater items currently in existence
251
- $el.find('.siteorigin-widget-field-repeater-item').sowSetupRepeaterItems();
252
-
253
- // Set up any color fields
254
- $fields.find('> .siteorigin-widget-input-color').each(function () {
255
- var colorField = $(this);
256
- var colorFieldOptions = {
257
- change: function (event, ui) {
258
- setTimeout(function () {
259
- $(event.target).trigger('change');
260
- }, 100);
261
- }
262
- };
263
- if (colorField.data('defaultColor')) {
264
- colorFieldOptions.defaultColor = colorField.data('defaultColor');
265
- }
266
- colorField.wpColorPicker(colorFieldOptions);
267
- });
268
-
269
- ///////////////////////////////////////
270
- // Handle the sections
271
- var expandContainer = function () {
272
- $(this).toggleClass('siteorigin-widget-section-visible');
273
- $(this).parent().find('> .siteorigin-widget-section, > .siteorigin-widget-widget > .siteorigin-widget-section')
274
- .slideToggle('fast', function () {
275
- $(window).resize();
276
- $(this).find('> .siteorigin-widget-field-container-state').val($(this).is(':visible') ? 'open' : 'closed');
277
-
278
- if ( $( this ).is( ':visible' ) ) {
279
- var $fields = $( this ).find( '> .siteorigin-widget-field' );
280
- $fields.trigger( 'sowsetupformfield' );
281
- }
282
- } );
283
- };
284
- $fields.filter('.siteorigin-widget-field-type-widget, .siteorigin-widget-field-type-section').find('> label').click(expandContainer);
285
- $fields.filter('.siteorigin-widget-field-type-posts').find('.posts-container-label-wrapper').click(expandContainer);
286
-
287
- ///////////////////////////////////////
288
- // Handle the slider fields
289
-
290
- $fields.filter('.siteorigin-widget-field-type-slider').each(function () {
291
- var $$ = $(this);
292
- var $input = $$.find('input[type="number"]');
293
- var $c = $$.find('.siteorigin-widget-value-slider');
294
-
295
- $c.slider({
296
- max: parseFloat($input.attr('max')),
297
- min: parseFloat($input.attr('min')),
298
- step: parseFloat($input.attr('step')),
299
- value: parseFloat($input.val()),
300
- slide: function (event, ui) {
301
- $input.val( parseFloat( ui.value ) );
302
- $input.trigger( 'change' );
303
- $$.find('.siteorigin-widget-slider-value').html(ui.value);
304
- },
305
- });
306
- $input.change(function(event, data) {
307
- if ( ! ( data && data.silent ) ) {
308
- $c.slider( 'value', parseFloat( $input.val() ) );
309
- }
310
- });
311
- });
312
-
313
- ///////////////////////////////////////
314
- // Setup the URL fields
315
-
316
- $fields.filter('.siteorigin-widget-field-type-link').each(function () {
317
- var $$ = $(this);
318
-
319
- // Function that refreshes the list of
320
- var request = null;
321
- var refreshList = function () {
322
- if (request !== null) {
323
- request.abort();
324
- }
325
-
326
- var $contentSearchInput = $$.find('.content-text-search');
327
- var query = $contentSearchInput.val();
328
- var postTypes = $contentSearchInput.data('postTypes');
329
-
330
- var $ul = $$.find('ul.posts').empty().addClass('loading');
331
- $.get(
332
- soWidgets.ajaxurl,
333
- {action: 'so_widgets_search_posts', query: query, postTypes: postTypes},
334
- function (data) {
335
- for (var i = 0; i < data.length; i++) {
336
- if (data[i].label === '') {
337
- data[i].label = '&nbsp;';
338
- }
339
-
340
- // Add all the post items
341
- $ul.append(
342
- $('<li>')
343
- .addClass('post')
344
- .html(data[i].label + '<span>(' + data[i].type + ')</span>')
345
- .data(data[i])
346
- );
347
- }
348
- $ul.removeClass('loading');
349
- }
350
- );
351
- };
352
-
353
- // Toggle display of the existing content
354
- $$.find('.select-content-button, .button-close').click(function (e) {
355
- e.preventDefault();
356
-
357
- $(this).blur();
358
- var $s = $$.find('.existing-content-selector');
359
- $s.toggle();
360
-
361
- if ($s.is(':visible') && $s.find('ul.posts li').length === 0) {
362
- refreshList();
363
- }
364
-
365
- });
366
-
367
- // Clicking on one of the url items
368
- $$.on('click', '.posts li', function (e) {
369
- e.preventDefault();
370
- var $li = $(this);
371
- $$.find('input.siteorigin-widget-input').val('post: ' + $li.data('value'));
372
- $$.change();
373
- $$.find('.existing-content-selector').toggle();
374
- });
375
-
376
- var interval = null;
377
- $$.find('.content-text-search').keyup(function () {
378
- if (interval !== null) {
379
- clearTimeout(interval);
380
- }
381
-
382
- interval = setTimeout(function () {
383
- refreshList();
384
- }, 500);
385
- });
386
- });
387
-
388
- ///////////////////////////////////////
389
- // Setup the Builder fields
390
- if (typeof jQuery.fn.soPanelsSetupBuilderWidget !== 'undefined') {
391
- $fields.filter('.siteorigin-widget-field-type-builder').each(function () {
392
- $( this ).find( '> .siteorigin-page-builder-field' ).each( function () {
393
- var $$ = $( this );
394
- $$.soPanelsSetupBuilderWidget( { builderType: $$.data( 'type' ) } );
395
- } );
396
- });
397
- }
398
-
399
- ///////////////////////////////////////
400
- // Now lets handle the state emitters
401
-
402
- var stateEmitterChangeHandler = function () {
403
- var $$ = $(this);
404
-
405
- // These emitters can either be an array or a
406
- var emitters = $$.closest('[data-state-emitter]').data('state-emitter');
407
-
408
- if (typeof emitters !== 'undefined') {
409
- var handleStateEmitter = function (emitter, currentStates) {
410
- if (typeof sowEmitters[emitter.callback] === 'undefined' || emitter.callback.substr(0, 1) === '_') {
411
- // Skip if the function doesn't exist, or it starts with an underscore (internal functions).
412
- return currentStates;
413
- }
414
-
415
- // Skip if this is an unselected radio input.
416
- if ( $$.is( '[type="radio"]' ) && !$$.is( ':checked' ) ) {
417
- return currentStates;
418
- }
419
-
420
- // Check if this is inside a repeater
421
- var repeaterIndex = sowbForms.getContainerFieldId( $$, 'repeater', '.siteorigin-widget-field-repeater-item' );
422
- if (repeaterIndex !== false) {
423
- emitter.args = emitter.args.map(function (a) {
424
- return a.replace('{$repeater}', repeaterIndex);
425
- });
426
- }
427
-
428
- var widgetFieldId = sowbForms.getContainerFieldId( $$, 'widget', '.siteorigin-widget-widget' );
429
- if ( widgetFieldId !== false && ! emitter.hasOwnProperty( 'widgetFieldId' ) ) {
430
- emitter.widgetFieldId = widgetFieldId;
431
- emitter.args = emitter.args.map(function (arg) {
432
- if ( emitter.callback === 'conditional' ) {
433
- arg = arg.replace( /(.*)(\[.*)/, '$1_' + widgetFieldId + '$2' );
434
- } else {
435
- arg = arg + '_' + widgetFieldId;
436
- }
437
- return arg;
438
- });
439
- }
440
-
441
- var val = $$.is('[type="checkbox"]') ? $$.is(':checked') : $$.val();
442
- // Return an array that has the new states added to the array
443
- return $.extend(currentStates, sowEmitters[emitter.callback](val, emitter.args));
444
- };
445
-
446
- // Run the states through the state emitters
447
- var states = {'default': ''};
448
-
449
- // Go through the array of emitters
450
- if (typeof emitters.length === 'undefined') {
451
- emitters = [emitters];
452
- }
453
-
454
- for (var i = 0; i < emitters.length; i++) {
455
- states = handleStateEmitter(emitters[i], states);
456
- }
457
-
458
- // Check which states have changed and trigger appropriate sowstatechange
459
- var formStates = $mainForm.data('states');
460
- if (typeof formStates === 'undefined') {
461
- formStates = {'default': ''};
462
- }
463
- for (var k in states) {
464
- if ( typeof formStates[k] === 'undefined' || states[k] !== formStates[k] ) {
465
- // If the state is different from the original formStates, then trigger a state change
466
- formStates[k] = states[k];
467
- $mainForm.trigger('sowstatechange', [k, states[k]]);
468
- }
469
- }
470
-
471
- // Store the form states back in the form
472
- $mainForm.data('states', formStates);
473
- }
474
- };
475
-
476
- $fields.filter('[data-state-emitter]').each(function () {
477
-
478
- var $input = $( this ).find( '.siteorigin-widget-input' );
479
-
480
- // Listen for any change events on an emitter field
481
- $input.on('keyup change', stateEmitterChangeHandler);
482
-
483
- // Trigger initial state emitter changes
484
- $input.each(function () {
485
- var $$ = $(this);
486
- if ($$.is(':radio')) {
487
- // Only checked radio inputs must have change events
488
- if ($$.is(':checked')) {
489
- stateEmitterChangeHandler.call($$[0]);
490
- }
491
- }
492
- else {
493
- stateEmitterChangeHandler.call($$[0]);
494
- }
495
- });
496
-
497
- });
498
-
499
- // Give plugins a chance to influence the form
500
- $el.trigger('sowsetupform', $fields).data('sow-form-setup', true);
501
-
502
- $fields.trigger('sowsetupformfield');
503
-
504
- $el.find('.siteorigin-widget-field-repeater-item').trigger('updateFieldPositions');
505
-
506
- if ( $body.hasClass( 'wp-customizer' ) || $body.hasClass( 'widgets-php' ) ) {
507
- // Reinitialize widget fields when they're dragged and dropped.
508
- $el.closest( '.ui-sortable' ).on( 'sortstop', function (event, ui) {
509
- var $fields = ui.item.find( '.siteorigin-widget-form' ).find( '> .siteorigin-widget-field' );
510
- $fields.trigger( 'sowsetupformfield' );
511
- } );
512
- }
513
-
514
- /////////////////////////////
515
- // The end of the form setup.
516
- /////////////////////////////
517
-
518
- formInitializing = false;
519
- });
520
- };
521
-
522
- $.fn.sowSetupPreview = function () {
523
- var $el = $(this);
524
- var previewButton = $el.siblings('.siteorigin-widget-preview');
525
-
526
- previewButton.find('> a').click(function (e) {
527
- e.preventDefault();
528
-
529
- var data = sowbForms.getWidgetFormValues($el);
530
-
531
- // Create a new modal window
532
- var modal = $($('#so-widgets-bundle-tpl-preview-dialog').html().trim()).appendTo('body');
533
- modal.find('input[name="data"]').val(JSON.stringify(data));
534
- modal.find('input[name="class"]').val($el.data('class'));
535
- modal.find('iframe').on('load', function () {
536
- $(this).css('visibility', 'visible');
537
- });
538
- modal.find('form').submit();
539
-
540
- modal.find('.close').click(function () {
541
- modal.remove();
542
- });
543
- });
544
- };
545
-
546
- $.fn.sowSetupRepeater = function () {
547
-
548
- return $(this).each(function (i, el) {
549
- var $el = $(el);
550
- var $items = $el.find('.siteorigin-widget-field-repeater-items');
551
- var name = $el.data('repeater-name');
552
-
553
- $items.bind('updateFieldPositions', function () {
554
- var $$ = $(this);
555
- var $rptrItems = $$.find('> .siteorigin-widget-field-repeater-item');
556
-
557
- // Set the position for the repeater items
558
- $rptrItems.each(function (i, el) {
559
- $(el).find('.siteorigin-widget-input').each(function (j, input) {
560
- var pos = $(input).data('repeater-positions');
561
- if (typeof pos === 'undefined') {
562
- pos = {};
563
- }
564
-
565
- pos[name] = i;
566
- $(input).data('repeater-positions', pos);
567
- });
568
- });
569
-
570
- // Update the field names for all the input items
571
- $$.find('.siteorigin-widget-input').each( function ( i, input ) {
572
- var $in = $( input );
573
- var pos = $in.data( 'repeater-positions' );
574
-
575
- if ( typeof pos !== 'undefined' ) {
576
- var newName = $in.attr( 'data-original-name' );
577
-
578
- if ( !newName ) {
579
- $in.attr( 'data-original-name', $in.attr( 'name' ) );
580
- newName = $in.attr( 'name' );
581
- }
582
- if ( !newName ) {
583
- return;
584
- }
585
-
586
- if ( pos ) {
587
- for ( var k in pos ) {
588
- newName = newName.replace( '#' + k + '#', pos[ k ] );
589
- }
590
- }
591
- $in.attr( 'name', newName );
592
- }
593
- } );
594
-
595
- if ( !$$.data( 'initialSetup' ) ) {
596
- // Setup default checked values, now that we've updated input names.
597
- // Without this radio inputs in repeaters will be rendered as if they all belong to the same group.
598
- $$.find('.siteorigin-widget-input').each(function (i, input) {
599
- var $in = $(input);
600
- $in.prop('checked', $in.prop('defaultChecked'));
601
- });
602
- $$.data('initialSetup', true);
603
- }
604
-
605
- //Setup scrolling.
606
- var scrollCount = $el.data('scroll-count') ? parseInt($el.data('scroll-count')) : 0;
607
- if (scrollCount > 0 && $rptrItems.length > scrollCount) {
608
- var itemHeight = $rptrItems.first().outerHeight();
609
- $$.css('max-height', itemHeight * scrollCount).css('overflow', 'auto');
610
- }
611
- else {
612
- //TODO: Check whether there was a value before overriding and set it back to that.
613
- $$.css('max-height', '').css('overflow', '');
614
- }
615
- });
616
-
617
- $items.sortable({
618
- handle: '.siteorigin-widget-field-repeater-item-top',
619
- items: '> .siteorigin-widget-field-repeater-item',
620
- update: function () {
621
- // Clear `name` attributes for radio inputs. They'll be reassigned on update.
622
- // This prevents some radio inputs values being cleared during the update process.
623
- $items.find( 'input[type="radio"].siteorigin-widget-input' ).attr( 'name', '' );
624
- $items.trigger('updateFieldPositions');
625
- $el.trigger( 'change' );
626
- },
627
- sortstop: function (event, ui) {
628
- if ( ui.item.is( '.siteorigin-widget-field-repeater-item' ) ) {
629
- ui.item.find( '> .siteorigin-widget-field-repeater-item-form' ).each( function () {
630
- var $fields = $( this ).find( '> .siteorigin-widget-field' );
631
- $fields.trigger( 'sowsetupformfield' );
632
- } );
633
- }
634
- else {
635
- var $fields = ui.item.find( '.siteorigin-widget-form' ).find( '> .siteorigin-widget-field' );
636
- $fields.trigger( 'sowsetupformfield' );
637
- }
638
- $el.trigger( 'change' );
639
- }
640
- });
641
- $items.trigger('updateFieldPositions');
642
-
643
- $el.find('> .siteorigin-widget-field-repeater-add').disableSelection().click(function (e) {
644
- e.preventDefault();
645
- $el.closest('.siteorigin-widget-field-repeater')
646
- .sowAddRepeaterItem()
647
- .find('> .siteorigin-widget-field-repeater-items').slideDown('fast', function () {
648
- $(window).resize();
649
- });
650
- });
651
-
652
- $el.find('> .siteorigin-widget-field-repeater-top > .siteorigin-widget-field-repeater-expand').click(function (e) {
653
- e.preventDefault();
654
- $el.closest('.siteorigin-widget-field-repeater').find('> .siteorigin-widget-field-repeateritems-').slideToggle('fast', function () {
655
- $(window).resize();
656
- });
657
- });
658
- });
659
- };
660
-
661
- $.fn.sowAddRepeaterItem = function () {
662
- return $(this).each(function (i, el) {
663
-
664
- var $el = $(el);
665
- var $nextIndex = $el.find('> .siteorigin-widget-field-repeater-items').children().length + 1;
666
-
667
- // Create an object with the repeater html so we can make some changes to it.
668
- var repeaterObject = $('<div>' + $el.find('> .siteorigin-widget-field-repeater-item-html').html() + '</div>');
669
- repeaterObject.find('.siteorigin-widget-input[data-name]').each(function () {
670
- var $$ = $(this);
671
- // Skip out items that are themselves inside repeater HTML wrappers
672
- if ($$.closest('.siteorigin-widget-field-repeater-item-html').length === 0) {
673
- $$.attr('name', $(this).data('name'));
674
- }
675
- });
676
-
677
- // Replace repeater item id placeholders with the index of the repeater item.
678
- var repeaterHtml = '';
679
- repeaterObject.find( '> .siteorigin-widget-field' )
680
- .each( function ( index, element ) {
681
- var html = element.outerHTML;
682
- // Skip child repeaters, so they can setup their own id's when necessary.
683
- if ( ! $( element ).is( '.siteorigin-widget-field-type-repeater' ) ) {
684
- html = html.replace( /_id_/g, $nextIndex );
685
- }
686
- repeaterHtml += html;
687
- } );
688
-
689
- var readonly = typeof $el.attr('readonly') !== 'undefined';
690
- var item = $('<div class="siteorigin-widget-field-repeater-item ui-draggable" />')
691
- .append(
692
- $('<div class="siteorigin-widget-field-repeater-item-top" />')
693
- .append(
694
- $('<div class="siteorigin-widget-field-expand" />')
695
- )
696
- .append(
697
- readonly ? '' : $('<div class="siteorigin-widget-field-copy" />')
698
- )
699
- .append(
700
- readonly ? '' : $('<div class="siteorigin-widget-field-remove" />')
701
- )
702
- .append($('<h4 />').html($el.data('item-name')))
703
- )
704
- .append(
705
- $('<div class="siteorigin-widget-field-repeater-item-form" />')
706
- .html(repeaterHtml)
707
- );
708
-
709
- // Add the item and refresh
710
- $el.find('> .siteorigin-widget-field-repeater-items').append(item).sortable("refresh").trigger('updateFieldPositions');
711
- item.sowSetupRepeaterItems();
712
- item.hide().slideDown('fast', function () {
713
- $(window).resize();
714
- });
715
- $el.trigger( 'change' );
716
- });
717
- };
718
-
719
- $.fn.sowRemoveRepeaterItem = function () {
720
- return $(this).each(function (i, el) {
721
- var $itemsContainer = $(this).closest('.siteorigin-widget-field-repeater-items');
722
- $(this).remove();
723
- $itemsContainer.sortable("refresh").trigger('updateFieldPositions');
724
- $( el ).trigger( 'change' );
725
- });
726
- };
727
-
728
- $.fn.sowSetupRepeaterItems = function () {
729
- return $(this).each(function (i, el) {
730
- var $el = $(el);
731
-
732
- if (typeof $el.data('sowrepeater-actions-setup') === 'undefined') {
733
- var $parentRepeater = $el.closest('.siteorigin-widget-field-repeater');
734
- var itemTop = $el.find('> .siteorigin-widget-field-repeater-item-top');
735
- var itemLabel = $parentRepeater.data('item-label');
736
- if (itemLabel && itemLabel.selector) {
737
- var updateLabel = function () {
738
- var functionName = ( itemLabel.hasOwnProperty('valueMethod') && itemLabel.valueMethod ) ? itemLabel.valueMethod : 'val';
739
- var txt = $el.find(itemLabel.selector)[functionName]();
740
- if (txt) {
741
- if (txt.length > 80) {
742
- txt = txt.substr(0, 79) + '...';
743
- }
744
- itemTop.find('h4').text(txt);
745
- }
746
- };
747
- updateLabel();
748
- var eventName = ( itemLabel.hasOwnProperty('updateEvent') && itemLabel.updateEvent ) ? itemLabel.updateEvent : 'change';
749
- $el.bind(eventName, updateLabel);
750
- }
751
-
752
- itemTop.click(function (e) {
753
- if (e.target.className === "siteorigin-widget-field-remove" || e.target.className === "siteorigin-widget-field-copy") {
754
- return;
755
- }
756
- e.preventDefault();
757
- $(this).closest('.siteorigin-widget-field-repeater-item').find('.siteorigin-widget-field-repeater-item-form').eq(0).slideToggle('fast', function () {
758
- $(window).resize();
759
- if ($(this).is(':visible')) {
760
- $(this).trigger('slideToggleOpenComplete');
761
-
762
- $( this ).find( '.siteorigin-widget-field-type-section > .siteorigin-widget-section > .siteorigin-widget-field,> .siteorigin-widget-field' )
763
- .each( function (index, element) {
764
- var $field = $( element );
765
- if ( $field.is( ':visible' ) ) {
766
- $field.trigger( 'sowsetupformfield' );
767
- }
768
-
769
- } );
770
- }
771
- else {
772
- $(this).trigger('slideToggleCloseComplete');
773
- }
774
- });
775
- });
776
-
777
- itemTop.find('.siteorigin-widget-field-remove').click(function (e, params) {
778
- e.preventDefault();
779
- var $s = $( this ).closest( '.siteorigin-widget-field-repeater-items' );
780
- var $item = $( this ).closest( '.siteorigin-widget-field-repeater-item' );
781
- var removeItem = function () {
782
- $item.remove();
783
- $s.sortable( "refresh" ).trigger( 'updateFieldPositions' );
784
- $( window ).resize();
785
- };
786
- if ( params && params.silent ) {
787
- removeItem();
788
- } else if ( confirm( soWidgets.sure ) ) {
789
- $item.slideUp('fast', removeItem );
790
- }
791
- $el.trigger( 'change' );
792
- });
793
- itemTop.find('.siteorigin-widget-field-copy').click(function (e) {
794
- e.preventDefault();
795
- var $form = $(this).closest('.siteorigin-widget-form-main');
796
- var $item = $(this).closest('.siteorigin-widget-field-repeater-item');
797
- var $copyItem = $item.clone();
798
- var $items = $item.closest('.siteorigin-widget-field-repeater-items');
799
- //var $nextIndex = $item.index()+1;
800
- var $nextIndex = $items.children().length;
801
- var newIds = {};
802
-
803
- $copyItem.find('*[name]').each(function () {
804
- var $inputElement = $(this);
805
- var id = $inputElement.attr('id');
806
- var nm = $inputElement.attr('name');
807
- // TinyMCE field :/
808
- if ($inputElement.is('textarea') && $inputElement.parent().is('.wp-editor-container') && typeof tinymce != 'undefined') {
809
- $inputElement.parent().empty().append($inputElement);
810
- $inputElement.css('display', '');
811
- var curEd = tinymce.get(id);
812
- if (curEd) {
813
- $inputElement.val(curEd.getContent());
814
- }
815
- }
816
- // Color field :/
817
- else if ($inputElement.is('.wp-color-picker')) {
818
- var $wpPickerContainer = $inputElement.closest('.wp-picker-container');
819
- var $soWidgetField = $inputElement.closest('.siteorigin-widget-field');
820
- $wpPickerContainer.remove();
821
- $soWidgetField.append($inputElement.remove());
822
- }
823
- else {
824
- var $originalInput = id ? $item.find( '#' + id ) : $item.find('[name="' + nm + '"]');
825
- if ($originalInput.length && $originalInput.val() != null) {
826
- $inputElement.val($originalInput.val());
827
- }
828
- }
829
- if (id) {
830
- var idRegExp;
831
- var idBase;
832
- var newId;
833
-
834
- // Radio inputs are slightly different because there are multiple `input` elements for
835
- // a single field, i.e. multiple `inputs` for selecting a single value.
836
- if ($inputElement.is('[type="radio"]')) {
837
- // Radio inputs have their position appended to the id.
838
- idBase = id.replace(/-\d+-\d+$/, '');
839
- var radioIdBase = id.replace(/-\d+$/, '');
840
- if (!newIds[idBase]) {
841
- var radioNames = {};
842
- newIds[idBase] = $form
843
- // find all inputs containing idBase in their id attribute
844
- .find('.siteorigin-widget-input[id^=' + idBase + ']')
845
- // exclude inputs from templates
846
- .not('[id*=_id_]')
847
- // reduce to one element per radio input group.
848
- .filter(function (index, element) {
849
- var eltName = $(element).attr('name');
850
- if (radioNames[eltName]) {
851
- return false;
852
- } else {
853
- radioNames[eltName] = true;
854
- return true;
855
- }
856
- }).length + 1;
857
- }
858
- var newRadioIdBase = idBase + '-' + newIds[idBase];
859
- newId = newRadioIdBase + id.match(/-\d+$/)[0];
860
- $copyItem.find('label[for=' + radioIdBase + ']').attr('for', newRadioIdBase);
861
- } else {
862
- idRegExp = new RegExp('-\\d+$');
863
- idBase = id.replace(idRegExp, '');
864
- if (!newIds[idBase]) {
865
- newIds[idBase] = $form.find('.siteorigin-widget-input[id^=' + idBase + ']').not('[id*=_id_]').length + 1;
866
- }
867
- newId = idBase + '-' + newIds[idBase]++;
868
- }
869
-
870
- $inputElement.attr('id', newId);
871
- if ( $inputElement.is( '.wp-editor-area' ) ) {
872
- var tmceContainer = $inputElement.closest( '.siteorigin-widget-tinymce-container' );
873
- var mediaButtons = tmceContainer.data( 'media-buttons' );
874
- if ( mediaButtons && mediaButtons.html ) {
875
- var idRegExp = new RegExp( id, 'g');
876
- mediaButtons.html = mediaButtons.html.replace( idRegExp, newId );
877
- tmceContainer.data( 'media-buttons', mediaButtons );
878
- }
879
- }
880
- $copyItem.find('label[for=' + id + ']').attr('for', newId);
881
- $copyItem.find('[id*=' + id + ']').each(function () {
882
- var oldIdAttr = $(this).attr('id');
883
- var newIdAttr = oldIdAttr.replace(id, newId);
884
- $(this).attr('id', newIdAttr);
885
- });
886
- if (typeof tinymce !== 'undefined' && tinymce.get(newId)) {
887
- tinymce.get(newId).remove();
888
- }
889
- }
890
- var nestLevel = $item.parents('.siteorigin-widget-field-repeater').length;
891
- var $body = $('body');
892
- if (($body.hasClass('wp-customizer') || $body.hasClass('widgets-php')) && $el.closest('.panel-dialog').length === 0) {
893
- nestLevel += 1;
894
- }
895
- var newName = nm.replace(new RegExp('((?:.*?\\[\\d+\\]){' + (nestLevel - 1).toString() + '})?(.*?\\[)\\d+(\\])'), '$1$2' + $nextIndex.toString() + '$3');
896
- $inputElement.attr('name', newName);
897
- $inputElement.data('original-name', newName);
898
- });
899
-
900
- //$item.after($copyItem);
901
- //$items.sortable( "refresh").trigger('updateFieldPositions');
902
- $items.append($copyItem).sortable("refresh").trigger('updateFieldPositions');
903
- $copyItem.sowSetupRepeaterItems();
904
- $copyItem.hide().slideDown('fast', function () {
905
- $(window).resize();
906
- });
907
- $el.trigger( 'change' );
908
- });
909
-
910
- $el.find('> .siteorigin-widget-field-repeater-item-form').sowSetupForm();
911
-
912
- $el.data('sowrepeater-actions-setup', true);
913
- }
914
- });
915
- };
916
-
917
- // Widgets Bundle utility functions
918
- /**
919
- * Get the unique index of a repeated item. Could be in a repeater or if multiple widget fields with the same
920
- * widget class.
921
- *
922
- * @param $el
923
- * @param containerType
924
- * @param containerClass
925
- * @return {*}
926
- */
927
- sowbForms.getContainerFieldId = function ( $el, containerType, containerClass ) {
928
- var fieldIdPropName = containerType + 'FieldId';
929
- if ( ! this.hasOwnProperty( fieldIdPropName ) ) {
930
- this[ fieldIdPropName ] = 1;
931
- }
932
-
933
- var $field = $el.closest( containerClass );
934
- if ( $field.length ) {
935
- var fieldId = $field.data( 'field-id' );
936
- if ( fieldId === undefined ) {
937
- fieldId = this[ fieldIdPropName ]++;
938
- }
939
- $field.data( 'field-id', fieldId );
940
-
941
- return fieldId;
942
- }
943
- else {
944
- return false;
945
- }
946
- };
947
-
948
- /**
949
- * Retrieve a variable for a field with the given identifier, elementName.
950
- *
951
- * @return {*}
952
- * @param widgetClass The class name of the widget for which to retrieve a variable.
953
- * @param elementName The name of the field for which to retrieve a variable.
954
- * @param key The name of the variable to retrieve.
955
- */
956
- sowbForms.getWidgetFieldVariable = function (widgetClass, elementName, key) {
957
- var widgetVars = window.sow_field_javascript_variables[widgetClass];
958
- // Get rid of any index placeholders
959
- elementName = elementName.replace(/\[#.*?#\]/g, '');
960
- var variablePath = /[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(elementName)[1];
961
- var variablePathParts = variablePath.split('][');
962
- var elementVars = variablePathParts.length ? widgetVars : null;
963
- while (variablePathParts.length) {
964
- elementVars = elementVars[variablePathParts.shift()];
965
- }
966
- return elementVars[key];
967
- };
968
-
969
- sowbForms.fetchWidgetVariable = function (key, widget, callback) {
970
- window.sowVars = window.sowVars || {};
971
-
972
- if (typeof window.sowVars[widget] === 'undefined') {
973
- $.post(
974
- soWidgets.ajaxurl,
975
- {'action': 'sow_get_javascript_variables', 'widget': widget, 'key': key},
976
- function (result) {
977
- window.sowVars[widget] = result;
978
- callback(window.sowVars[widget][key]);
979
- }
980
- );
981
- }
982
- else {
983
- callback(window.sowVars[widget][key]);
984
- }
985
- };
986
-
987
- sowbForms.getWidgetIdBase = function ( formContainer ) {
988
- return formContainer.data( 'id-base' );
989
- };
990
-
991
- sowbForms.getWidgetFormValues = function ( formContainer ) {
992
-
993
- if ( _.isUndefined( formContainer ) ) {
994
- return null;
995
- }
996
-
997
- var data = {};
998
-
999
- formContainer.find('*[name]').each(function () {
1000
- var $$ = $(this);
1001
-
1002
- try {
1003
- var name = /[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec( $$.attr( 'name' ) );
1004
-
1005
- if ( _.isEmpty( name ) ) {
1006
- return true;
1007
- }
1008
-
1009
- // Create an array with the parts of the name
1010
- name = name[1];
1011
- var parts = name.split( '][' );
1012
-
1013
- // Make sure we either have numbers or strings
1014
- parts = parts.map( function ( e ) {
1015
- if ( ! isNaN( parseFloat( e ) ) && isFinite( e ) ) {
1016
- return parseInt( e );
1017
- }
1018
- else {
1019
- return e;
1020
- }
1021
- } );
1022
-
1023
- var sub = data;
1024
- var fieldValue = null;
1025
-
1026
- var fieldType = _.isString( $$.attr( 'type' ) ) ? $$.attr( 'type' ).toLowerCase() : null;
1027
-
1028
- if ( fieldType === 'checkbox' ) {
1029
- if ( $$.is( ':checked' ) ) {
1030
- fieldValue = $$.val() !== '' ? $$.val() : true;
1031
- } else {
1032
- fieldValue = false;
1033
- }
1034
- } else if ( fieldType === 'radio' ) {
1035
- if ( $$.is( ':checked' ) ) {
1036
- fieldValue = $$.val();
1037
- } else {
1038
- return;
1039
- }
1040
- } else if ( $$.prop( 'tagName' ) === 'TEXTAREA' && $$.hasClass( 'wp-editor-area' ) ) {
1041
- // This is a TinyMCE editor, so we'll use the tinyMCE object to get the content
1042
- var editor = null;
1043
- if ( typeof tinyMCE !== 'undefined' ) {
1044
- editor = tinyMCE.get( $$.attr( 'id' ) );
1045
- }
1046
-
1047
- if ( editor !== null && typeof( editor.getContent ) === "function" && !editor.isHidden() ) {
1048
- fieldValue = editor.getContent();
1049
- }
1050
- else {
1051
- fieldValue = $$.val();
1052
- }
1053
- } else if ( $$.prop( 'tagName' ) === 'SELECT' ) {
1054
- var selected = $$.find( 'option:selected' );
1055
- if ( selected.length === 1 ) {
1056
- fieldValue = $$.find( 'option:selected' ).val();
1057
- }
1058
- else if ( selected.length > 1 ) {
1059
- // This is a mutli-select field
1060
- fieldValue = _.map( $$.find( 'option:selected' ), function ( n, i ) {
1061
- return $( n ).val();
1062
- } );
1063
- }
1064
- } else {
1065
- fieldValue = $$.val();
1066
- }
1067
- for ( var i = 0; i < parts.length; i++ ) {
1068
- if ( i === parts.length - 1 ) {
1069
- if ( parts[i] === '' ) {
1070
- // This needs to be an array
1071
- sub.push( fieldValue );
1072
- } else {
1073
- sub[ parts[ i ] ] = fieldValue;
1074
- }
1075
- }
1076
- else {
1077
- if ( _.isUndefined( sub[ parts[ i ] ] ) ) {
1078
- // We assume that a numeric key means it's an array. (or empty string??)
1079
- if ( _.isNumber( parts[ i + 1 ] ) || parts[ i + 1 ] === '' ) {
1080
- sub[ parts[ i ] ] = [];
1081
- } else {
1082
- sub[ parts[ i ] ] = {};
1083
- }
1084
- }
1085
- // Go deeper into the data and continue
1086
- sub = sub[ parts[ i ] ];
1087
- }
1088
- }
1089
- } catch ( error ) {
1090
- console.error( 'Field [' + $$.attr( 'name' ) + '] could not be processed and was skipped - ' + error.message );
1091
- }
1092
- });
1093
- return data;
1094
- };
1095
-
1096
-
1097
- /**
1098
- * Sets all the widget form fields in the given container with the given data values.
1099
- *
1100
- * @param formContainer The jQuery element containing the widget form fields.
1101
- * @param data The data from which to set the widget form field values.
1102
- * @param skipMissingValues If `true`, this will skip form fields for which the data values are missing.
1103
- * If `false`, the form fields will be cleared. Default is `false`.
1104
- * @param triggerChange If `true`, trigger a 'change' event on each element after it's value is set. Default is `true`.
1105
- */
1106
- sowbForms.setWidgetFormValues = function (formContainer, data, skipMissingValues, triggerChange) {
1107
- skipMissingValues = skipMissingValues || false;
1108
- triggerChange = (typeof triggerChange !== 'undefined' && triggerChange) || typeof triggerChange === 'undefined';
1109
- // First check if this form has any repeaters.
1110
- var depth = 0;
1111
- var updateRepeaterChildren = function ( formParent, formData ) {
1112
- if ( ++depth === 10 ) {
1113
- --depth;
1114
- return;
1115
- }
1116
- // Only direct child fields which are repeaters.
1117
- formParent.find( '> .siteorigin-widget-field-type-repeater,> .siteorigin-widget-field-type-section > .siteorigin-widget-section > .siteorigin-widget-field-type-repeater' )
1118
- .each( function ( index, element ) {
1119
- var $this = $( this );
1120
- var $repeater = $this.find( '> .siteorigin-widget-field-repeater' );
1121
- var repeaterName = $repeater.data( 'repeaterName' );
1122
- var repeaterData = formData.hasOwnProperty( repeaterName ) ? formData[ repeaterName ] : null;
1123
- var isInSection = $this.parent().is( '.siteorigin-widget-section' );
1124
- if ( isInSection ) {
1125
- var elementName = $repeater.data( 'element-name' );
1126
- // Get rid of any index placeholders
1127
- elementName = elementName.replace(/\[#.*?#\]/g, '');
1128
- var variablePath = /[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(elementName)[1];
1129
- var variablePathParts = variablePath.split('][');
1130
- var elementVars = variablePathParts.length ? formData : null;
1131
- while (variablePathParts.length) {
1132
- var key = variablePathParts.shift();
1133
- elementVars = elementVars.hasOwnProperty( key ) ? elementVars[ key ] : elementVars;
1134
- }
1135
- repeaterData = elementVars;
1136
- }
1137
-
1138
- if ( ! repeaterData || ! Array.isArray( repeaterData ) ) {
1139
- return;
1140
- }
1141
- // Check that the number of child items matches the number of data items.
1142
- var repeaterChildren = $repeater.find( '> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item' );
1143
- var numItems = repeaterData.length;
1144
- var numChildren = repeaterChildren.length;
1145
- if ( numItems > numChildren ) {
1146
- // If data items > child items, create extra child items.
1147
- for ( var i = 0; i < numItems - numChildren; i++) {
1148
- $repeater.find( '> .siteorigin-widget-field-repeater-add' ).click();
1149
- }
1150
-
1151
- } else if ( ! skipMissingValues && numItems < numChildren ) {
1152
- // If child items > data items, remove extra child items.
1153
- for ( var j = numItems; j < numChildren; j++) {
1154
- var $child = $( repeaterChildren.eq( j ) );
1155
- $child.find( '> .siteorigin-widget-field-repeater-item-top' )
1156
- .find( '.siteorigin-widget-field-remove' )
1157
- .trigger( 'click', { silent: true } );
1158
- }
1159
- }
1160
- repeaterChildren = $repeater.find( '> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item' );
1161
- for ( var k = 0; k < repeaterChildren.length; k++ ) {
1162
- repeaterChildren.eq( k ).find( '> .siteorigin-widget-field-repeater-item-form' );
1163
- updateRepeaterChildren(
1164
- repeaterChildren.eq( k ).find( '> .siteorigin-widget-field-repeater-item-form' ),
1165
- repeaterData[ k ]
1166
- );
1167
- }
1168
- } );
1169
- --depth;
1170
- };
1171
-
1172
- updateRepeaterChildren(formContainer, data);
1173
-
1174
- formContainer.find('*[name]').each(function () {
1175
- var $$ = $(this);
1176
- var name = /[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec($$.attr('name'));
1177
-
1178
- if ( name === undefined || name === null ) {
1179
- return true;
1180
- }
1181
-
1182
- name = name[1];
1183
- var parts = name.split('][');
1184
-
1185
- // Make sure we either have numbers or strings
1186
- parts = parts.map( function ( e ) {
1187
- if ( !isNaN( parseFloat( e ) ) && isFinite( e ) ) {
1188
- return parseInt( e );
1189
- } else {
1190
- return e;
1191
- }
1192
- } );
1193
-
1194
- var sub = data;
1195
- var value;
1196
- for (var i = 0; i < parts.length; i++) {
1197
- // If the field is missing from the data, just leave `value` as `undefined`.
1198
- if ( ! sub.hasOwnProperty( parts[ i ] ) ) {
1199
- if ( skipMissingValues ) {
1200
- return true;
1201
- } else {
1202
- break;
1203
- }
1204
- }
1205
- if (i === parts.length - 1) {
1206
- value = sub[ parts[ i ] ];
1207
- } else {
1208
- sub = sub[ parts[ i ] ];
1209
- }
1210
- }
1211
-
1212
- // This is the end, so we need to set the value on the field here.
1213
- if ( $$.attr( 'type' ) === 'checkbox' ) {
1214
- $$.prop( 'checked', value );
1215
- } else if ( $$.attr( 'type' ) === 'radio' ) {
1216
- $$.prop( 'checked', value === $$.val() );
1217
- } else if ( $$.prop( 'tagName' ) === 'TEXTAREA' && $$.hasClass( 'wp-editor-area' ) ) {
1218
- // This is a TinyMCE editor, so we'll use the tinyMCE object to get the content
1219
- var editor = null;
1220
- if ( typeof tinyMCE !== 'undefined' ) {
1221
- editor = tinyMCE.get( $$.attr( 'id' ) );
1222
- }
1223
-
1224
- if ( editor !== null && typeof( editor.setContent ) === "function" && ! editor.isHidden() && $$.parent().is( ':visible' ) ) {
1225
- if ( editor.initialized ) {
1226
- editor.setContent( value );
1227
- } else {
1228
- editor.on('init', function () {
1229
- editor.setContent( value );
1230
- });
1231
- }
1232
- }
1233
- else {
1234
- $$.val( value );
1235
- }
1236
- } else if ( $$.is( '.panels-data' ) ) {
1237
- $$.val( value );
1238
- var builder = $$.data( 'builder' );
1239
- if ( builder ) {
1240
- builder.setDataField( $$ );
1241
- }
1242
- } else {
1243
- $$.val( value );
1244
- }
1245
-
1246
- if ( triggerChange ) {
1247
- $$.trigger( 'change' );
1248
- }
1249
- });
1250
- };
1251
-
1252
-
1253
- /**
1254
- * Displays an informational notice either at the top of the supplied container, or above the optionally supplied
1255
- * element.
1256
- *
1257
- * @param $container The jQuery container in which the notice will be prepended.
1258
- * @param title The string title for the notice.
1259
- * @param message The string detail message for the notice.
1260
- * @param buttons An array of buttons which will be display along with the notice.
1261
- * @param $element The optional jQuery element before which the notice will be inserted. If this is supplied it
1262
- * will take precedence over the $container argument.
1263
- *
1264
- */
1265
- sowbForms.displayNotice = function ( $container, title, message, buttons, $element ) {
1266
-
1267
- var $notice = $( '<div class="siteorigin-widget-form-notification"></div>' );
1268
- if ( title ) {
1269
- $notice.append( '<span>' + title + '</span>' );
1270
- }
1271
-
1272
- if ( buttons && buttons.length ) {
1273
- buttons.forEach( function ( button ) {
1274
- var buttonClasses = '';
1275
- if ( button.classes && button.classes.length ) {
1276
- buttonClasses = ' ' + button.classes.join( ' ' );
1277
- }
1278
- var $button = $( '<a class="button button-small' + buttonClasses + '">' + button.label + '</a>' );
1279
-
1280
- if ( button.url ) {
1281
- $button.attr( 'href', button.url );
1282
- }
1283
- if ( button.callback ) {
1284
- $button.on( 'click', function () {
1285
- button.callback( $notice );
1286
- });
1287
- }
1288
-
1289
- $notice.append( $button );
1290
- } );
1291
- }
1292
- if ( message ) {
1293
- $notice.append( '<div><small>' + message + '</small></div>' );
1294
- }
1295
-
1296
- if ( $element ) {
1297
- $element.before( $notice );
1298
- } else {
1299
- $container.prepend( $notice );
1300
- }
1301
- };
1302
-
1303
- // When we click on a widget top
1304
- $('.widgets-holder-wrap').on('click', '.widget:has(.siteorigin-widget-form-main) .widget-top', function () {
1305
- var $$ = $(this).closest('.widget').find('.siteorigin-widget-form-main');
1306
- setTimeout(function () {
1307
- $$.sowSetupForm();
1308
- }, 200);
1309
- });
1310
- var $body = $( 'body' );
1311
- if ( $body.hasClass('wp-customizer') ) {
1312
- // Setup new widgets when they're added in the customizer interface
1313
- $(document).on('widget-added', function (e, widget) {
1314
- widget.find('.siteorigin-widget-form').sowSetupForm();
1315
- });
1316
- }
1317
-
1318
- if ( $body.hasClass('block-editor-page') ) {
1319
- // Setup new widgets when they're previewed in the block editor.
1320
- $(document).on('panels_setup_preview', function () {
1321
- $( sowb ).trigger( 'setup_widgets', { preview: true } );
1322
- });
1323
- }
1324
-
1325
- $( document ).on( 'open_dialog', function ( e, dialog ) {
1326
- // When we open a Page Builder edit widget dialog
1327
- if ( dialog.$el.find( '.so-panels-dialog' ).is( '.so-panels-dialog-edit-widget' ) ) {
1328
- var $fields = dialog.$el.find( '.siteorigin-widget-form-main' ).find( '> .siteorigin-widget-field' );
1329
- $fields.trigger( 'sowsetupformfield' );
1330
- }
1331
- });
1332
-
1333
- $(function () {
1334
- $(document).trigger('sowadminloaded');
1335
- });
1336
-
1337
- })(jQuery);
1338
-
1339
- var sowEmitters = {
1340
-
1341
- /**
1342
- * Find the group/state and an extra match part.
1343
- *
1344
- * @param arg
1345
- * @param matchPart
1346
- * @return {*}
1347
- */
1348
- '_match': function (arg, matchPart) {
1349
- if (typeof matchPart === 'undefined') {
1350
- matchPart = '.*';
1351
- }
1352
-
1353
- // Create the regular expression to match the group/state and extra match
1354
- var exp = new RegExp('^([a-zA-Z0-9_-]+)(\\[([a-zA-Z0-9_-]+)\\])? *: *(' + matchPart + ') *$');
1355
- var m = exp.exec(arg);
1356
-
1357
- if (m === null) {
1358
- return false;
1359
- }
1360
-
1361
- var state = '';
1362
- var group = 'default';
1363
-
1364
- if (m[3] !== undefined) {
1365
- group = m[1];
1366
- state = m[3];
1367
- }
1368
- else {
1369
- state = m[1];
1370
- }
1371
-
1372
- return {
1373
- 'match': m[4].trim(),
1374
- 'group': group,
1375
- 'state': state
1376
- };
1377
- },
1378
-
1379
- '_checker': function (val, args, matchPart, callback) {
1380
- var returnStates = {};
1381
- if (typeof args.length === 'undefined') {
1382
- args = [args];
1383
- }
1384
-
1385
- var m;
1386
- for (var i = 0; i < args.length; i++) {
1387
- m = sowEmitters._match(args[i], matchPart);
1388
- if (m === false) {
1389
- continue;
1390
- }
1391
-
1392
- if (m.match === '_true' || callback(val, args, m.match)) {
1393
- returnStates[m.group] = m.state;
1394
- }
1395
- }
1396
-
1397
- return returnStates;
1398
- },
1399
-
1400
- /**
1401
- * A very simple state emitter that simply sets the given group the value
1402
- *
1403
- *
1404
- * @param val
1405
- * @param args
1406
- * @returns {{}}
1407
- */
1408
- 'select': function (val, args) {
1409
- if (typeof args.length === 'undefined') {
1410
- args = [args];
1411
- }
1412
-
1413
- var returnGroups = {};
1414
- for (var i = 0; i < args.length; i++) {
1415
- if (args[i] === '') {
1416
- args[i] = 'default';
1417
- }
1418
- returnGroups[args[i]] = val;
1419
- }
1420
-
1421
- return returnGroups;
1422
- },
1423
-
1424
- /**
1425
- * The conditional state emitter uses eval to check a given conditional argument.
1426
- *
1427
- * @param val
1428
- * @param args
1429
- * @return {{}}
1430
- */
1431
- 'conditional': function (val, args) {
1432
- return sowEmitters._checker(val, args, '[^;{}]*', function (val, args, match) {
1433
- return eval(match);
1434
- });
1435
- },
1436
-
1437
- /**
1438
- * The in state emitter checks if the value is in an array of functions
1439
- *
1440
- * @param val
1441
- * @param args
1442
- * @return {{}}
1443
- */
1444
- 'in': function (val, args) {
1445
- return sowEmitters._checker(val, args, '[^;{}]*', function (val, args, match) {
1446
- return match.split(',').map(function (s) {
1447
- return s.trim();
1448
- }).indexOf(val) !== -1;
1449
- });
1450
- }
1451
- };
1452
-
1453
- window.sowbForms = sowbForms;
 
 
 
1
+ /* globals wp, jQuery, _, soWidgets, confirm, tinymce, sowbForms */
2
+
3
+ var sowbForms = window.sowbForms || {};
4
+
5
+ (function ($) {
6
+
7
+ $.fn.sowSetupForm = function () {
8
+
9
+ return $(this).each(function (i, el) {
10
+ var $el = $(el),
11
+ $mainForm,
12
+ formId,
13
+ formInitializing = true;
14
+
15
+ var $body = $( 'body' );
16
+ // Skip this if the widget has any fields with an __i__
17
+ var $inputs = $el.find('input[name]');
18
+ if ($inputs.length && $inputs.attr('name').indexOf('__i__') !== -1) {
19
+ return this;
20
+ }
21
+
22
+ // Skip this if we've already set up the form
23
+ if ( $el.is('.siteorigin-widget-form-main') ) {
24
+ if ($el.data('sow-form-setup') === true) {
25
+ return true;
26
+ }
27
+ // If we're in the main widgets interface and the form isn't visible and it isn't contained in a
28
+ // panels dialog (when using the Layout Builder widget), don't worry about setting it up.
29
+ if ($body.hasClass('widgets-php') && !$el.is(':visible') && $el.closest('.panel-dialog').length === 0) {
30
+ return true;
31
+ }
32
+
33
+ // Listen for a state change event if this is the main form wrapper
34
+ $el.on('sowstatechange', function (e, incomingGroup, incomingState) {
35
+
36
+ // Find all wrappers that have state handlers on them
37
+ $el.find('[data-state-handler]').each(function () {
38
+ var $$ = $(this);
39
+ // Create a copy of the current state handlers. Add in initial handlers if the form is initializing.
40
+ var handler = $.extend({}, $$.data('state-handler'), formInitializing ? $$.data('state-handler-initial') : {});
41
+ if (Object.keys(handler).length === 0) {
42
+ return true;
43
+ }
44
+
45
+ // We need to figure out what the incoming state is
46
+ var handlerStateParts, handlerState, thisHandler, $$f, runHandler, handlerStateNames;
47
+
48
+ // Indicates if the handler has run
49
+ var handlerRun = {};
50
+
51
+ var repeaterIndex = sowbForms.getContainerFieldId( $$, 'repeater', '.siteorigin-widget-field-repeater-item' );
52
+ if (repeaterIndex !== false) {
53
+ var repeaterHandler = {};
54
+ for ( var rptrState in handler) {
55
+ repeaterHandler[rptrState.replace('{$repeater}', repeaterIndex)] = handler[rptrState];
56
+ }
57
+ handler = repeaterHandler;
58
+ }
59
+
60
+ var widgetFieldId = sowbForms.getContainerFieldId( $$, 'widget', '.siteorigin-widget-widget' );
61
+ if ( widgetFieldId !== false ) {
62
+ var widgetFieldHandler = {};
63
+ for ( var wdgFldState in handler) {
64
+ var stMatches = wdgFldState.match( /_else\[(.*)\]|(.*)\[(.*)\]/ );
65
+ var st = '';
66
+ if ( stMatches && stMatches.length && stMatches[1] === undefined ) {
67
+ st = stMatches[ 2 ] + '_' + widgetFieldId + '[' + stMatches[ 3 ] + ']';
68
+ } else {
69
+ st = '_else[' + stMatches[ 1 ] + '_' + widgetFieldId + ']';
70
+ }
71
+
72
+ widgetFieldHandler[st] = handler[wdgFldState];
73
+ }
74
+ handler = widgetFieldHandler;
75
+ }
76
+
77
+ // Go through all the handlers
78
+ for (var state in handler) {
79
+ runHandler = false;
80
+
81
+ // Parse the handler state parts
82
+ handlerStateParts = state.match(/^([a-zA-Z0-9_-]+)(\[([a-zA-Z0-9_\-,]+)\])?(\[\])?$/);
83
+ if (handlerStateParts === null) {
84
+ // Skip this if there's a problem with the state parts
85
+ continue;
86
+ }
87
+
88
+ handlerState = {
89
+ 'group': 'default',
90
+ 'name': '',
91
+ 'multi': false
92
+ };
93
+
94
+ // Assign the handlerState attributes based on the parsed state
95
+ if (handlerStateParts[2] !== undefined) {
96
+ handlerState.group = handlerStateParts[1];
97
+ handlerState.name = handlerStateParts[3];
98
+ }
99
+ else {
100
+ handlerState.name = handlerStateParts[0];
101
+ }
102
+ handlerState.multi = (handlerStateParts[4] !== undefined);
103
+
104
+ if (handlerState.group === '_else') {
105
+ // This is the special case of an group else handler
106
+ // Always run if no handlers from the current group have been run yet
107
+ handlerState.group = handlerState.name;
108
+ handlerState.name = '';
109
+
110
+ // We will run this handler because none have run for it yet
111
+ runHandler = ( handlerState.group === incomingGroup && typeof handlerRun[handlerState.group] === 'undefined' );
112
+ }
113
+ else {
114
+ // Evaluate if we're in the current state
115
+ handlerStateNames = handlerState.name.split(',').map(function (a) {
116
+ return a.trim()
117
+ });
118
+ for (var i = 0; i < handlerStateNames.length; i++) {
119
+ runHandler = (handlerState.group === incomingGroup && handlerStateNames[i] === incomingState);
120
+ if (runHandler) break;
121
+ }
122
+ }
123
+
124
+ // Run the handler if previous checks have determined we should
125
+ if (runHandler) {
126
+ thisHandler = handler[state];
127
+
128
+ // Now we can handle the the handler
129
+ if (!handlerState.multi) {
130
+ thisHandler = [thisHandler];
131
+ }
132
+
133
+ for (var i = 0; i < thisHandler.length; i++) {
134
+ // Choose the item we'll be acting on here
135
+ if (typeof thisHandler[i][1] !== 'undefined' && Boolean(thisHandler[i][1])) {
136
+ // thisHandler[i][1] is the sub selector
137
+ $$f = $$.find(thisHandler[i][1]);
138
+ }
139
+ else {
140
+ $$f = $$;
141
+ }
142
+
143
+ // Call the function on the wrapper we've selected
144
+ $$f[thisHandler[i][0]].apply($$f, typeof thisHandler[i][2] !== 'undefined' ? thisHandler[i][2] : []);
145
+
146
+ if ( $$f.is( '.siteorigin-widget-field:visible' ) ) {
147
+ if ( $$f.is( '.siteorigin-widget-field-type-section' ) ) {
148
+ var $fields = $$f.find( '> .siteorigin-widget-section > .siteorigin-widget-field' );
149
+ $fields.trigger( 'sowsetupformfield' );
150
+ } else {
151
+ $$f.trigger( 'sowsetupformfield' );
152
+ }
153
+ }
154
+
155
+ }
156
+
157
+ // Store that we've run a handler
158
+ handlerRun[handlerState.group] = true;
159
+ }
160
+ }
161
+
162
+ });
163
+ });
164
+
165
+ // Lets set up the preview
166
+ $el.sowSetupPreview();
167
+ $mainForm = $el;
168
+
169
+ var $teaser = $el.find('.siteorigin-widget-teaser');
170
+ $teaser.find('.dashicons-dismiss').click(function () {
171
+ var $$ = $(this);
172
+ $.get($$.data('dismiss-url'));
173
+
174
+ $teaser.slideUp('normal', function () {
175
+ $teaser.remove();
176
+ });
177
+ });
178
+
179
+
180
+ if ( ! $el.data( 'backupDisabled' ) ) {
181
+ var _sow_form_id = $el.find( '> .siteorigin-widgets-form-id' ).val();
182
+ var $timestampField = $el.find( '> .siteorigin-widgets-form-timestamp' );
183
+ var _sow_form_timestamp = parseInt( $timestampField.val() || 0 );
184
+ var data = JSON.parse( sessionStorage.getItem( _sow_form_id ) );
185
+ if ( data ) {
186
+ if ( data['_sow_form_timestamp'] > _sow_form_timestamp ) {
187
+ sowbForms.displayNotice(
188
+ $el,
189
+ soWidgets.backup.newerVersion,
190
+ soWidgets.backup.replaceWarning,
191
+ [
192
+ {
193
+ label: soWidgets.backup.restore,
194
+ callback: function ( $notice ) {
195
+ sowbForms.setWidgetFormValues( $mainForm, data );
196
+ $notice.slideUp( 'fast', function () {
197
+ $notice.remove();
198
+ } );
199
+ },
200
+ },
201
+ {
202
+ label: soWidgets.backup.dismiss,
203
+ callback: function ( $notice ) {
204
+ $notice.slideUp( 'fast', function () {
205
+ sessionStorage.removeItem( _sow_form_id );
206
+ $notice.remove();
207
+ } );
208
+ },
209
+ },
210
+ ]
211
+ );
212
+ } else {
213
+ sessionStorage.removeItem( _sow_form_id );
214
+ }
215
+ }
216
+ $el.change( function () {
217
+ $timestampField.val( new Date().getTime() );
218
+ var data = sowbForms.getWidgetFormValues( $el );
219
+ sessionStorage.setItem( _sow_form_id, JSON.stringify( data ) );
220
+ } );
221
+ }
222
+ }
223
+ else {
224
+ $mainForm = $el.closest('.siteorigin-widget-form-main');
225
+ }
226
+ formId = $mainForm.find('> .siteorigin-widgets-form-id').val();
227
+
228
+ // Find any field or sub widget fields.
229
+ var $fields = $el.find('> .siteorigin-widget-field');
230
+
231
+ // Process any sub sections
232
+ $fields.find('> .siteorigin-widget-section').sowSetupForm();
233
+
234
+ var $subwidgetFields = $fields.find('> .siteorigin-widget-widget');
235
+ $subwidgetFields.find('> .siteorigin-widget-section').sowSetupForm();
236
+
237
+ // Process any sub widgets whose fields aren't contained in a section
238
+ $subwidgetFields.filter(':not(:has(> .siteorigin-widget-section))').sowSetupForm();
239
+
240
+ // Store the field names
241
+ $fields.find('.siteorigin-widget-input').each(function (i, input) {
242
+ if ($(input).data('original-name') === null) {
243
+ $(input).data('original-name', $(input).attr('name'));
244
+ }
245
+ });
246
+
247
+ // Setup all the repeaters
248
+ $fields.find('> .siteorigin-widget-field-repeater').sowSetupRepeater();
249
+
250
+ // For any repeater items currently in existence
251
+ $el.find('.siteorigin-widget-field-repeater-item').sowSetupRepeaterItems();
252
+
253
+ // Set up any color fields
254
+ $fields.find('> .siteorigin-widget-input-color').each(function () {
255
+ var colorField = $(this);
256
+ var colorFieldOptions = {
257
+ change: function (event, ui) {
258
+ setTimeout(function () {
259
+ $(event.target).trigger('change');
260
+ }, 100);
261
+ }
262
+ };
263
+ if (colorField.data('defaultColor')) {
264
+ colorFieldOptions.defaultColor = colorField.data('defaultColor');
265
+ }
266
+ colorField.wpColorPicker(colorFieldOptions);
267
+ });
268
+
269
+ ///////////////////////////////////////
270
+ // Handle the sections
271
+ var expandContainer = function () {
272
+ $(this).toggleClass('siteorigin-widget-section-visible');
273
+ $(this).parent().find('> .siteorigin-widget-section, > .siteorigin-widget-widget > .siteorigin-widget-section')
274
+ .slideToggle('fast', function () {
275
+ $(window).resize();
276
+ $(this).find('> .siteorigin-widget-field-container-state').val($(this).is(':visible') ? 'open' : 'closed');
277
+
278
+ if ( $( this ).is( ':visible' ) ) {
279
+ var $fields = $( this ).find( '> .siteorigin-widget-field' );
280
+ $fields.trigger( 'sowsetupformfield' );
281
+ }
282
+ } );
283
+ };
284
+ $fields.filter('.siteorigin-widget-field-type-widget, .siteorigin-widget-field-type-section').find('> label').click(expandContainer);
285
+ $fields.filter('.siteorigin-widget-field-type-posts').find('.posts-container-label-wrapper').click(expandContainer);
286
+
287
+ ///////////////////////////////////////
288
+ // Handle the slider fields
289
+
290
+ $fields.filter('.siteorigin-widget-field-type-slider').each(function () {
291
+ var $$ = $(this);
292
+ var $input = $$.find('input[type="number"]');
293
+ var $c = $$.find('.siteorigin-widget-value-slider');
294
+
295
+ $c.slider({
296
+ max: parseFloat($input.attr('max')),
297
+ min: parseFloat($input.attr('min')),
298
+ step: parseFloat($input.attr('step')),
299
+ value: parseFloat($input.val()),
300
+ slide: function (event, ui) {
301
+ $input.val( parseFloat( ui.value ) );
302
+ $input.trigger( 'change' );
303
+ $$.find('.siteorigin-widget-slider-value').html(ui.value);
304
+ },
305
+ });
306
+ $input.change(function(event, data) {
307
+ if ( ! ( data && data.silent ) ) {
308
+ $c.slider( 'value', parseFloat( $input.val() ) );
309
+ }
310
+ });
311
+ });
312
+
313
+ ///////////////////////////////////////
314
+ // Setup the URL fields
315
+
316
+ $fields.filter('.siteorigin-widget-field-type-link').each(function () {
317
+ var $$ = $(this);
318
+
319
+ // Function that refreshes the list of
320
+ var request = null;
321
+ var refreshList = function () {
322
+ if (request !== null) {
323
+ request.abort();
324
+ }
325
+
326
+ var $contentSearchInput = $$.find('.content-text-search');
327
+ var query = $contentSearchInput.val();
328
+ var postTypes = $contentSearchInput.data('postTypes');
329
+
330
+ var $ul = $$.find('ul.posts').empty().addClass('loading');
331
+ $.get(
332
+ soWidgets.ajaxurl,
333
+ {action: 'so_widgets_search_posts', query: query, postTypes: postTypes},
334
+ function (data) {
335
+ for (var i = 0; i < data.length; i++) {
336
+ if (data[i].label === '') {
337
+ data[i].label = '&nbsp;';
338
+ }
339
+
340
+ // Add all the post items
341
+ $ul.append(
342
+ $('<li>')
343
+ .addClass('post')
344
+ .html(data[i].label + '<span>(' + data[i].type + ')</span>')
345
+ .data(data[i])
346
+ );
347
+ }
348
+ $ul.removeClass('loading');
349
+ }
350
+ );
351
+ };
352
+
353
+ // Toggle display of the existing content
354
+ $$.find('.select-content-button, .button-close').click(function (e) {
355
+ e.preventDefault();
356
+
357
+ $(this).blur();
358
+ var $s = $$.find('.existing-content-selector');
359
+ $s.toggle();
360
+
361
+ if ($s.is(':visible') && $s.find('ul.posts li').length === 0) {
362
+ refreshList();
363
+ }
364
+
365
+ });
366
+
367
+ // Clicking on one of the url items
368
+ $$.on('click', '.posts li', function (e) {
369
+ e.preventDefault();
370
+ var $li = $(this);
371
+ $$.find('input.siteorigin-widget-input').val('post: ' + $li.data('value'));
372
+ $$.change();
373
+ $$.find('.existing-content-selector').toggle();
374
+ });
375
+
376
+ var interval = null;
377
+ $$.find('.content-text-search').keyup(function () {
378
+ if (interval !== null) {
379
+ clearTimeout(interval);
380
+ }
381
+
382
+ interval = setTimeout(function () {
383
+ refreshList();
384
+ }, 500);
385
+ });
386
+ });
387
+
388
+ ///////////////////////////////////////
389
+ // Setup the Builder fields
390
+ if (typeof jQuery.fn.soPanelsSetupBuilderWidget !== 'undefined') {
391
+ $fields.filter('.siteorigin-widget-field-type-builder').each(function () {
392
+ $( this ).find( '> .siteorigin-page-builder-field' ).each( function () {
393
+ var $$ = $( this );
394
+ $$.soPanelsSetupBuilderWidget( { builderType: $$.data( 'type' ) } );
395
+ } );
396
+ });
397
+ }
398
+
399
+ ///////////////////////////////////////
400
+ // Now lets handle the state emitters
401
+
402
+ var stateEmitterChangeHandler = function () {
403
+ var $$ = $(this);
404
+
405
+ // These emitters can either be an array or a
406
+ var emitters = $$.closest('[data-state-emitter]').data('state-emitter');
407
+
408
+ if (typeof emitters !== 'undefined') {
409
+ var handleStateEmitter = function (emitter, currentStates) {
410
+ if (typeof sowEmitters[emitter.callback] === 'undefined' || emitter.callback.substr(0, 1) === '_') {
411
+ // Skip if the function doesn't exist, or it starts with an underscore (internal functions).
412
+ return currentStates;
413
+ }
414
+
415
+ // Skip if this is an unselected radio input.
416
+ if ( $$.is( '[type="radio"]' ) && !$$.is( ':checked' ) ) {
417
+ return currentStates;
418
+ }
419
+
420
+ // Check if this is inside a repeater
421
+ var repeaterIndex = sowbForms.getContainerFieldId( $$, 'repeater', '.siteorigin-widget-field-repeater-item' );
422
+ if (repeaterIndex !== false) {
423
+ emitter.args = emitter.args.map(function (a) {
424
+ return a.replace('{$repeater}', repeaterIndex);
425
+ });
426
+ }
427
+
428
+ var widgetFieldId = sowbForms.getContainerFieldId( $$, 'widget', '.siteorigin-widget-widget' );
429
+ if ( widgetFieldId !== false && ! emitter.hasOwnProperty( 'widgetFieldId' ) ) {
430
+ emitter.widgetFieldId = widgetFieldId;
431
+ emitter.args = emitter.args.map(function (arg) {
432
+ if ( emitter.callback === 'conditional' ) {
433
+ arg = arg.replace( /(.*)(\[.*)/, '$1_' + widgetFieldId + '$2' );
434
+ } else {
435
+ arg = arg + '_' + widgetFieldId;
436
+ }
437
+ return arg;
438
+ });
439
+ }
440
+
441
+ var val = $$.is('[type="checkbox"]') ? $$.is(':checked') : $$.val();
442
+ // Return an array that has the new states added to the array
443
+ return $.extend(currentStates, sowEmitters[emitter.callback](val, emitter.args));
444
+ };
445
+
446
+ // Run the states through the state emitters
447
+ var states = {'default': ''};
448
+
449
+ // Go through the array of emitters
450
+ if (typeof emitters.length === 'undefined') {
451
+ emitters = [emitters];
452
+ }
453
+
454
+ for (var i = 0; i < emitters.length; i++) {
455
+ states = handleStateEmitter(emitters[i], states);
456
+ }
457
+
458
+ // Check which states have changed and trigger appropriate sowstatechange
459
+ var formStates = $mainForm.data('states');
460
+ if (typeof formStates === 'undefined') {
461
+ formStates = {'default': ''};
462
+ }
463
+ for (var k in states) {
464
+ if ( typeof formStates[k] === 'undefined' || states[k] !== formStates[k] ) {
465
+ // If the state is different from the original formStates, then trigger a state change
466
+ formStates[k] = states[k];
467
+ $mainForm.trigger('sowstatechange', [k, states[k]]);
468
+ }
469
+ }
470
+
471
+ // Store the form states back in the form
472
+ $mainForm.data('states', formStates);
473
+ }
474
+ };
475
+
476
+ $fields.filter('[data-state-emitter]').each(function () {
477
+
478
+ var $input = $( this ).find( '.siteorigin-widget-input' );
479
+
480
+ // Listen for any change events on an emitter field
481
+ $input.on('keyup change', stateEmitterChangeHandler);
482
+
483
+ // Trigger initial state emitter changes
484
+ $input.each(function () {
485
+ var $$ = $(this);
486
+ if ($$.is(':radio')) {
487
+ // Only checked radio inputs must have change events
488
+ if ($$.is(':checked')) {
489
+ stateEmitterChangeHandler.call($$[0]);
490
+ }
491
+ }
492
+ else {
493
+ stateEmitterChangeHandler.call($$[0]);
494
+ }
495
+ });
496
+
497
+ });
498
+
499
+ // Give plugins a chance to influence the form
500
+ $el.trigger('sowsetupform', $fields).data('sow-form-setup', true);
501
+
502
+ $fields.trigger('sowsetupformfield');
503
+
504
+ $el.find('.siteorigin-widget-field-repeater-item').trigger('updateFieldPositions');
505
+
506
+ if ( $body.hasClass( 'wp-customizer' ) || $body.hasClass( 'widgets-php' ) ) {
507
+ // Reinitialize widget fields when they're dragged and dropped.
508
+ $el.closest( '.ui-sortable' ).on( 'sortstop', function (event, ui) {
509
+ var $fields = ui.item.find( '.siteorigin-widget-form' ).find( '> .siteorigin-widget-field' );
510
+ $fields.trigger( 'sowsetupformfield' );
511
+ } );
512
+ }
513
+
514
+ /////////////////////////////
515
+ // The end of the form setup.
516
+ /////////////////////////////
517
+
518
+ formInitializing = false;
519
+ });
520
+ };
521
+
522
+ $.fn.sowSetupPreview = function () {
523
+ var $el = $(this);
524
+ var previewButton = $el.siblings('.siteorigin-widget-preview');
525
+
526
+ previewButton.find('> a').click(function (e) {
527
+ e.preventDefault();
528
+
529
+ var data = sowbForms.getWidgetFormValues($el);
530
+
531
+ // Create a new modal window
532
+ var modal = $($('#so-widgets-bundle-tpl-preview-dialog').html().trim()).appendTo('body');
533
+ modal.find('input[name="data"]').val(JSON.stringify(data));
534
+ modal.find('input[name="class"]').val($el.data('class'));
535
+ modal.find('iframe').on('load', function () {
536
+ $(this).css('visibility', 'visible');
537
+ });
538
+ modal.find('form').submit();
539
+
540
+ modal.find('.close').click(function () {
541
+ modal.remove();
542
+ });
543
+ });
544
+ };
545
+
546
+ $.fn.sowSetupRepeater = function () {
547
+
548
+ return $(this).each(function (i, el) {
549
+ var $el = $(el);
550
+ var $items = $el.find('.siteorigin-widget-field-repeater-items');
551
+ var name = $el.data('repeater-name');
552
+
553
+ $items.bind('updateFieldPositions', function () {
554
+ var $$ = $(this);
555
+ var $rptrItems = $$.find('> .siteorigin-widget-field-repeater-item');
556
+
557
+ // Set the position for the repeater items
558
+ $rptrItems.each(function (i, el) {
559
+ $(el).find('.siteorigin-widget-input').each(function (j, input) {
560
+ var pos = $(input).data('repeater-positions');
561
+ if (typeof pos === 'undefined') {
562
+ pos = {};
563
+ }
564
+
565
+ pos[name] = i;
566
+ $(input).data('repeater-positions', pos);
567
+ });
568
+ });
569
+
570
+ // Update the field names for all the input items
571
+ $$.find('.siteorigin-widget-input').each( function ( i, input ) {
572
+ var $in = $( input );
573
+ var pos = $in.data( 'repeater-positions' );
574
+
575
+ if ( typeof pos !== 'undefined' ) {
576
+ var newName = $in.attr( 'data-original-name' );
577
+
578
+ if ( !newName ) {
579
+ $in.attr( 'data-original-name', $in.attr( 'name' ) );
580
+ newName = $in.attr( 'name' );
581
+ }
582
+ if ( !newName ) {
583
+ return;
584
+ }
585
+
586
+ if ( pos ) {
587
+ for ( var k in pos ) {
588
+ newName = newName.replace( '#' + k + '#', pos[ k ] );
589
+ }
590
+ }
591
+ $in.attr( 'name', newName );
592
+ }
593
+ } );
594
+
595
+ if ( !$$.data( 'initialSetup' ) ) {
596
+ // Setup default checked values, now that we've updated input names.
597
+ // Without this radio inputs in repeaters will be rendered as if they all belong to the same group.
598
+ $$.find('.siteorigin-widget-input').each(function (i, input) {
599
+ var $in = $(input);
600
+ $in.prop('checked', $in.prop('defaultChecked'));
601
+ });
602
+ $$.data('initialSetup', true);
603
+ }
604
+
605
+ //Setup scrolling.
606
+ var scrollCount = $el.data('scroll-count') ? parseInt($el.data('scroll-count')) : 0;
607
+ if (scrollCount > 0 && $rptrItems.length > scrollCount) {
608
+ var itemHeight = $rptrItems.first().outerHeight();
609
+ $$.css('max-height', itemHeight * scrollCount).css('overflow', 'auto');
610
+ }
611
+ else {
612
+ //TODO: Check whether there was a value before overriding and set it back to that.
613
+ $$.css('max-height', '').css('overflow', '');
614
+ }
615
+ });
616
+
617
+ $items.sortable({
618
+ handle: '.siteorigin-widget-field-repeater-item-top',
619
+ items: '> .siteorigin-widget-field-repeater-item',
620
+ update: function () {
621
+ // Clear `name` attributes for radio inputs. They'll be reassigned on update.
622
+ // This prevents some radio inputs values being cleared during the update process.
623
+ $items.find( 'input[type="radio"].siteorigin-widget-input' ).attr( 'name', '' );
624
+ $items.trigger('updateFieldPositions');
625
+ $el.trigger( 'change' );
626
+ },
627
+ sortstop: function (event, ui) {
628
+ if ( ui.item.is( '.siteorigin-widget-field-repeater-item' ) ) {
629
+ ui.item.find( '> .siteorigin-widget-field-repeater-item-form' ).each( function () {
630
+ var $fields = $( this ).find( '> .siteorigin-widget-field' );
631
+ $fields.trigger( 'sowsetupformfield' );
632
+ } );
633
+ }
634
+ else {
635
+ var $fields = ui.item.find( '.siteorigin-widget-form' ).find( '> .siteorigin-widget-field' );
636
+ $fields.trigger( 'sowsetupformfield' );
637
+ }
638
+ $el.trigger( 'change' );
639
+ }
640
+ });
641
+ $items.trigger('updateFieldPositions');
642
+
643
+ $el.find('> .siteorigin-widget-field-repeater-add').disableSelection().click(function (e) {
644
+ e.preventDefault();
645
+ $el.closest('.siteorigin-widget-field-repeater')
646
+ .sowAddRepeaterItem()
647
+ .find('> .siteorigin-widget-field-repeater-items').slideDown('fast', function () {
648
+ $(window).resize();
649
+ });
650
+ });
651
+
652
+ $el.find('> .siteorigin-widget-field-repeater-top > .siteorigin-widget-field-repeater-expand').click(function (e) {
653
+ e.preventDefault();
654
+ $el.closest('.siteorigin-widget-field-repeater').find('> .siteorigin-widget-field-repeateritems-').slideToggle('fast', function () {
655
+ $(window).resize();
656
+ });
657
+ });
658
+ });
659
+ };
660
+
661
+ $.fn.sowAddRepeaterItem = function () {
662
+ return $(this).each(function (i, el) {
663
+
664
+ var $el = $(el);
665
+ var $nextIndex = $el.find('> .siteorigin-widget-field-repeater-items').children().length + 1;
666
+
667
+ // Create an object with the repeater html so we can make some changes to it.
668
+ var repeaterObject = $('<div>' + $el.find('> .siteorigin-widget-field-repeater-item-html').html() + '</div>');
669
+ repeaterObject.find('.siteorigin-widget-input[data-name]').each(function () {
670
+ var $$ = $(this);
671
+ // Skip out items that are themselves inside repeater HTML wrappers
672
+ if ($$.closest('.siteorigin-widget-field-repeater-item-html').length === 0) {
673
+ $$.attr('name', $(this).data('name'));
674
+ }
675
+ });
676
+
677
+ // Replace repeater item id placeholders with the index of the repeater item.
678
+ var repeaterHtml = '';
679
+ repeaterObject.find( '> .siteorigin-widget-field' )
680
+ .each( function ( index, element ) {
681
+ var html = element.outerHTML;
682
+ // Skip child repeaters, so they can setup their own id's when necessary.
683
+ if ( ! $( element ).is( '.siteorigin-widget-field-type-repeater' ) ) {
684
+ html = html.replace( /_id_/g, $nextIndex );
685
+ }
686
+ repeaterHtml += html;
687
+ } );
688
+
689
+ var readonly = typeof $el.attr('readonly') !== 'undefined';
690
+ var item = $('<div class="siteorigin-widget-field-repeater-item ui-draggable" />')
691
+ .append(
692
+ $('<div class="siteorigin-widget-field-repeater-item-top" />')
693
+ .append(
694
+ $('<div class="siteorigin-widget-field-expand" />')
695
+ )
696
+ .append(
697
+ readonly ? '' : $('<div class="siteorigin-widget-field-copy" />')
698
+ )
699
+ .append(
700
+ readonly ? '' : $('<div class="siteorigin-widget-field-remove" />')
701
+ )
702
+ .append($('<h4 />').html($el.data('item-name')))
703
+ )
704
+ .append(
705
+ $('<div class="siteorigin-widget-field-repeater-item-form" />')
706
+ .html(repeaterHtml)
707
+ );
708
+
709
+ // Add the item and refresh
710
+ $el.find('> .siteorigin-widget-field-repeater-items').append(item).sortable("refresh").trigger('updateFieldPositions');
711
+ item.sowSetupRepeaterItems();
712
+ item.hide().slideDown('fast', function () {
713
+ $(window).resize();
714
+ });
715
+ $el.trigger( 'change' );
716
+ });
717
+ };
718
+
719
+ $.fn.sowRemoveRepeaterItem = function () {
720
+ return $(this).each(function (i, el) {
721
+ var $itemsContainer = $(this).closest('.siteorigin-widget-field-repeater-items');
722
+ $(this).remove();
723
+ $itemsContainer.sortable("refresh").trigger('updateFieldPositions');
724
+ $( el ).trigger( 'change' );
725
+ });
726
+ };
727
+
728
+ $.fn.sowSetupRepeaterItems = function () {
729
+ return $(this).each(function (i, el) {
730
+ var $el = $(el);
731
+
732
+ if (typeof $el.data('sowrepeater-actions-setup') === 'undefined') {
733
+ var $parentRepeater = $el.closest('.siteorigin-widget-field-repeater');
734
+ var itemTop = $el.find('> .siteorigin-widget-field-repeater-item-top');
735
+ var itemLabel = $parentRepeater.data('item-label');
736
+ if (itemLabel && itemLabel.selector) {
737
+ var updateLabel = function () {
738
+ var functionName = ( itemLabel.hasOwnProperty('valueMethod') && itemLabel.valueMethod ) ? itemLabel.valueMethod : 'val';
739
+ var txt = $el.find(itemLabel.selector)[functionName]();
740
+ if (txt) {
741
+ if (txt.length > 80) {
742
+ txt = txt.substr(0, 79) + '...';
743
+ }
744
+ itemTop.find('h4').text(txt);
745
+ }
746
+ };
747
+ updateLabel();
748
+ var eventName = ( itemLabel.hasOwnProperty('updateEvent') && itemLabel.updateEvent ) ? itemLabel.updateEvent : 'change';
749
+ $el.bind(eventName, updateLabel);
750
+ }
751
+
752
+ itemTop.click(function (e) {
753
+ if (e.target.className === "siteorigin-widget-field-remove" || e.target.className === "siteorigin-widget-field-copy") {
754
+ return;
755
+ }
756
+ e.preventDefault();
757
+ $(this).closest('.siteorigin-widget-field-repeater-item').find('.siteorigin-widget-field-repeater-item-form').eq(0).slideToggle('fast', function () {
758
+ $(window).resize();
759
+ if ($(this).is(':visible')) {
760
+ $(this).trigger('slideToggleOpenComplete');
761
+
762
+ $( this ).find( '.siteorigin-widget-field-type-section > .siteorigin-widget-section > .siteorigin-widget-field,> .siteorigin-widget-field' )
763
+ .each( function (index, element) {
764
+ var $field = $( element );
765
+ if ( $field.is( ':visible' ) ) {
766
+ $field.trigger( 'sowsetupformfield' );
767
+ }
768
+
769
+ } );
770
+ }
771
+ else {
772
+ $(this).trigger('slideToggleCloseComplete');
773
+ }
774
+ });
775
+ });
776
+
777
+ itemTop.find('.siteorigin-widget-field-remove').click(function (e, params) {
778
+ e.preventDefault();
779
+ var $s = $( this ).closest( '.siteorigin-widget-field-repeater-items' );
780
+ var $item = $( this ).closest( '.siteorigin-widget-field-repeater-item' );
781
+ var removeItem = function () {
782
+ $item.remove();
783
+ $s.sortable( "refresh" ).trigger( 'updateFieldPositions' );
784
+ $( window ).resize();
785
+ $parentRepeater.trigger( 'change' );
786
+ };
787
+ if ( params && params.silent ) {
788
+ removeItem();
789
+ } else if ( confirm( soWidgets.sure ) ) {
790
+ $item.slideUp('fast', removeItem );
791
+ }
792
+ });
793
+ itemTop.find('.siteorigin-widget-field-copy').click(function (e) {
794
+ e.preventDefault();
795
+ var $form = $(this).closest('.siteorigin-widget-form-main');
796
+ var $item = $(this).closest('.siteorigin-widget-field-repeater-item');
797
+ var $copyItem = $item.clone();
798
+ var $items = $item.closest('.siteorigin-widget-field-repeater-items');
799
+ //var $nextIndex = $item.index()+1;
800
+ var $nextIndex = $items.children().length;
801
+ var newIds = {};
802
+
803
+ $copyItem.find('*[name]').each(function () {
804
+ var $inputElement = $(this);
805
+ var id = $inputElement.attr('id');
806
+ var nm = $inputElement.attr('name');
807
+ // TinyMCE field :/
808
+ if ($inputElement.is('textarea') && $inputElement.parent().is('.wp-editor-container') && typeof tinymce != 'undefined') {
809
+ $inputElement.parent().empty().append($inputElement);
810
+ $inputElement.css('display', '');
811
+ var curEd = tinymce.get(id);
812
+ if (curEd) {
813
+ $inputElement.val(curEd.getContent());
814
+ }
815
+ }
816
+ // Color field :/
817
+ else if ($inputElement.is('.wp-color-picker')) {
818
+ var $wpPickerContainer = $inputElement.closest('.wp-picker-container');
819
+ var $soWidgetField = $inputElement.closest('.siteorigin-widget-field');
820
+ $wpPickerContainer.remove();
821
+ $soWidgetField.append($inputElement.remove());
822
+ }
823
+ else {
824
+ var $originalInput = id ? $item.find( '#' + id ) : $item.find('[name="' + nm + '"]');
825
+ if ($originalInput.length && $originalInput.val() != null) {
826
+ $inputElement.val($originalInput.val());
827
+ }
828
+ }
829
+ if (id) {
830
+ var idRegExp;
831
+ var idBase;
832
+ var newId;
833
+
834
+ // Radio inputs are slightly different because there are multiple `input` elements for
835
+ // a single field, i.e. multiple `inputs` for selecting a single value.
836
+ if ($inputElement.is('[type="radio"]')) {
837
+ // Radio inputs have their position appended to the id.
838
+ idBase = id.replace(/-\d+-\d+$/, '');
839
+ var radioIdBase = id.replace(/-\d+$/, '');
840
+ if (!newIds[idBase]) {
841
+ var radioNames = {};
842
+ newIds[idBase] = $form
843
+ // find all inputs containing idBase in their id attribute
844
+ .find('.siteorigin-widget-input[id^=' + idBase + ']')
845
+ // exclude inputs from templates
846
+ .not('[id*=_id_]')
847
+ // reduce to one element per radio input group.
848
+ .filter(function (index, element) {
849
+ var eltName = $(element).attr('name');
850
+ if (radioNames[eltName]) {
851
+ return false;
852
+ } else {
853
+ radioNames[eltName] = true;
854
+ return true;
855
+ }
856
+ }).length + 1;
857
+ }
858
+ var newRadioIdBase = idBase + '-' + newIds[idBase];
859
+ newId = newRadioIdBase + id.match(/-\d+$/)[0];
860
+ $copyItem.find('label[for=' + radioIdBase + ']').attr('for', newRadioIdBase);
861
+ } else {
862
+ idRegExp = new RegExp('-\\d+$');
863
+ idBase = id.replace(idRegExp, '');
864
+ if (!newIds[idBase]) {
865
+ newIds[idBase] = $form.find('.siteorigin-widget-input[id^=' + idBase + ']').not('[id*=_id_]').length + 1;
866
+ }
867
+ newId = idBase + '-' + newIds[idBase]++;
868
+ }
869
+
870
+ $inputElement.attr('id', newId);
871
+ if ( $inputElement.is( '.wp-editor-area' ) ) {
872
+ var tmceContainer = $inputElement.closest( '.siteorigin-widget-tinymce-container' );
873
+ var mediaButtons = tmceContainer.data( 'media-buttons' );
874
+ if ( mediaButtons && mediaButtons.html ) {
875
+ var idRegExp = new RegExp( id, 'g');
876
+ mediaButtons.html = mediaButtons.html.replace( idRegExp, newId );
877
+ tmceContainer.data( 'media-buttons', mediaButtons );
878
+ }
879
+ }
880
+ $copyItem.find('label[for=' + id + ']').attr('for', newId);
881
+ $copyItem.find('[id*=' + id + ']').each(function () {
882
+ var oldIdAttr = $(this).attr('id');
883
+ var newIdAttr = oldIdAttr.replace(id, newId);
884
+ $(this).attr('id', newIdAttr);
885
+ });
886
+ if (typeof tinymce !== 'undefined' && tinymce.get(newId)) {
887
+ tinymce.get(newId).remove();
888
+ }
889
+ }
890
+ var nestLevel = $item.parents('.siteorigin-widget-field-repeater').length;
891
+ var $body = $('body');
892
+ if (($body.hasClass('wp-customizer') || $body.hasClass('widgets-php')) && $el.closest('.panel-dialog').length === 0) {
893
+ nestLevel += 1;
894
+ }
895
+ var newName = nm.replace(new RegExp('((?:.*?\\[\\d+\\]){' + (nestLevel - 1).toString() + '})?(.*?\\[)\\d+(\\])'), '$1$2' + $nextIndex.toString() + '$3');
896
+ $inputElement.attr('name', newName);
897
+ $inputElement.data('original-name', newName);
898
+ });
899
+
900
+ //$item.after($copyItem);
901
+ //$items.sortable( "refresh").trigger('updateFieldPositions');
902
+ $items.append($copyItem).sortable("refresh").trigger('updateFieldPositions');
903
+ $copyItem.sowSetupRepeaterItems();
904
+ $copyItem.hide().slideDown('fast', function () {
905
+ $(window).resize();
906
+ });
907
+ $el.trigger( 'change' );
908
+ });
909
+
910
+ $el.find('> .siteorigin-widget-field-repeater-item-form').sowSetupForm();
911
+
912
+ $el.data('sowrepeater-actions-setup', true);
913
+ }
914
+ });
915
+ };
916
+
917
+ // Widgets Bundle utility functions
918
+ /**
919
+ * Get the unique index of a repeated item. Could be in a repeater or if multiple widget fields with the same
920
+ * widget class.
921
+ *
922
+ * @param $el
923
+ * @param containerType
924
+ * @param containerClass
925
+ * @return {*}
926
+ */
927
+ sowbForms.getContainerFieldId = function ( $el, containerType, containerClass ) {
928
+ var fieldIdPropName = containerType + 'FieldId';
929
+ if ( ! this.hasOwnProperty( fieldIdPropName ) ) {
930
+ this[ fieldIdPropName ] = 1;
931
+ }
932
+
933
+ var $field = $el.closest( containerClass );
934
+ if ( $field.length ) {
935
+ var fieldId = $field.data( 'field-id' );
936
+ if ( fieldId === undefined ) {
937
+ fieldId = this[ fieldIdPropName ]++;
938
+ }
939
+ $field.data( 'field-id', fieldId );
940
+
941
+ return fieldId;
942
+ }
943
+ else {
944
+ return false;
945
+ }
946
+ };
947
+
948
+ /**
949
+ * Retrieve a variable for a field with the given identifier, elementName.
950
+ *
951
+ * @return {*}
952
+ * @param widgetClass The class name of the widget for which to retrieve a variable.
953
+ * @param elementName The name of the field for which to retrieve a variable.
954
+ * @param key The name of the variable to retrieve.
955
+ */
956
+ sowbForms.getWidgetFieldVariable = function (widgetClass, elementName, key) {
957
+ var widgetVars = window.sow_field_javascript_variables[widgetClass];
958
+ // Get rid of any index placeholders
959
+ elementName = elementName.replace(/\[#.*?#\]/g, '');
960
+ var variablePath = /[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(elementName)[1];
961
+ var variablePathParts = variablePath.split('][');
962
+ var elementVars = variablePathParts.length ? widgetVars : null;
963
+ while (variablePathParts.length) {
964
+ elementVars = elementVars[variablePathParts.shift()];
965
+ }
966
+ return elementVars[key];
967
+ };
968
+
969
+ sowbForms.fetchWidgetVariable = function (key, widget, callback) {
970
+ window.sowVars = window.sowVars || {};
971
+
972
+ if (typeof window.sowVars[widget] === 'undefined') {
973
+ $.post(
974
+ soWidgets.ajaxurl,
975
+ {'action': 'sow_get_javascript_variables', 'widget': widget, 'key': key},
976
+ function (result) {
977
+ window.sowVars[widget] = result;
978
+ callback(window.sowVars[widget][key]);
979
+ }
980
+ );
981
+ }
982
+ else {
983
+ callback(window.sowVars[widget][key]);
984
+ }
985
+ };
986
+
987
+ sowbForms.getWidgetIdBase = function ( formContainer ) {
988
+ return formContainer.data( 'id-base' );
989
+ };
990
+
991
+ sowbForms.getWidgetFormValues = function ( formContainer ) {
992
+
993
+ if ( _.isUndefined( formContainer ) ) {
994
+ return null;
995
+ }
996
+
997
+ var data = {};
998
+
999
+ formContainer.find('*[name]').each(function () {
1000
+ var $$ = $(this);
1001
+
1002
+ try {
1003
+ var name = /[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec( $$.attr( 'name' ) );
1004
+
1005
+ if ( _.isEmpty( name ) ) {
1006
+ return true;
1007
+ }
1008
+
1009
+ // Create an array with the parts of the name
1010
+ name = name[1];
1011
+ var parts = name.split( '][' );
1012
+
1013
+ // Make sure we either have numbers or strings
1014
+ parts = parts.map( function ( e ) {
1015
+ if ( ! isNaN( parseFloat( e ) ) && isFinite( e ) ) {
1016
+ return parseInt( e );
1017
+ }
1018
+ else {
1019
+ return e;
1020
+ }
1021
+ } );
1022
+
1023
+ var sub = data;
1024
+ var fieldValue = null;
1025
+
1026
+ var fieldType = _.isString( $$.attr( 'type' ) ) ? $$.attr( 'type' ).toLowerCase() : null;
1027
+
1028
+ if ( fieldType === 'checkbox' ) {
1029
+ if ( $$.is( ':checked' ) ) {
1030
+ fieldValue = $$.val() !== '' ? $$.val() : true;
1031
+ } else {
1032
+ fieldValue = false;
1033
+ }
1034
+ } else if ( fieldType === 'radio' ) {
1035
+ if ( $$.is( ':checked' ) ) {
1036
+ fieldValue = $$.val();
1037
+ } else {
1038
+ return;
1039
+ }
1040
+ } else if ( $$.prop( 'tagName' ) === 'TEXTAREA' && $$.hasClass( 'wp-editor-area' ) ) {
1041
+ // This is a TinyMCE editor, so we'll use the tinyMCE object to get the content
1042
+ var editor = null;
1043
+ if ( typeof tinyMCE !== 'undefined' ) {
1044
+ editor = tinyMCE.get( $$.attr( 'id' ) );
1045
+ }
1046
+
1047
+ if ( editor !== null && typeof( editor.getContent ) === "function" && !editor.isHidden() ) {
1048
+ fieldValue = editor.getContent();
1049
+ }
1050
+ else {
1051
+ fieldValue = $$.val();
1052
+ }
1053
+ } else if ( $$.prop( 'tagName' ) === 'SELECT' ) {
1054
+ var selected = $$.find( 'option:selected' );
1055
+ if ( selected.length === 1 ) {
1056
+ fieldValue = $$.find( 'option:selected' ).val();
1057
+ }
1058
+ else if ( selected.length > 1 ) {
1059
+ // This is a mutli-select field
1060
+ fieldValue = _.map( $$.find( 'option:selected' ), function ( n, i ) {
1061
+ return $( n ).val();
1062
+ } );
1063
+ }
1064
+ } else {
1065
+ fieldValue = $$.val();
1066
+ }
1067
+ for ( var i = 0; i < parts.length; i++ ) {
1068
+ if ( i === parts.length - 1 ) {
1069
+ if ( parts[i] === '' ) {
1070
+ // This needs to be an array
1071
+ sub.push( fieldValue );
1072
+ } else {
1073
+ sub[ parts[ i ] ] = fieldValue;
1074
+ }
1075
+ }
1076
+ else {
1077
+ if ( _.isUndefined( sub[ parts[ i ] ] ) ) {
1078
+ // We assume that a numeric key means it's an array. (or empty string??)
1079
+ if ( _.isNumber( parts[ i + 1 ] ) || parts[ i + 1 ] === '' ) {
1080
+ sub[ parts[ i ] ] = [];
1081
+ } else {
1082
+ sub[ parts[ i ] ] = {};
1083
+ }
1084
+ }
1085
+ // Go deeper into the data and continue
1086
+ sub = sub[ parts[ i ] ];
1087
+ }
1088
+ }
1089
+ } catch ( error ) {
1090
+ console.error( 'Field [' + $$.attr( 'name' ) + '] could not be processed and was skipped - ' + error.message );
1091
+ }
1092
+ });
1093
+ return data;
1094
+ };
1095
+
1096
+
1097
+ /**
1098
+ * Sets all the widget form fields in the given container with the given data values.
1099
+ *
1100
+ * @param formContainer The jQuery element containing the widget form fields.
1101
+ * @param data The data from which to set the widget form field values.
1102
+ * @param skipMissingValues If `true`, this will skip form fields for which the data values are missing.
1103
+ * If `false`, the form fields will be cleared. Default is `false`.
1104
+ * @param triggerChange If `true`, trigger a 'change' event on each element after it's value is set. Default is `true`.
1105
+ */
1106
+ sowbForms.setWidgetFormValues = function (formContainer, data, skipMissingValues, triggerChange) {
1107
+ skipMissingValues = skipMissingValues || false;
1108
+ triggerChange = (typeof triggerChange !== 'undefined' && triggerChange) || typeof triggerChange === 'undefined';
1109
+ // First check if this form has any repeaters.
1110
+ var depth = 0;
1111
+ var updateRepeaterChildren = function ( formParent, formData ) {
1112
+ if ( ++depth === 10 ) {
1113
+ --depth;
1114
+ return;
1115
+ }
1116
+ // Only direct child fields which are repeaters.
1117
+ formParent.find( '> .siteorigin-widget-field-type-repeater,> .siteorigin-widget-field-type-section > .siteorigin-widget-section > .siteorigin-widget-field-type-repeater' )
1118
+ .each( function ( index, element ) {
1119
+ var $this = $( this );
1120
+ var $repeater = $this.find( '> .siteorigin-widget-field-repeater' );
1121
+ var repeaterName = $repeater.data( 'repeaterName' );
1122
+ var repeaterData = formData.hasOwnProperty( repeaterName ) ? formData[ repeaterName ] : null;
1123
+ var isInSection = $this.parent().is( '.siteorigin-widget-section' );
1124
+ if ( isInSection ) {
1125
+ var elementName = $repeater.data( 'element-name' );
1126
+ // Get rid of any index placeholders
1127
+ elementName = elementName.replace(/\[#.*?#\]/g, '');
1128
+ var variablePath = /[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(elementName)[1];
1129
+ var variablePathParts = variablePath.split('][');
1130
+ var elementVars = variablePathParts.length ? formData : null;
1131
+ while (variablePathParts.length) {
1132
+ var key = variablePathParts.shift();
1133
+ elementVars = elementVars.hasOwnProperty( key ) ? elementVars[ key ] : elementVars;
1134
+ }
1135
+ repeaterData = elementVars;
1136
+ }
1137
+
1138
+ if ( ! repeaterData || ! Array.isArray( repeaterData ) ) {
1139
+ return;
1140
+ }
1141
+ // Check that the number of child items matches the number of data items.
1142
+ var repeaterChildren = $repeater.find( '> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item' );
1143
+ var numItems = repeaterData.length;
1144
+ var numChildren = repeaterChildren.length;
1145
+ if ( numItems > numChildren ) {
1146
+ // If data items > child items, create extra child items.
1147
+ for ( var i = 0; i < numItems - numChildren; i++) {
1148
+ $repeater.find( '> .siteorigin-widget-field-repeater-add' ).click();
1149
+ }
1150
+
1151
+ } else if ( ! skipMissingValues && numItems < numChildren ) {
1152
+ // If child items > data items, remove extra child items.
1153
+ for ( var j = numItems; j < numChildren; j++) {
1154
+ var $child = $( repeaterChildren.eq( j ) );
1155
+ $child.find( '> .siteorigin-widget-field-repeater-item-top' )
1156
+ .find( '.siteorigin-widget-field-remove' )
1157
+ .trigger( 'click', { silent: true } );
1158
+ }
1159
+ }
1160
+ repeaterChildren = $repeater.find( '> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item' );
1161
+ for ( var k = 0; k < repeaterChildren.length; k++ ) {
1162
+ repeaterChildren.eq( k ).find( '> .siteorigin-widget-field-repeater-item-form' );
1163
+ updateRepeaterChildren(
1164
+ repeaterChildren.eq( k ).find( '> .siteorigin-widget-field-repeater-item-form' ),
1165
+ repeaterData[ k ]
1166
+ );
1167
+ }
1168
+ } );
1169
+ --depth;
1170
+ };
1171
+
1172
+ updateRepeaterChildren(formContainer, data);
1173
+
1174
+ formContainer.find('*[name]').each(function () {
1175
+ var $$ = $(this);
1176
+ var name = /[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec($$.attr('name'));
1177
+
1178
+ if ( name === undefined || name === null ) {
1179
+ return true;
1180
+ }
1181
+
1182
+ name = name[1];
1183
+ var parts = name.split('][');
1184
+
1185
+ // Make sure we either have numbers or strings
1186
+ parts = parts.map( function ( e ) {
1187
+ if ( !isNaN( parseFloat( e ) ) && isFinite( e ) ) {
1188
+ return parseInt( e );
1189
+ } else {
1190
+ return e;
1191
+ }
1192
+ } );
1193
+
1194
+ var sub = data;
1195
+ var value;
1196
+ for (var i = 0; i < parts.length; i++) {
1197
+ // If the field is missing from the data, just leave `value` as `undefined`.
1198
+ if ( ! sub.hasOwnProperty( parts[ i ] ) ) {
1199
+ if ( skipMissingValues ) {
1200
+ return true;
1201
+ } else {
1202
+ break;
1203
+ }
1204
+ }
1205
+ if (i === parts.length - 1) {
1206
+ value = sub[ parts[ i ] ];
1207
+ } else {
1208
+ sub = sub[ parts[ i ] ];
1209
+ }
1210
+ }
1211
+
1212
+ // This is the end, so we need to set the value on the field here.
1213
+ if ( $$.attr( 'type' ) === 'checkbox' ) {
1214
+ $$.prop( 'checked', value );
1215
+ } else if ( $$.attr( 'type' ) === 'radio' ) {
1216
+ $$.prop( 'checked', value === $$.val() );
1217
+ } else if ( $$.prop( 'tagName' ) === 'TEXTAREA' && $$.hasClass( 'wp-editor-area' ) ) {
1218
+ // This is a TinyMCE editor, so we'll use the tinyMCE object to get the content
1219
+ var editor = null;
1220
+ if ( typeof tinyMCE !== 'undefined' ) {
1221
+ editor = tinyMCE.get( $$.attr( 'id' ) );
1222
+ }
1223
+
1224
+ if ( editor !== null && typeof( editor.setContent ) === "function" && ! editor.isHidden() && $$.parent().is( ':visible' ) ) {
1225
+ if ( editor.initialized ) {
1226
+ editor.setContent( value );
1227
+ } else {
1228
+ editor.on('init', function () {
1229
+ editor.setContent( value );
1230
+ });
1231
+ }
1232
+ }
1233
+ else {
1234
+ $$.val( value );
1235
+ }
1236
+ } else if ( $$.is( '.panels-data' ) ) {
1237
+ $$.val( value );
1238
+ var builder = $$.data( 'builder' );
1239
+ if ( builder ) {
1240
+ builder.setDataField( $$ );
1241
+ }
1242
+ } else {
1243
+ $$.val( value );
1244
+ }
1245
+
1246
+ if ( triggerChange ) {
1247
+ $$.trigger( 'change' );
1248
+ this.dispatchEvent(new Event('change', {bubbles: true, cancelable: true}));
1249
+ }
1250
+ });
1251
+ };
1252
+
1253
+
1254
+ /**
1255
+ * Displays an informational notice either at the top of the supplied container, or above the optionally supplied
1256
+ * element.
1257
+ *
1258
+ * @param $container The jQuery container in which the notice will be prepended.
1259
+ * @param title The string title for the notice.
1260
+ * @param message The string detail message for the notice.
1261
+ * @param buttons An array of buttons which will be display along with the notice.
1262
+ * @param $element The optional jQuery element before which the notice will be inserted. If this is supplied it
1263
+ * will take precedence over the $container argument.
1264
+ *
1265
+ */
1266
+ sowbForms.displayNotice = function ( $container, title, message, buttons, $element ) {
1267
+
1268
+ var $notice = $( '<div class="siteorigin-widget-form-notification"></div>' );
1269
+ if ( title ) {
1270
+ $notice.append( '<span>' + title + '</span>' );
1271
+ }
1272
+
1273
+ if ( buttons && buttons.length ) {
1274
+ buttons.forEach( function ( button ) {
1275
+ var buttonClasses = '';
1276
+ if ( button.classes && button.classes.length ) {
1277
+ buttonClasses = ' ' + button.classes.join( ' ' );
1278
+ }
1279
+ var $button = $( '<a class="button button-small' + buttonClasses + '">' + button.label + '</a>' );
1280
+
1281
+ if ( button.url ) {
1282
+ $button.attr( 'href', button.url );
1283
+ }
1284
+ if ( button.callback ) {
1285
+ $button.on( 'click', function () {
1286
+ button.callback( $notice );
1287
+ });
1288
+ }
1289
+
1290
+ $notice.append( $button );
1291
+ } );
1292
+ }
1293
+ if ( message ) {
1294
+ $notice.append( '<div><small>' + message + '</small></div>' );
1295
+ }
1296
+
1297
+ if ( $element ) {
1298
+ $element.before( $notice );
1299
+ } else {
1300
+ $container.prepend( $notice );
1301
+ }
1302
+ };
1303
+
1304
+ // When we click on a widget top
1305
+ $('.widgets-holder-wrap').on('click', '.widget:has(.siteorigin-widget-form-main) .widget-top', function () {
1306
+ var $$ = $(this).closest('.widget').find('.siteorigin-widget-form-main');
1307
+ setTimeout(function () {
1308
+ $$.sowSetupForm();
1309
+ }, 200);
1310
+ });
1311
+ var $body = $( 'body' );
1312
+ if ( $body.hasClass('wp-customizer') ) {
1313
+ // Setup new widgets when they're added in the customizer interface
1314
+ $(document).on('widget-added', function (e, widget) {
1315
+ widget.find('.siteorigin-widget-form').sowSetupForm();
1316
+ });
1317
+ }
1318
+
1319
+ if ( $body.hasClass('block-editor-page') ) {
1320
+ // Setup new widgets when they're previewed in the block editor.
1321
+ $(document).on('panels_setup_preview', function () {
1322
+ if (window.hasOwnProperty('sowb')) {
1323
+ $( sowb ).trigger( 'setup_widgets', { preview: true } );
1324
+ }
1325
+ });
1326
+ }
1327
+
1328
+ $( document ).on( 'open_dialog', function ( e, dialog ) {
1329
+ // When we open a Page Builder edit widget dialog
1330
+ if ( dialog.$el.find( '.so-panels-dialog' ).is( '.so-panels-dialog-edit-widget' ) ) {
1331
+ var $fields = dialog.$el.find( '.siteorigin-widget-form-main' ).find( '> .siteorigin-widget-field' );
1332
+ $fields.trigger( 'sowsetupformfield' );
1333
+ }
1334
+ });
1335
+
1336
+ $(function () {
1337
+ $(document).trigger('sowadminloaded');
1338
+ });
1339
+
1340
+ })(jQuery);
1341
+
1342
+ var sowEmitters = {
1343
+
1344
+ /**
1345
+ * Find the group/state and an extra match part.
1346
+ *
1347
+ * @param arg
1348
+ * @param matchPart
1349
+ * @return {*}
1350
+ */
1351
+ '_match': function (arg, matchPart) {
1352
+ if (typeof matchPart === 'undefined') {
1353
+ matchPart = '.*';
1354
+ }
1355
+
1356
+ // Create the regular expression to match the group/state and extra match
1357
+ var exp = new RegExp('^([a-zA-Z0-9_-]+)(\\[([a-zA-Z0-9_-]+)\\])? *: *(' + matchPart + ') *$');
1358
+ var m = exp.exec(arg);
1359
+
1360
+ if (m === null) {
1361
+ return false;
1362
+ }
1363
+
1364
+ var state = '';
1365
+ var group = 'default';
1366
+
1367
+ if (m[3] !== undefined) {
1368
+ group = m[1];
1369
+ state = m[3];
1370
+ }
1371
+ else {
1372
+ state = m[1];
1373
+ }
1374
+
1375
+ return {
1376
+ 'match': m[4].trim(),
1377
+ 'group': group,
1378
+ 'state': state
1379
+ };
1380
+ },
1381
+
1382
+ '_checker': function (val, args, matchPart, callback) {
1383
+ var returnStates = {};
1384
+ if (typeof args.length === 'undefined') {
1385
+ args = [args];
1386
+ }
1387
+
1388
+ var m;
1389
+ for (var i = 0; i < args.length; i++) {
1390
+ m = sowEmitters._match(args[i], matchPart);
1391
+ if (m === false) {
1392
+ continue;
1393
+ }
1394
+
1395
+ if (m.match === '_true' || callback(val, args, m.match)) {
1396
+ returnStates[m.group] = m.state;
1397
+ }
1398
+ }
1399
+
1400
+ return returnStates;
1401
+ },
1402
+
1403
+ /**
1404
+ * A very simple state emitter that simply sets the given group the value
1405
+ *
1406
+ *
1407
+ * @param val
1408
+ * @param args
1409
+ * @returns {{}}
1410
+ */
1411
+ 'select': function (val, args) {
1412
+ if (typeof args.length === 'undefined') {
1413
+ args = [args];
1414
+ }
1415
+
1416
+ var returnGroups = {};
1417
+ for (var i = 0; i < args.length; i++) {
1418
+ if (args[i] === '') {
1419
+ args[i] = 'default';
1420
+ }
1421
+ returnGroups[args[i]] = val;
1422
+ }
1423
+
1424
+ return returnGroups;
1425
+ },
1426
+
1427
+ /**
1428
+ * The conditional state emitter uses eval to check a given conditional argument.
1429
+ *
1430
+ * @param val
1431
+ * @param args
1432
+ * @return {{}}
1433
+ */
1434
+ 'conditional': function (val, args) {
1435
+ return sowEmitters._checker(val, args, '[^;{}]*', function (val, args, match) {
1436
+ return eval(match);
1437
+ });
1438
+ },
1439
+
1440
+ /**
1441
+ * The in state emitter checks if the value is in an array of functions
1442
+ *
1443
+ * @param val
1444
+ * @param args
1445
+ * @return {{}}
1446
+ */
1447
+ 'in': function (val, args) {
1448
+ return sowEmitters._checker(val, args, '[^;{}]*', function (val, args, match) {
1449
+ return match.split(',').map(function (s) {
1450
+ return s.trim();
1451
+ }).indexOf(val) !== -1;
1452
+ });
1453
+ }
1454
+ };
1455
+
1456
+ window.sowbForms = sowbForms;
base/js/admin.min.js CHANGED
@@ -1 +1 @@
1
- var sowbForms=window.sowbForms||{};!function(C){C.fn.sowSetupForm=function(){return C(this).each(function(e,i){var o,t=C(i),y=!0,r=C("body"),n=t.find("input[name]");if(n.length&&-1!==n.attr("name").indexOf("__i__"))return this;if(t.is(".siteorigin-widget-form-main")){if(!0===t.data("sow-form-setup"))return!0;if(r.hasClass("widgets-php")&&!t.is(":visible")&&0===t.closest(".panel-dialog").length)return!0;t.on("sowstatechange",function(e,h,b){t.find("[data-state-handler]").each(function(){var e,i,t,r,n,a,s=C(this),o=C.extend({},s.data("state-handler"),y?s.data("state-handler-initial"):{});if(0===Object.keys(o).length)return!0;var d={},l=sowbForms.getContainerFieldId(s,"repeater",".siteorigin-widget-field-repeater-item");if(!1!==l){var g={};for(var f in o)g[f.replace("{$repeater}",l)]=o[f];o=g}var c=sowbForms.getContainerFieldId(s,"widget",".siteorigin-widget-widget");if(!1!==c){var p={};for(var u in o){var w=u.match(/_else\[(.*)\]|(.*)\[(.*)\]/);p[w&&w.length&&void 0===w[1]?w[2]+"_"+c+"["+w[3]+"]":"_else["+w[1]+"_"+c+"]"]=o[u]}o=p}for(var m in o)if(n=!1,null!==(e=m.match(/^([a-zA-Z0-9_-]+)(\[([a-zA-Z0-9_\-,]+)\])?(\[\])?$/))){if(i={group:"default",name:"",multi:!1},void 0!==e[2]?(i.group=e[1],i.name=e[3]):i.name=e[0],i.multi=void 0!==e[4],"_else"===i.group)i.group=i.name,i.name="",n=i.group===h&&void 0===d[i.group];else{a=i.name.split(",").map(function(e){return e.trim()});for(var v=0;v<a.length&&!(n=i.group===h&&a[v]===b);v++);}if(n){t=o[m],i.multi||(t=[t]);for(v=0;v<t.length;v++){if((r=void 0!==t[v][1]&&Boolean(t[v][1])?s.find(t[v][1]):s)[t[v][0]].apply(r,void 0!==t[v][2]?t[v][2]:[]),r.is(".siteorigin-widget-field:visible"))if(r.is(".siteorigin-widget-field-type-section"))r.find("> .siteorigin-widget-section > .siteorigin-widget-field").trigger("sowsetupformfield");else r.trigger("sowsetupformfield")}d[i.group]=!0}}})}),t.sowSetupPreview();var a=(o=t).find(".siteorigin-widget-teaser");if(a.find(".dashicons-dismiss").click(function(){var e=C(this);C.get(e.data("dismiss-url")),a.slideUp("normal",function(){a.remove()})}),!t.data("backupDisabled")){var s=t.find("> .siteorigin-widgets-form-id").val(),d=t.find("> .siteorigin-widgets-form-timestamp"),l=parseInt(d.val()||0),g=JSON.parse(sessionStorage.getItem(s));g&&(g._sow_form_timestamp>l?sowbForms.displayNotice(t,soWidgets.backup.newerVersion,soWidgets.backup.replaceWarning,[{label:soWidgets.backup.restore,callback:function(e){sowbForms.setWidgetFormValues(o,g),e.slideUp("fast",function(){e.remove()})}},{label:soWidgets.backup.dismiss,callback:function(e){e.slideUp("fast",function(){sessionStorage.removeItem(s),e.remove()})}}]):sessionStorage.removeItem(s)),t.change(function(){d.val((new Date).getTime());var e=sowbForms.getWidgetFormValues(t);sessionStorage.setItem(s,JSON.stringify(e))})}}else o=t.closest(".siteorigin-widget-form-main");o.find("> .siteorigin-widgets-form-id").val();var f=t.find("> .siteorigin-widget-field");f.find("> .siteorigin-widget-section").sowSetupForm();var c=f.find("> .siteorigin-widget-widget");c.find("> .siteorigin-widget-section").sowSetupForm(),c.filter(":not(:has(> .siteorigin-widget-section))").sowSetupForm(),f.find(".siteorigin-widget-input").each(function(e,i){null===C(i).data("original-name")&&C(i).data("original-name",C(i).attr("name"))}),f.find("> .siteorigin-widget-field-repeater").sowSetupRepeater(),t.find(".siteorigin-widget-field-repeater-item").sowSetupRepeaterItems(),f.find("> .siteorigin-widget-input-color").each(function(){var e=C(this),i={change:function(e,i){setTimeout(function(){C(e.target).trigger("change")},100)}};e.data("defaultColor")&&(i.defaultColor=e.data("defaultColor")),e.wpColorPicker(i)});var p=function(){C(this).toggleClass("siteorigin-widget-section-visible"),C(this).parent().find("> .siteorigin-widget-section, > .siteorigin-widget-widget > .siteorigin-widget-section").slideToggle("fast",function(){(C(window).resize(),C(this).find("> .siteorigin-widget-field-container-state").val(C(this).is(":visible")?"open":"closed"),C(this).is(":visible"))&&C(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")})};f.filter(".siteorigin-widget-field-type-widget, .siteorigin-widget-field-type-section").find("> label").click(p),f.filter(".siteorigin-widget-field-type-posts").find(".posts-container-label-wrapper").click(p),f.filter(".siteorigin-widget-field-type-slider").each(function(){var t=C(this),r=t.find('input[type="number"]'),n=t.find(".siteorigin-widget-value-slider");n.slider({max:parseFloat(r.attr("max")),min:parseFloat(r.attr("min")),step:parseFloat(r.attr("step")),value:parseFloat(r.val()),slide:function(e,i){r.val(parseFloat(i.value)),r.trigger("change"),t.find(".siteorigin-widget-slider-value").html(i.value)}}),r.change(function(e,i){i&&i.silent||n.slider("value",parseFloat(r.val()))})}),f.filter(".siteorigin-widget-field-type-link").each(function(){var n=C(this),t=function(){var e=n.find(".content-text-search"),i=e.val(),t=e.data("postTypes"),r=n.find("ul.posts").empty().addClass("loading");C.get(soWidgets.ajaxurl,{action:"so_widgets_search_posts",query:i,postTypes:t},function(e){for(var i=0;i<e.length;i++)""===e[i].label&&(e[i].label="&nbsp;"),r.append(C("<li>").addClass("post").html(e[i].label+"<span>("+e[i].type+")</span>").data(e[i]));r.removeClass("loading")})};n.find(".select-content-button, .button-close").click(function(e){e.preventDefault(),C(this).blur();var i=n.find(".existing-content-selector");i.toggle(),i.is(":visible")&&0===i.find("ul.posts li").length&&t()}),n.on("click",".posts li",function(e){e.preventDefault();var i=C(this);n.find("input.siteorigin-widget-input").val("post: "+i.data("value")),n.change(),n.find(".existing-content-selector").toggle()});var e=null;n.find(".content-text-search").keyup(function(){null!==e&&clearTimeout(e),e=setTimeout(function(){t()},500)})}),void 0!==jQuery.fn.soPanelsSetupBuilderWidget&&f.filter(".siteorigin-widget-field-type-builder").each(function(){C(this).find("> .siteorigin-page-builder-field").each(function(){var e=C(this);e.soPanelsSetupBuilderWidget({builderType:e.data("type")})})});var u=function(){var a=C(this),e=a.closest("[data-state-emitter]").data("state-emitter");if(void 0!==e){var i=function(i,e){if(void 0===sowEmitters[i.callback]||"_"===i.callback.substr(0,1))return e;if(a.is('[type="radio"]')&&!a.is(":checked"))return e;var t=sowbForms.getContainerFieldId(a,"repeater",".siteorigin-widget-field-repeater-item");!1!==t&&(i.args=i.args.map(function(e){return e.replace("{$repeater}",t)}));var r=sowbForms.getContainerFieldId(a,"widget",".siteorigin-widget-widget");!1===r||i.hasOwnProperty("widgetFieldId")||(i.widgetFieldId=r,i.args=i.args.map(function(e){return e="conditional"===i.callback?e.replace(/(.*)(\[.*)/,"$1_"+r+"$2"):e+"_"+r}));var n=a.is('[type="checkbox"]')?a.is(":checked"):a.val();return C.extend(e,sowEmitters[i.callback](n,i.args))},t={default:""};void 0===e.length&&(e=[e]);for(var r=0;r<e.length;r++)t=i(e[r],t);var n=o.data("states");for(var s in void 0===n&&(n={default:""}),t)void 0!==n[s]&&t[s]===n[s]||(n[s]=t[s],o.trigger("sowstatechange",[s,t[s]]));o.data("states",n)}};f.filter("[data-state-emitter]").each(function(){var e=C(this).find(".siteorigin-widget-input");e.on("keyup change",u),e.each(function(){var e=C(this);e.is(":radio")?e.is(":checked")&&u.call(e[0]):u.call(e[0])})}),t.trigger("sowsetupform",f).data("sow-form-setup",!0),f.trigger("sowsetupformfield"),t.find(".siteorigin-widget-field-repeater-item").trigger("updateFieldPositions"),(r.hasClass("wp-customizer")||r.hasClass("widgets-php"))&&t.closest(".ui-sortable").on("sortstop",function(e,i){i.item.find(".siteorigin-widget-form").find("> .siteorigin-widget-field").trigger("sowsetupformfield")}),y=!1})},C.fn.sowSetupPreview=function(){var r=C(this);r.siblings(".siteorigin-widget-preview").find("> a").click(function(e){e.preventDefault();var i=sowbForms.getWidgetFormValues(r),t=C(C("#so-widgets-bundle-tpl-preview-dialog").html().trim()).appendTo("body");t.find('input[name="data"]').val(JSON.stringify(i)),t.find('input[name="class"]').val(r.data("class")),t.find("iframe").on("load",function(){C(this).css("visibility","visible")}),t.find("form").submit(),t.find(".close").click(function(){t.remove()})})},C.fn.sowSetupRepeater=function(){return C(this).each(function(e,i){var n=C(i),t=n.find(".siteorigin-widget-field-repeater-items"),a=n.data("repeater-name");t.bind("updateFieldPositions",function(){var e=C(this),i=e.find("> .siteorigin-widget-field-repeater-item");i.each(function(r,e){C(e).find(".siteorigin-widget-input").each(function(e,i){var t=C(i).data("repeater-positions");void 0===t&&(t={}),t[a]=r,C(i).data("repeater-positions",t)})}),e.find(".siteorigin-widget-input").each(function(e,i){var t=C(i),r=t.data("repeater-positions");if(void 0!==r){var n=t.attr("data-original-name");if(n||(t.attr("data-original-name",t.attr("name")),n=t.attr("name")),!n)return;if(r)for(var a in r)n=n.replace("#"+a+"#",r[a]);t.attr("name",n)}}),e.data("initialSetup")||(e.find(".siteorigin-widget-input").each(function(e,i){var t=C(i);t.prop("checked",t.prop("defaultChecked"))}),e.data("initialSetup",!0));var t=n.data("scroll-count")?parseInt(n.data("scroll-count")):0;if(0<t&&i.length>t){var r=i.first().outerHeight();e.css("max-height",r*t).css("overflow","auto")}else e.css("max-height","").css("overflow","")}),t.sortable({handle:".siteorigin-widget-field-repeater-item-top",items:"> .siteorigin-widget-field-repeater-item",update:function(){t.find('input[type="radio"].siteorigin-widget-input').attr("name",""),t.trigger("updateFieldPositions"),n.trigger("change")},sortstop:function(e,i){i.item.is(".siteorigin-widget-field-repeater-item")?i.item.find("> .siteorigin-widget-field-repeater-item-form").each(function(){C(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")}):i.item.find(".siteorigin-widget-form").find("> .siteorigin-widget-field").trigger("sowsetupformfield");n.trigger("change")}}),t.trigger("updateFieldPositions"),n.find("> .siteorigin-widget-field-repeater-add").disableSelection().click(function(e){e.preventDefault(),n.closest(".siteorigin-widget-field-repeater").sowAddRepeaterItem().find("> .siteorigin-widget-field-repeater-items").slideDown("fast",function(){C(window).resize()})}),n.find("> .siteorigin-widget-field-repeater-top > .siteorigin-widget-field-repeater-expand").click(function(e){e.preventDefault(),n.closest(".siteorigin-widget-field-repeater").find("> .siteorigin-widget-field-repeateritems-").slideToggle("fast",function(){C(window).resize()})})})},C.fn.sowAddRepeaterItem=function(){return C(this).each(function(e,i){var t=C(i),r=t.find("> .siteorigin-widget-field-repeater-items").children().length+1,n=C("<div>"+t.find("> .siteorigin-widget-field-repeater-item-html").html()+"</div>");n.find(".siteorigin-widget-input[data-name]").each(function(){var e=C(this);0===e.closest(".siteorigin-widget-field-repeater-item-html").length&&e.attr("name",C(this).data("name"))});var a="";n.find("> .siteorigin-widget-field").each(function(e,i){var t=i.outerHTML;C(i).is(".siteorigin-widget-field-type-repeater")||(t=t.replace(/_id_/g,r)),a+=t});var s=void 0!==t.attr("readonly"),o=C('<div class="siteorigin-widget-field-repeater-item ui-draggable" />').append(C('<div class="siteorigin-widget-field-repeater-item-top" />').append(C('<div class="siteorigin-widget-field-expand" />')).append(s?"":C('<div class="siteorigin-widget-field-copy" />')).append(s?"":C('<div class="siteorigin-widget-field-remove" />')).append(C("<h4 />").html(t.data("item-name")))).append(C('<div class="siteorigin-widget-field-repeater-item-form" />').html(a));t.find("> .siteorigin-widget-field-repeater-items").append(o).sortable("refresh").trigger("updateFieldPositions"),o.sowSetupRepeaterItems(),o.hide().slideDown("fast",function(){C(window).resize()}),t.trigger("change")})},C.fn.sowRemoveRepeaterItem=function(){return C(this).each(function(e,i){var t=C(this).closest(".siteorigin-widget-field-repeater-items");C(this).remove(),t.sortable("refresh").trigger("updateFieldPositions"),C(i).trigger("change")})},C.fn.sowSetupRepeaterItems=function(){return C(this).each(function(e,i){var _=C(i);if(void 0===_.data("sowrepeater-actions-setup")){var t=_.closest(".siteorigin-widget-field-repeater"),r=_.find("> .siteorigin-widget-field-repeater-item-top"),n=t.data("item-label");if(n&&n.selector){var a=function(){var e=n.hasOwnProperty("valueMethod")&&n.valueMethod?n.valueMethod:"val",i=_.find(n.selector)[e]();i&&(80<i.length&&(i=i.substr(0,79)+"..."),r.find("h4").text(i))};a();var s=n.hasOwnProperty("updateEvent")&&n.updateEvent?n.updateEvent:"change";_.bind(s,a)}r.click(function(e){"siteorigin-widget-field-remove"!==e.target.className&&"siteorigin-widget-field-copy"!==e.target.className&&(e.preventDefault(),C(this).closest(".siteorigin-widget-field-repeater-item").find(".siteorigin-widget-field-repeater-item-form").eq(0).slideToggle("fast",function(){C(window).resize(),C(this).is(":visible")?(C(this).trigger("slideToggleOpenComplete"),C(this).find(".siteorigin-widget-field-type-section > .siteorigin-widget-section > .siteorigin-widget-field,> .siteorigin-widget-field").each(function(e,i){var t=C(i);t.is(":visible")&&t.trigger("sowsetupformfield")})):C(this).trigger("slideToggleCloseComplete")}))}),r.find(".siteorigin-widget-field-remove").click(function(e,i){e.preventDefault();var t=C(this).closest(".siteorigin-widget-field-repeater-items"),r=C(this).closest(".siteorigin-widget-field-repeater-item"),n=function(){r.remove(),t.sortable("refresh").trigger("updateFieldPositions"),C(window).resize()};i&&i.silent?n():confirm(soWidgets.sure)&&r.slideUp("fast",n),_.trigger("change")}),r.find(".siteorigin-widget-field-copy").click(function(e){e.preventDefault();var h=C(this).closest(".siteorigin-widget-form-main"),b=C(this).closest(".siteorigin-widget-field-repeater-item"),y=b.clone(),i=b.closest(".siteorigin-widget-field-repeater-items"),F=i.children().length,k={};y.find("*[name]").each(function(){var e=C(this),i=e.attr("id"),t=e.attr("name");if(e.is("textarea")&&e.parent().is(".wp-editor-container")&&"undefined"!=typeof tinymce){e.parent().empty().append(e),e.css("display","");var r=tinymce.get(i);r&&e.val(r.getContent())}else if(e.is(".wp-color-picker")){var n=e.closest(".wp-picker-container"),a=e.closest(".siteorigin-widget-field");n.remove(),a.append(e.remove())}else{var s=i?b.find("#"+i):b.find('[name="'+t+'"]');s.length&&null!=s.val()&&e.val(s.val())}if(i){var o,d;if(e.is('[type="radio"]')){o=i.replace(/-\d+-\d+$/,"");var l=i.replace(/-\d+$/,"");if(!k[o]){var g={};k[o]=h.find(".siteorigin-widget-input[id^="+o+"]").not("[id*=_id_]").filter(function(e,i){var t=C(i).attr("name");return!g[t]&&(g[t]=!0)}).length+1}var f=o+"-"+k[o];d=f+i.match(/-\d+$/)[0],y.find("label[for="+l+"]").attr("for",f)}else u=new RegExp("-\\d+$"),o=i.replace(u,""),k[o]||(k[o]=h.find(".siteorigin-widget-input[id^="+o+"]").not("[id*=_id_]").length+1),d=o+"-"+k[o]++;if(e.attr("id",d),e.is(".wp-editor-area")){var c=e.closest(".siteorigin-widget-tinymce-container"),p=c.data("media-buttons");if(p&&p.html){var u=new RegExp(i,"g");p.html=p.html.replace(u,d),c.data("media-buttons",p)}}y.find("label[for="+i+"]").attr("for",d),y.find("[id*="+i+"]").each(function(){var e=C(this).attr("id").replace(i,d);C(this).attr("id",e)}),"undefined"!=typeof tinymce&&tinymce.get(d)&&tinymce.get(d).remove()}var w=b.parents(".siteorigin-widget-field-repeater").length,m=C("body");(m.hasClass("wp-customizer")||m.hasClass("widgets-php"))&&0===_.closest(".panel-dialog").length&&(w+=1);var v=t.replace(new RegExp("((?:.*?\\[\\d+\\]){"+(w-1).toString()+"})?(.*?\\[)\\d+(\\])"),"$1$2"+F.toString()+"$3");e.attr("name",v),e.data("original-name",v)}),i.append(y).sortable("refresh").trigger("updateFieldPositions"),y.sowSetupRepeaterItems(),y.hide().slideDown("fast",function(){C(window).resize()}),_.trigger("change")}),_.find("> .siteorigin-widget-field-repeater-item-form").sowSetupForm(),_.data("sowrepeater-actions-setup",!0)}})},sowbForms.getContainerFieldId=function(e,i,t){var r=i+"FieldId";this.hasOwnProperty(r)||(this[r]=1);var n=e.closest(t);if(n.length){var a=n.data("field-id");return void 0===a&&(a=this[r]++),n.data("field-id",a),a}return!1},sowbForms.getWidgetFieldVariable=function(e,i,t){var r=window.sow_field_javascript_variables[e];i=i.replace(/\[#.*?#\]/g,"");for(var n=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(i)[1].split("]["),a=n.length?r:null;n.length;)a=a[n.shift()];return a[t]},sowbForms.fetchWidgetVariable=function(i,t,r){window.sowVars=window.sowVars||{},void 0===window.sowVars[t]?C.post(soWidgets.ajaxurl,{action:"sow_get_javascript_variables",widget:t,key:i},function(e){window.sowVars[t]=e,r(window.sowVars[t][i])}):r(window.sowVars[t][i])},sowbForms.getWidgetIdBase=function(e){return e.data("id-base")},sowbForms.getWidgetFormValues=function(e){if(_.isUndefined(e))return null;var l={};return e.find("*[name]").each(function(){var i=C(this);try{var e=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(i.attr("name"));if(_.isEmpty(e))return!0;var t=(e=e[1]).split("][");t=t.map(function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e});var r=l,n=null,a=_.isString(i.attr("type"))?i.attr("type").toLowerCase():null;if("checkbox"===a)n=!!i.is(":checked")&&(""===i.val()||i.val());else if("radio"===a){if(!i.is(":checked"))return;n=i.val()}else if("TEXTAREA"===i.prop("tagName")&&i.hasClass("wp-editor-area")){var s=null;"undefined"!=typeof tinyMCE&&(s=tinyMCE.get(i.attr("id"))),n=null===s||"function"!=typeof s.getContent||s.isHidden()?i.val():s.getContent()}else if("SELECT"===i.prop("tagName")){var o=i.find("option:selected");1===o.length?n=i.find("option:selected").val():1<o.length&&(n=_.map(i.find("option:selected"),function(e,i){return C(e).val()}))}else n=i.val();for(var d=0;d<t.length;d++)d===t.length-1?""===t[d]?r.push(n):r[t[d]]=n:(_.isUndefined(r[t[d]])&&(_.isNumber(t[d+1])||""===t[d+1]?r[t[d]]=[]:r[t[d]]={}),r=r[t[d]])}catch(e){console.error("Field ["+i.attr("name")+"] could not be processed and was skipped - "+e.message)}}),l},sowbForms.setWidgetFormValues=function(e,d,v,l){v=v||!1,l=void 0!==l&&l||void 0===l;var i=0,h=function(e,m){10!=++i&&e.find("> .siteorigin-widget-field-type-repeater,> .siteorigin-widget-field-type-section > .siteorigin-widget-section > .siteorigin-widget-field-type-repeater").each(function(e,i){var t=C(this),r=t.find("> .siteorigin-widget-field-repeater"),n=r.data("repeaterName"),a=m.hasOwnProperty(n)?m[n]:null;if(t.parent().is(".siteorigin-widget-section")){var s=r.data("element-name");s=s.replace(/\[#.*?#\]/g,"");for(var o=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(s)[1].split("]["),d=o.length?m:null;o.length;){var l=o.shift();d=d.hasOwnProperty(l)?d[l]:d}a=d}if(a&&Array.isArray(a)){var g=r.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item"),f=a.length,c=g.length;if(c<f)for(var p=0;p<f-c;p++)r.find("> .siteorigin-widget-field-repeater-add").click();else if(!v&&f<c)for(var u=f;u<c;u++){C(g.eq(u)).find("> .siteorigin-widget-field-repeater-item-top").find(".siteorigin-widget-field-remove").trigger("click",{silent:!0})}g=r.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item");for(var w=0;w<g.length;w++)g.eq(w).find("> .siteorigin-widget-field-repeater-item-form"),h(g.eq(w).find("> .siteorigin-widget-field-repeater-item-form"),a[w])}}),--i};h(e,d),e.find("*[name]").each(function(){var e=C(this),i=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(e.attr("name"));if(null==i)return!0;var t=(i=i[1]).split("][");t=t.map(function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e});for(var r,n=d,a=0;a<t.length;a++){if(!n.hasOwnProperty(t[a])){if(v)return!0;break}a===t.length-1?r=n[t[a]]:n=n[t[a]]}if("checkbox"===e.attr("type"))e.prop("checked",r);else if("radio"===e.attr("type"))e.prop("checked",r===e.val());else if("TEXTAREA"===e.prop("tagName")&&e.hasClass("wp-editor-area")){var s=null;"undefined"!=typeof tinyMCE&&(s=tinyMCE.get(e.attr("id"))),null!==s&&"function"==typeof s.setContent&&!s.isHidden()&&e.parent().is(":visible")?s.initialized?s.setContent(r):s.on("init",function(){s.setContent(r)}):e.val(r)}else if(e.is(".panels-data")){e.val(r);var o=e.data("builder");o&&o.setDataField(e)}else e.val(r);l&&e.trigger("change")})},sowbForms.displayNotice=function(e,i,t,r,n){var a=C('<div class="siteorigin-widget-form-notification"></div>');i&&a.append("<span>"+i+"</span>"),r&&r.length&&r.forEach(function(e){var i="";e.classes&&e.classes.length&&(i=" "+e.classes.join(" "));var t=C('<a class="button button-small'+i+'">'+e.label+"</a>");e.url&&t.attr("href",e.url),e.callback&&t.on("click",function(){e.callback(a)}),a.append(t)}),t&&a.append("<div><small>"+t+"</small></div>"),n?n.before(a):e.prepend(a)},C(".widgets-holder-wrap").on("click",".widget:has(.siteorigin-widget-form-main) .widget-top",function(){var e=C(this).closest(".widget").find(".siteorigin-widget-form-main");setTimeout(function(){e.sowSetupForm()},200)});var e=C("body");e.hasClass("wp-customizer")&&C(document).on("widget-added",function(e,i){i.find(".siteorigin-widget-form").sowSetupForm()}),e.hasClass("block-editor-page")&&C(document).on("panels_setup_preview",function(){C(sowb).trigger("setup_widgets",{preview:!0})}),C(document).on("open_dialog",function(e,i){i.$el.find(".so-panels-dialog").is(".so-panels-dialog-edit-widget")&&i.$el.find(".siteorigin-widget-form-main").find("> .siteorigin-widget-field").trigger("sowsetupformfield")}),C(function(){C(document).trigger("sowadminloaded")})}(jQuery);var sowEmitters={_match:function(e,i){void 0===i&&(i=".*");var t=new RegExp("^([a-zA-Z0-9_-]+)(\\[([a-zA-Z0-9_-]+)\\])? *: *("+i+") *$").exec(e);if(null===t)return!1;var r="",n="default";return r=void 0!==t[3]?(n=t[1],t[3]):t[1],{match:t[4].trim(),group:n,state:r}},_checker:function(e,i,t,r){var n,a={};void 0===i.length&&(i=[i]);for(var s=0;s<i.length;s++)!1!==(n=sowEmitters._match(i[s],t))&&("_true"===n.match||r(e,i,n.match))&&(a[n.group]=n.state);return a},select:function(e,i){void 0===i.length&&(i=[i]);for(var t={},r=0;r<i.length;r++)""===i[r]&&(i[r]="default"),t[i[r]]=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)})}};window.sowbForms=sowbForms;
1
+ var sowbForms=window.sowbForms||{};!function(C){C.fn.sowSetupForm=function(){return C(this).each(function(e,i){var o,t=C(i),y=!0,r=C("body"),n=t.find("input[name]");if(n.length&&-1!==n.attr("name").indexOf("__i__"))return this;if(t.is(".siteorigin-widget-form-main")){if(!0===t.data("sow-form-setup"))return!0;if(r.hasClass("widgets-php")&&!t.is(":visible")&&0===t.closest(".panel-dialog").length)return!0;t.on("sowstatechange",function(e,h,b){t.find("[data-state-handler]").each(function(){var e,i,t,r,n,a,s=C(this),o=C.extend({},s.data("state-handler"),y?s.data("state-handler-initial"):{});if(0===Object.keys(o).length)return!0;var d={},l=sowbForms.getContainerFieldId(s,"repeater",".siteorigin-widget-field-repeater-item");if(!1!==l){var g={};for(var f in o)g[f.replace("{$repeater}",l)]=o[f];o=g}var c=sowbForms.getContainerFieldId(s,"widget",".siteorigin-widget-widget");if(!1!==c){var p={};for(var u in o){var w=u.match(/_else\[(.*)\]|(.*)\[(.*)\]/);p[w&&w.length&&void 0===w[1]?w[2]+"_"+c+"["+w[3]+"]":"_else["+w[1]+"_"+c+"]"]=o[u]}o=p}for(var m in o)if(n=!1,null!==(e=m.match(/^([a-zA-Z0-9_-]+)(\[([a-zA-Z0-9_\-,]+)\])?(\[\])?$/))){if(i={group:"default",name:"",multi:!1},void 0!==e[2]?(i.group=e[1],i.name=e[3]):i.name=e[0],i.multi=void 0!==e[4],"_else"===i.group)i.group=i.name,i.name="",n=i.group===h&&void 0===d[i.group];else{a=i.name.split(",").map(function(e){return e.trim()});for(var v=0;v<a.length&&!(n=i.group===h&&a[v]===b);v++);}if(n){t=o[m],i.multi||(t=[t]);for(v=0;v<t.length;v++){if((r=void 0!==t[v][1]&&Boolean(t[v][1])?s.find(t[v][1]):s)[t[v][0]].apply(r,void 0!==t[v][2]?t[v][2]:[]),r.is(".siteorigin-widget-field:visible"))if(r.is(".siteorigin-widget-field-type-section"))r.find("> .siteorigin-widget-section > .siteorigin-widget-field").trigger("sowsetupformfield");else r.trigger("sowsetupformfield")}d[i.group]=!0}}})}),t.sowSetupPreview();var a=(o=t).find(".siteorigin-widget-teaser");if(a.find(".dashicons-dismiss").click(function(){var e=C(this);C.get(e.data("dismiss-url")),a.slideUp("normal",function(){a.remove()})}),!t.data("backupDisabled")){var s=t.find("> .siteorigin-widgets-form-id").val(),d=t.find("> .siteorigin-widgets-form-timestamp"),l=parseInt(d.val()||0),g=JSON.parse(sessionStorage.getItem(s));g&&(g._sow_form_timestamp>l?sowbForms.displayNotice(t,soWidgets.backup.newerVersion,soWidgets.backup.replaceWarning,[{label:soWidgets.backup.restore,callback:function(e){sowbForms.setWidgetFormValues(o,g),e.slideUp("fast",function(){e.remove()})}},{label:soWidgets.backup.dismiss,callback:function(e){e.slideUp("fast",function(){sessionStorage.removeItem(s),e.remove()})}}]):sessionStorage.removeItem(s)),t.change(function(){d.val((new Date).getTime());var e=sowbForms.getWidgetFormValues(t);sessionStorage.setItem(s,JSON.stringify(e))})}}else o=t.closest(".siteorigin-widget-form-main");o.find("> .siteorigin-widgets-form-id").val();var f=t.find("> .siteorigin-widget-field");f.find("> .siteorigin-widget-section").sowSetupForm();var c=f.find("> .siteorigin-widget-widget");c.find("> .siteorigin-widget-section").sowSetupForm(),c.filter(":not(:has(> .siteorigin-widget-section))").sowSetupForm(),f.find(".siteorigin-widget-input").each(function(e,i){null===C(i).data("original-name")&&C(i).data("original-name",C(i).attr("name"))}),f.find("> .siteorigin-widget-field-repeater").sowSetupRepeater(),t.find(".siteorigin-widget-field-repeater-item").sowSetupRepeaterItems(),f.find("> .siteorigin-widget-input-color").each(function(){var e=C(this),i={change:function(e,i){setTimeout(function(){C(e.target).trigger("change")},100)}};e.data("defaultColor")&&(i.defaultColor=e.data("defaultColor")),e.wpColorPicker(i)});var p=function(){C(this).toggleClass("siteorigin-widget-section-visible"),C(this).parent().find("> .siteorigin-widget-section, > .siteorigin-widget-widget > .siteorigin-widget-section").slideToggle("fast",function(){(C(window).resize(),C(this).find("> .siteorigin-widget-field-container-state").val(C(this).is(":visible")?"open":"closed"),C(this).is(":visible"))&&C(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")})};f.filter(".siteorigin-widget-field-type-widget, .siteorigin-widget-field-type-section").find("> label").click(p),f.filter(".siteorigin-widget-field-type-posts").find(".posts-container-label-wrapper").click(p),f.filter(".siteorigin-widget-field-type-slider").each(function(){var t=C(this),r=t.find('input[type="number"]'),n=t.find(".siteorigin-widget-value-slider");n.slider({max:parseFloat(r.attr("max")),min:parseFloat(r.attr("min")),step:parseFloat(r.attr("step")),value:parseFloat(r.val()),slide:function(e,i){r.val(parseFloat(i.value)),r.trigger("change"),t.find(".siteorigin-widget-slider-value").html(i.value)}}),r.change(function(e,i){i&&i.silent||n.slider("value",parseFloat(r.val()))})}),f.filter(".siteorigin-widget-field-type-link").each(function(){var n=C(this),t=function(){var e=n.find(".content-text-search"),i=e.val(),t=e.data("postTypes"),r=n.find("ul.posts").empty().addClass("loading");C.get(soWidgets.ajaxurl,{action:"so_widgets_search_posts",query:i,postTypes:t},function(e){for(var i=0;i<e.length;i++)""===e[i].label&&(e[i].label="&nbsp;"),r.append(C("<li>").addClass("post").html(e[i].label+"<span>("+e[i].type+")</span>").data(e[i]));r.removeClass("loading")})};n.find(".select-content-button, .button-close").click(function(e){e.preventDefault(),C(this).blur();var i=n.find(".existing-content-selector");i.toggle(),i.is(":visible")&&0===i.find("ul.posts li").length&&t()}),n.on("click",".posts li",function(e){e.preventDefault();var i=C(this);n.find("input.siteorigin-widget-input").val("post: "+i.data("value")),n.change(),n.find(".existing-content-selector").toggle()});var e=null;n.find(".content-text-search").keyup(function(){null!==e&&clearTimeout(e),e=setTimeout(function(){t()},500)})}),void 0!==jQuery.fn.soPanelsSetupBuilderWidget&&f.filter(".siteorigin-widget-field-type-builder").each(function(){C(this).find("> .siteorigin-page-builder-field").each(function(){var e=C(this);e.soPanelsSetupBuilderWidget({builderType:e.data("type")})})});var u=function(){var a=C(this),e=a.closest("[data-state-emitter]").data("state-emitter");if(void 0!==e){var i=function(i,e){if(void 0===sowEmitters[i.callback]||"_"===i.callback.substr(0,1))return e;if(a.is('[type="radio"]')&&!a.is(":checked"))return e;var t=sowbForms.getContainerFieldId(a,"repeater",".siteorigin-widget-field-repeater-item");!1!==t&&(i.args=i.args.map(function(e){return e.replace("{$repeater}",t)}));var r=sowbForms.getContainerFieldId(a,"widget",".siteorigin-widget-widget");!1===r||i.hasOwnProperty("widgetFieldId")||(i.widgetFieldId=r,i.args=i.args.map(function(e){return e="conditional"===i.callback?e.replace(/(.*)(\[.*)/,"$1_"+r+"$2"):e+"_"+r}));var n=a.is('[type="checkbox"]')?a.is(":checked"):a.val();return C.extend(e,sowEmitters[i.callback](n,i.args))},t={default:""};void 0===e.length&&(e=[e]);for(var r=0;r<e.length;r++)t=i(e[r],t);var n=o.data("states");for(var s in void 0===n&&(n={default:""}),t)void 0!==n[s]&&t[s]===n[s]||(n[s]=t[s],o.trigger("sowstatechange",[s,t[s]]));o.data("states",n)}};f.filter("[data-state-emitter]").each(function(){var e=C(this).find(".siteorigin-widget-input");e.on("keyup change",u),e.each(function(){var e=C(this);e.is(":radio")?e.is(":checked")&&u.call(e[0]):u.call(e[0])})}),t.trigger("sowsetupform",f).data("sow-form-setup",!0),f.trigger("sowsetupformfield"),t.find(".siteorigin-widget-field-repeater-item").trigger("updateFieldPositions"),(r.hasClass("wp-customizer")||r.hasClass("widgets-php"))&&t.closest(".ui-sortable").on("sortstop",function(e,i){i.item.find(".siteorigin-widget-form").find("> .siteorigin-widget-field").trigger("sowsetupformfield")}),y=!1})},C.fn.sowSetupPreview=function(){var r=C(this);r.siblings(".siteorigin-widget-preview").find("> a").click(function(e){e.preventDefault();var i=sowbForms.getWidgetFormValues(r),t=C(C("#so-widgets-bundle-tpl-preview-dialog").html().trim()).appendTo("body");t.find('input[name="data"]').val(JSON.stringify(i)),t.find('input[name="class"]').val(r.data("class")),t.find("iframe").on("load",function(){C(this).css("visibility","visible")}),t.find("form").submit(),t.find(".close").click(function(){t.remove()})})},C.fn.sowSetupRepeater=function(){return C(this).each(function(e,i){var n=C(i),t=n.find(".siteorigin-widget-field-repeater-items"),a=n.data("repeater-name");t.bind("updateFieldPositions",function(){var e=C(this),i=e.find("> .siteorigin-widget-field-repeater-item");i.each(function(r,e){C(e).find(".siteorigin-widget-input").each(function(e,i){var t=C(i).data("repeater-positions");void 0===t&&(t={}),t[a]=r,C(i).data("repeater-positions",t)})}),e.find(".siteorigin-widget-input").each(function(e,i){var t=C(i),r=t.data("repeater-positions");if(void 0!==r){var n=t.attr("data-original-name");if(n||(t.attr("data-original-name",t.attr("name")),n=t.attr("name")),!n)return;if(r)for(var a in r)n=n.replace("#"+a+"#",r[a]);t.attr("name",n)}}),e.data("initialSetup")||(e.find(".siteorigin-widget-input").each(function(e,i){var t=C(i);t.prop("checked",t.prop("defaultChecked"))}),e.data("initialSetup",!0));var t=n.data("scroll-count")?parseInt(n.data("scroll-count")):0;if(0<t&&i.length>t){var r=i.first().outerHeight();e.css("max-height",r*t).css("overflow","auto")}else e.css("max-height","").css("overflow","")}),t.sortable({handle:".siteorigin-widget-field-repeater-item-top",items:"> .siteorigin-widget-field-repeater-item",update:function(){t.find('input[type="radio"].siteorigin-widget-input').attr("name",""),t.trigger("updateFieldPositions"),n.trigger("change")},sortstop:function(e,i){i.item.is(".siteorigin-widget-field-repeater-item")?i.item.find("> .siteorigin-widget-field-repeater-item-form").each(function(){C(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")}):i.item.find(".siteorigin-widget-form").find("> .siteorigin-widget-field").trigger("sowsetupformfield");n.trigger("change")}}),t.trigger("updateFieldPositions"),n.find("> .siteorigin-widget-field-repeater-add").disableSelection().click(function(e){e.preventDefault(),n.closest(".siteorigin-widget-field-repeater").sowAddRepeaterItem().find("> .siteorigin-widget-field-repeater-items").slideDown("fast",function(){C(window).resize()})}),n.find("> .siteorigin-widget-field-repeater-top > .siteorigin-widget-field-repeater-expand").click(function(e){e.preventDefault(),n.closest(".siteorigin-widget-field-repeater").find("> .siteorigin-widget-field-repeateritems-").slideToggle("fast",function(){C(window).resize()})})})},C.fn.sowAddRepeaterItem=function(){return C(this).each(function(e,i){var t=C(i),r=t.find("> .siteorigin-widget-field-repeater-items").children().length+1,n=C("<div>"+t.find("> .siteorigin-widget-field-repeater-item-html").html()+"</div>");n.find(".siteorigin-widget-input[data-name]").each(function(){var e=C(this);0===e.closest(".siteorigin-widget-field-repeater-item-html").length&&e.attr("name",C(this).data("name"))});var a="";n.find("> .siteorigin-widget-field").each(function(e,i){var t=i.outerHTML;C(i).is(".siteorigin-widget-field-type-repeater")||(t=t.replace(/_id_/g,r)),a+=t});var s=void 0!==t.attr("readonly"),o=C('<div class="siteorigin-widget-field-repeater-item ui-draggable" />').append(C('<div class="siteorigin-widget-field-repeater-item-top" />').append(C('<div class="siteorigin-widget-field-expand" />')).append(s?"":C('<div class="siteorigin-widget-field-copy" />')).append(s?"":C('<div class="siteorigin-widget-field-remove" />')).append(C("<h4 />").html(t.data("item-name")))).append(C('<div class="siteorigin-widget-field-repeater-item-form" />').html(a));t.find("> .siteorigin-widget-field-repeater-items").append(o).sortable("refresh").trigger("updateFieldPositions"),o.sowSetupRepeaterItems(),o.hide().slideDown("fast",function(){C(window).resize()}),t.trigger("change")})},C.fn.sowRemoveRepeaterItem=function(){return C(this).each(function(e,i){var t=C(this).closest(".siteorigin-widget-field-repeater-items");C(this).remove(),t.sortable("refresh").trigger("updateFieldPositions"),C(i).trigger("change")})},C.fn.sowSetupRepeaterItems=function(){return C(this).each(function(e,i){var _=C(i);if(void 0===_.data("sowrepeater-actions-setup")){var a=_.closest(".siteorigin-widget-field-repeater"),t=_.find("> .siteorigin-widget-field-repeater-item-top"),r=a.data("item-label");if(r&&r.selector){var n=function(){var e=r.hasOwnProperty("valueMethod")&&r.valueMethod?r.valueMethod:"val",i=_.find(r.selector)[e]();i&&(80<i.length&&(i=i.substr(0,79)+"..."),t.find("h4").text(i))};n();var s=r.hasOwnProperty("updateEvent")&&r.updateEvent?r.updateEvent:"change";_.bind(s,n)}t.click(function(e){"siteorigin-widget-field-remove"!==e.target.className&&"siteorigin-widget-field-copy"!==e.target.className&&(e.preventDefault(),C(this).closest(".siteorigin-widget-field-repeater-item").find(".siteorigin-widget-field-repeater-item-form").eq(0).slideToggle("fast",function(){C(window).resize(),C(this).is(":visible")?(C(this).trigger("slideToggleOpenComplete"),C(this).find(".siteorigin-widget-field-type-section > .siteorigin-widget-section > .siteorigin-widget-field,> .siteorigin-widget-field").each(function(e,i){var t=C(i);t.is(":visible")&&t.trigger("sowsetupformfield")})):C(this).trigger("slideToggleCloseComplete")}))}),t.find(".siteorigin-widget-field-remove").click(function(e,i){e.preventDefault();var t=C(this).closest(".siteorigin-widget-field-repeater-items"),r=C(this).closest(".siteorigin-widget-field-repeater-item"),n=function(){r.remove(),t.sortable("refresh").trigger("updateFieldPositions"),C(window).resize(),a.trigger("change")};i&&i.silent?n():confirm(soWidgets.sure)&&r.slideUp("fast",n)}),t.find(".siteorigin-widget-field-copy").click(function(e){e.preventDefault();var h=C(this).closest(".siteorigin-widget-form-main"),b=C(this).closest(".siteorigin-widget-field-repeater-item"),y=b.clone(),i=b.closest(".siteorigin-widget-field-repeater-items"),F=i.children().length,k={};y.find("*[name]").each(function(){var e=C(this),i=e.attr("id"),t=e.attr("name");if(e.is("textarea")&&e.parent().is(".wp-editor-container")&&"undefined"!=typeof tinymce){e.parent().empty().append(e),e.css("display","");var r=tinymce.get(i);r&&e.val(r.getContent())}else if(e.is(".wp-color-picker")){var n=e.closest(".wp-picker-container"),a=e.closest(".siteorigin-widget-field");n.remove(),a.append(e.remove())}else{var s=i?b.find("#"+i):b.find('[name="'+t+'"]');s.length&&null!=s.val()&&e.val(s.val())}if(i){var o,d;if(e.is('[type="radio"]')){o=i.replace(/-\d+-\d+$/,"");var l=i.replace(/-\d+$/,"");if(!k[o]){var g={};k[o]=h.find(".siteorigin-widget-input[id^="+o+"]").not("[id*=_id_]").filter(function(e,i){var t=C(i).attr("name");return!g[t]&&(g[t]=!0)}).length+1}var f=o+"-"+k[o];d=f+i.match(/-\d+$/)[0],y.find("label[for="+l+"]").attr("for",f)}else u=new RegExp("-\\d+$"),o=i.replace(u,""),k[o]||(k[o]=h.find(".siteorigin-widget-input[id^="+o+"]").not("[id*=_id_]").length+1),d=o+"-"+k[o]++;if(e.attr("id",d),e.is(".wp-editor-area")){var c=e.closest(".siteorigin-widget-tinymce-container"),p=c.data("media-buttons");if(p&&p.html){var u=new RegExp(i,"g");p.html=p.html.replace(u,d),c.data("media-buttons",p)}}y.find("label[for="+i+"]").attr("for",d),y.find("[id*="+i+"]").each(function(){var e=C(this).attr("id").replace(i,d);C(this).attr("id",e)}),"undefined"!=typeof tinymce&&tinymce.get(d)&&tinymce.get(d).remove()}var w=b.parents(".siteorigin-widget-field-repeater").length,m=C("body");(m.hasClass("wp-customizer")||m.hasClass("widgets-php"))&&0===_.closest(".panel-dialog").length&&(w+=1);var v=t.replace(new RegExp("((?:.*?\\[\\d+\\]){"+(w-1).toString()+"})?(.*?\\[)\\d+(\\])"),"$1$2"+F.toString()+"$3");e.attr("name",v),e.data("original-name",v)}),i.append(y).sortable("refresh").trigger("updateFieldPositions"),y.sowSetupRepeaterItems(),y.hide().slideDown("fast",function(){C(window).resize()}),_.trigger("change")}),_.find("> .siteorigin-widget-field-repeater-item-form").sowSetupForm(),_.data("sowrepeater-actions-setup",!0)}})},sowbForms.getContainerFieldId=function(e,i,t){var r=i+"FieldId";this.hasOwnProperty(r)||(this[r]=1);var n=e.closest(t);if(n.length){var a=n.data("field-id");return void 0===a&&(a=this[r]++),n.data("field-id",a),a}return!1},sowbForms.getWidgetFieldVariable=function(e,i,t){var r=window.sow_field_javascript_variables[e];i=i.replace(/\[#.*?#\]/g,"");for(var n=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(i)[1].split("]["),a=n.length?r:null;n.length;)a=a[n.shift()];return a[t]},sowbForms.fetchWidgetVariable=function(i,t,r){window.sowVars=window.sowVars||{},void 0===window.sowVars[t]?C.post(soWidgets.ajaxurl,{action:"sow_get_javascript_variables",widget:t,key:i},function(e){window.sowVars[t]=e,r(window.sowVars[t][i])}):r(window.sowVars[t][i])},sowbForms.getWidgetIdBase=function(e){return e.data("id-base")},sowbForms.getWidgetFormValues=function(e){if(_.isUndefined(e))return null;var l={};return e.find("*[name]").each(function(){var i=C(this);try{var e=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(i.attr("name"));if(_.isEmpty(e))return!0;var t=(e=e[1]).split("][");t=t.map(function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e});var r=l,n=null,a=_.isString(i.attr("type"))?i.attr("type").toLowerCase():null;if("checkbox"===a)n=!!i.is(":checked")&&(""===i.val()||i.val());else if("radio"===a){if(!i.is(":checked"))return;n=i.val()}else if("TEXTAREA"===i.prop("tagName")&&i.hasClass("wp-editor-area")){var s=null;"undefined"!=typeof tinyMCE&&(s=tinyMCE.get(i.attr("id"))),n=null===s||"function"!=typeof s.getContent||s.isHidden()?i.val():s.getContent()}else if("SELECT"===i.prop("tagName")){var o=i.find("option:selected");1===o.length?n=i.find("option:selected").val():1<o.length&&(n=_.map(i.find("option:selected"),function(e,i){return C(e).val()}))}else n=i.val();for(var d=0;d<t.length;d++)d===t.length-1?""===t[d]?r.push(n):r[t[d]]=n:(_.isUndefined(r[t[d]])&&(_.isNumber(t[d+1])||""===t[d+1]?r[t[d]]=[]:r[t[d]]={}),r=r[t[d]])}catch(e){console.error("Field ["+i.attr("name")+"] could not be processed and was skipped - "+e.message)}}),l},sowbForms.setWidgetFormValues=function(e,d,v,l){v=v||!1,l=void 0!==l&&l||void 0===l;var i=0,h=function(e,m){10!=++i&&e.find("> .siteorigin-widget-field-type-repeater,> .siteorigin-widget-field-type-section > .siteorigin-widget-section > .siteorigin-widget-field-type-repeater").each(function(e,i){var t=C(this),r=t.find("> .siteorigin-widget-field-repeater"),n=r.data("repeaterName"),a=m.hasOwnProperty(n)?m[n]:null;if(t.parent().is(".siteorigin-widget-section")){var s=r.data("element-name");s=s.replace(/\[#.*?#\]/g,"");for(var o=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(s)[1].split("]["),d=o.length?m:null;o.length;){var l=o.shift();d=d.hasOwnProperty(l)?d[l]:d}a=d}if(a&&Array.isArray(a)){var g=r.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item"),f=a.length,c=g.length;if(c<f)for(var p=0;p<f-c;p++)r.find("> .siteorigin-widget-field-repeater-add").click();else if(!v&&f<c)for(var u=f;u<c;u++){C(g.eq(u)).find("> .siteorigin-widget-field-repeater-item-top").find(".siteorigin-widget-field-remove").trigger("click",{silent:!0})}g=r.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item");for(var w=0;w<g.length;w++)g.eq(w).find("> .siteorigin-widget-field-repeater-item-form"),h(g.eq(w).find("> .siteorigin-widget-field-repeater-item-form"),a[w])}}),--i};h(e,d),e.find("*[name]").each(function(){var e=C(this),i=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(e.attr("name"));if(null==i)return!0;var t=(i=i[1]).split("][");t=t.map(function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e});for(var r,n=d,a=0;a<t.length;a++){if(!n.hasOwnProperty(t[a])){if(v)return!0;break}a===t.length-1?r=n[t[a]]:n=n[t[a]]}if("checkbox"===e.attr("type"))e.prop("checked",r);else if("radio"===e.attr("type"))e.prop("checked",r===e.val());else if("TEXTAREA"===e.prop("tagName")&&e.hasClass("wp-editor-area")){var s=null;"undefined"!=typeof tinyMCE&&(s=tinyMCE.get(e.attr("id"))),null!==s&&"function"==typeof s.setContent&&!s.isHidden()&&e.parent().is(":visible")?s.initialized?s.setContent(r):s.on("init",function(){s.setContent(r)}):e.val(r)}else if(e.is(".panels-data")){e.val(r);var o=e.data("builder");o&&o.setDataField(e)}else e.val(r);l&&(e.trigger("change"),this.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0})))})},sowbForms.displayNotice=function(e,i,t,r,n){var a=C('<div class="siteorigin-widget-form-notification"></div>');i&&a.append("<span>"+i+"</span>"),r&&r.length&&r.forEach(function(e){var i="";e.classes&&e.classes.length&&(i=" "+e.classes.join(" "));var t=C('<a class="button button-small'+i+'">'+e.label+"</a>");e.url&&t.attr("href",e.url),e.callback&&t.on("click",function(){e.callback(a)}),a.append(t)}),t&&a.append("<div><small>"+t+"</small></div>"),n?n.before(a):e.prepend(a)},C(".widgets-holder-wrap").on("click",".widget:has(.siteorigin-widget-form-main) .widget-top",function(){var e=C(this).closest(".widget").find(".siteorigin-widget-form-main");setTimeout(function(){e.sowSetupForm()},200)});var e=C("body");e.hasClass("wp-customizer")&&C(document).on("widget-added",function(e,i){i.find(".siteorigin-widget-form").sowSetupForm()}),e.hasClass("block-editor-page")&&C(document).on("panels_setup_preview",function(){window.hasOwnProperty("sowb")&&C(sowb).trigger("setup_widgets",{preview:!0})}),C(document).on("open_dialog",function(e,i){i.$el.find(".so-panels-dialog").is(".so-panels-dialog-edit-widget")&&i.$el.find(".siteorigin-widget-form-main").find("> .siteorigin-widget-field").trigger("sowsetupformfield")}),C(function(){C(document).trigger("sowadminloaded")})}(jQuery);var sowEmitters={_match:function(e,i){void 0===i&&(i=".*");var t=new RegExp("^([a-zA-Z0-9_-]+)(\\[([a-zA-Z0-9_-]+)\\])? *: *("+i+") *$").exec(e);if(null===t)return!1;var r="",n="default";return r=void 0!==t[3]?(n=t[1],t[3]):t[1],{match:t[4].trim(),group:n,state:r}},_checker:function(e,i,t,r){var n,a={};void 0===i.length&&(i=[i]);for(var s=0;s<i.length;s++)!1!==(n=sowEmitters._match(i[s],t))&&("_true"===n.match||r(e,i,n.match))&&(a[n.group]=n.state);return a},select:function(e,i){void 0===i.length&&(i=[i]);for(var t={},r=0;r<i.length;r++)""===i[r]&&(i[r]="default"),t[i[r]]=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)})}};window.sowbForms=sowbForms;
base/js/meta-box-manager.js CHANGED
@@ -1,13 +1,13 @@
1
- /* globals jQuery, sowbForms */
2
-
3
- //Catch Update button click and transform widgets post meta data before event is propagated.
4
- (function ($) {
5
- $('#post').on( 'submit',
6
- function ( event ) {
7
- var $el = $( '#siteorigin-widgets-meta-box' );
8
- var data = sowbForms.getWidgetFormValues( $el );
9
-
10
- $el.find( 'input[name="widget_post_meta"]' ).val( JSON.stringify( data ) );
11
- }
12
- );
13
- })(jQuery);
1
+ /* globals jQuery, sowbForms */
2
+
3
+ //Catch Update button click and transform widgets post meta data before event is propagated.
4
+ (function ($) {
5
+ $('#post').on( 'submit',
6
+ function ( event ) {
7
+ var $el = $( '#siteorigin-widgets-meta-box' );
8
+ var data = sowbForms.getWidgetFormValues( $el );
9
+
10
+ $el.find( 'input[name="widget_post_meta"]' ).val( JSON.stringify( data ) );
11
+ }
12
+ );
13
+ })(jQuery);
base/less/mixins.less CHANGED
@@ -1,194 +1,194 @@
1
- .gradient(@color: #F5F5F5, @start: #EEE, @stop: #FFF) {
2
- background: @color;
3
- background: -webkit-gradient(linear, left bottom, left top, color-stop(0, @start), color-stop(1, @stop));
4
- background: -ms-linear-gradient(bottom,@start,@stop);
5
- background: -moz-linear-gradient(center bottom,@start 0%,@stop 100%);
6
- background: -o-linear-gradient(@stop,@start);
7
- filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)", @stop, @start));
8
- }
9
-
10
- .bw-gradient(@color: #F5F5F5, @start: 0, @stop: 255) {
11
- background: @color;
12
- background: -webkit-gradient(linear, left bottom, left top, color-stop(0, rgb(@start,@start,@start)), color-stop(1, rgb(@stop,@stop,@stop)));
13
- background: -ms-linear-gradient(bottom, rgb(@start,@start,@start) 0%, rgb(@stop,@stop,@stop) 100%);
14
- background: -moz-linear-gradient(center bottom, rgb(@start,@start,@start) 0%, rgb(@stop,@stop,@stop) 100%);
15
- background: -o-linear-gradient(rgb(@stop,@stop,@stop), rgb(@start,@start,@start));
16
- background: linear-gradient(rgb(@stop,@stop,@stop), rgb(@start,@start,@start));
17
-
18
- filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",rgb(@stop,@stop,@stop), rgb(@start,@start,@start)));
19
- }
20
-
21
- .linear-gradient(@color, @gradient) {
22
- background: @color;
23
- background: -moz-linear-gradient(@gradient);
24
- background: -webkit-linear-gradient(@gradient);
25
- background: -o-linear-gradient(@gradient);
26
- background: -ms-linear-gradient(@gradient);
27
- background: linear-gradient(@gradient);
28
- }
29
-
30
- .bordered(@top-color: #EEE, @right-color: #EEE, @bottom-color: #EEE, @left-color: #EEE) {
31
- border-top: solid 1px @top-color;
32
- border-left: solid 1px @left-color;
33
- border-right: solid 1px @right-color;
34
- border-bottom: solid 1px @bottom-color;
35
- }
36
-
37
- .drop-shadow(@x-axis: 0, @y-axis: 1px, @blur: 2px, @alpha: 0.1) {
38
- -webkit-box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha);
39
- -moz-box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha);
40
- box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha);
41
- }
42
-
43
- .box-shadow(@shadow) {
44
- -webkit-box-shadow: @shadow;
45
- -moz-box-shadow: @shadow;
46
- box-shadow: @shadow;
47
- }
48
-
49
- .rounded(@radius: 2px) {
50
- -webkit-border-radius: @radius;
51
- -moz-border-radius: @radius;
52
- border-radius: @radius;
53
- }
54
-
55
- .border-radius(@topright: 0, @bottomright: 0, @bottomleft: 0, @topleft: 0) {
56
- -webkit-border-top-right-radius: @topright;
57
- -webkit-border-bottom-right-radius: @bottomright;
58
- -webkit-border-bottom-left-radius: @bottomleft;
59
- -webkit-border-top-left-radius: @topleft;
60
- -moz-border-radius-topright: @topright;
61
- -moz-border-radius-bottomright: @bottomright;
62
- -moz-border-radius-bottomleft: @bottomleft;
63
- -moz-border-radius-topleft: @topleft;
64
- border-top-right-radius: @topright;
65
- border-bottom-right-radius: @bottomright;
66
- border-bottom-left-radius: @bottomleft;
67
- border-top-left-radius: @topleft;
68
- .background-clip(padding-box);
69
- }
70
-
71
- .opacity(@opacity: 0.5) {
72
- -moz-opacity: @opacity;
73
- -khtml-opacity: @opacity;
74
- -webkit-opacity: @opacity;
75
- opacity: @opacity;
76
- @opperc: @opacity * 100;
77
- -ms-filter: ~"progid:DXImageTransform.Microsoft.Alpha(opacity=@{opperc})";
78
- filter: ~"alpha(opacity=@{opperc})";
79
- }
80
-
81
- .transition-duration(@duration: 0.2s) {
82
- -moz-transition-duration: @duration;
83
- -webkit-transition-duration: @duration;
84
- -o-transition-duration: @duration;
85
- transition-duration: @duration;
86
- }
87
-
88
- .transform(...) {
89
- -webkit-transform: @arguments;
90
- -moz-transform: @arguments;
91
- -o-transform: @arguments;
92
- -ms-transform: @arguments;
93
- transform: @arguments;
94
- }
95
-
96
- .rotation(@deg:5deg) {
97
- .transform(rotate(@deg));
98
- }
99
-
100
- .scale(@ratio:1.5) {
101
- .transform(scale(@ratio));
102
- }
103
-
104
- .transition(@duration:0.2s, @on: all, @ease:ease) {
105
- -webkit-transition: @on @duration @ease;
106
- -moz-transition: @on @duration @ease;
107
- -o-transition: @on @duration @ease;
108
- transition: @on @duration @ease;
109
- }
110
-
111
- .inner-shadow(@horizontal:0, @vertical:1px, @blur:2px, @alpha: 0.4) {
112
- -webkit-box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha);
113
- -moz-box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha);
114
- box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha);
115
- }
116
-
117
- .box-sizing(@sizing: border-box) {
118
- -ms-box-sizing: @sizing;
119
- -moz-box-sizing: @sizing;
120
- -webkit-box-sizing: @sizing;
121
- box-sizing: @sizing;
122
- }
123
-
124
- .user-select(@argument: none) {
125
- -webkit-user-select: @argument;
126
- -moz-user-select: @argument;
127
- -ms-user-select: @argument;
128
- user-select: @argument;
129
- }
130
-
131
- .columns(@colwidth: 250px, @colcount: 0, @colgap: 50px, @columnRuleColor: #EEE, @columnRuleStyle: solid, @columnRuleWidth: 1px) {
132
- -moz-column-width: @colwidth;
133
- -moz-column-count: @colcount;
134
- -moz-column-gap: @colgap;
135
- -moz-column-rule-color: @columnRuleColor;
136
- -moz-column-rule-style: @columnRuleStyle;
137
- -moz-column-rule-width: @columnRuleWidth;
138
- -webkit-column-width: @colwidth;
139
- -webkit-column-count: @colcount;
140
- -webkit-column-gap: @colgap;
141
- -webkit-column-rule-color: @columnRuleColor;
142
- -webkit-column-rule-style: @columnRuleStyle;
143
- -webkit-column-rule-width: @columnRuleWidth;
144
- column-width: @colwidth;
145
- column-count: @colcount;
146
- column-gap: @colgap;
147
- column-rule-color: @columnRuleColor;
148
- column-rule-style: @columnRuleStyle;
149
- column-rule-width: @columnRuleWidth;
150
- }
151
-
152
- .translate(@x:0, @y:0) {
153
- .transform(translate(@x, @y));
154
- }
155
-
156
- .background-clip(@argument: padding-box) {
157
- -moz-background-clip: @argument;
158
- -webkit-background-clip: @argument;
159
- background-clip: @argument;
160
- }
161
-
162
- .clearfix() {
163
- zoom: 1;
164
- &:before {
165
- content: '';
166
- display: block;
167
- }
168
- &:after {
169
- content: '';
170
- display: table;
171
- clear: both;
172
- }
173
- }
174
-
175
- .button-style(@base_color, @bg_var: 3.5%, @border_darken: 18%, @border_var: 4%) {
176
- @gradient_start: darken(@base_color, @bg_var);
177
- @gradient_end: lighten(@base_color, @bg_var);
178
-
179
- @border_color: darken(@base_color, @border_darken);
180
-
181
- @border_top: lighten(@border_color, @border_var );
182
- @border_bottom: darken(@border_color, @border_var );
183
-
184
- .gradient(@base_color, @gradient_start, @gradient_end);
185
- .bordered(@border_top, @border_color, @border_bottom, @border_color);
186
- }
187
-
188
- .font(@font, @weight) when not (@font = default) {
189
- font-family: @font;
190
- font-weight: @weight;
191
- }
192
-
193
- //this is to remove annoying IDE warnings for not being able to resolve .widget-function() calls
194
  .widget-function(...){}
1
+ .gradient(@color: #F5F5F5, @start: #EEE, @stop: #FFF) {
2
+ background: @color;
3
+ background: -webkit-gradient(linear, left bottom, left top, color-stop(0, @start), color-stop(1, @stop));
4
+ background: -ms-linear-gradient(bottom,@start,@stop);
5
+ background: -moz-linear-gradient(center bottom,@start 0%,@stop 100%);
6
+ background: -o-linear-gradient(@stop,@start);
7
+ filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)", @stop, @start));
8
+ }
9
+
10
+ .bw-gradient(@color: #F5F5F5, @start: 0, @stop: 255) {
11
+ background: @color;
12
+ background: -webkit-gradient(linear, left bottom, left top, color-stop(0, rgb(@start,@start,@start)), color-stop(1, rgb(@stop,@stop,@stop)));
13
+ background: -ms-linear-gradient(bottom, rgb(@start,@start,@start) 0%, rgb(@stop,@stop,@stop) 100%);
14
+ background: -moz-linear-gradient(center bottom, rgb(@start,@start,@start) 0%, rgb(@stop,@stop,@stop) 100%);
15
+ background: -o-linear-gradient(rgb(@stop,@stop,@stop), rgb(@start,@start,@start));
16
+ background: linear-gradient(rgb(@stop,@stop,@stop), rgb(@start,@start,@start));
17
+
18
+ filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",rgb(@stop,@stop,@stop), rgb(@start,@start,@start)));
19
+ }
20
+
21
+ .linear-gradient(@color, @gradient) {
22
+ background: @color;
23
+ background: -moz-linear-gradient(@gradient);
24
+ background: -webkit-linear-gradient(@gradient);
25
+ background: -o-linear-gradient(@gradient);
26
+ background: -ms-linear-gradient(@gradient);
27
+ background: linear-gradient(@gradient);
28
+ }
29
+
30
+ .bordered(@top-color: #EEE, @right-color: #EEE, @bottom-color: #EEE, @left-color: #EEE) {
31
+ border-top: solid 1px @top-color;
32
+ border-left: solid 1px @left-color;
33
+ border-right: solid 1px @right-color;
34
+ border-bottom: solid 1px @bottom-color;
35
+ }
36
+
37
+ .drop-shadow(@x-axis: 0, @y-axis: 1px, @blur: 2px, @alpha: 0.1) {
38
+ -webkit-box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha);
39
+ -moz-box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha);
40
+ box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha);
41
+ }
42
+
43
+ .box-shadow(@shadow) {
44
+ -webkit-box-shadow: @shadow;
45
+ -moz-box-shadow: @shadow;
46
+ box-shadow: @shadow;
47
+ }
48
+
49
+ .rounded(@radius: 2px) {
50
+ -webkit-border-radius: @radius;
51
+ -moz-border-radius: @radius;
52
+ border-radius: @radius;
53
+ }
54
+
55
+ .border-radius(@topright: 0, @bottomright: 0, @bottomleft: 0, @topleft: 0) {
56
+ -webkit-border-top-right-radius: @topright;
57
+ -webkit-border-bottom-right-radius: @bottomright;
58
+ -webkit-border-bottom-left-radius: @bottomleft;
59
+ -webkit-border-top-left-radius: @topleft;
60
+ -moz-border-radius-topright: @topright;
61
+ -moz-border-radius-bottomright: @bottomright;
62
+ -moz-border-radius-bottomleft: @bottomleft;
63
+ -moz-border-radius-topleft: @topleft;
64
+ border-top-right-radius: @topright;
65
+ border-bottom-right-radius: @bottomright;
66
+ border-bottom-left-radius: @bottomleft;
67
+ border-top-left-radius: @topleft;
68
+ .background-clip(padding-box);
69
+ }
70
+
71
+ .opacity(@opacity: 0.5) {
72
+ -moz-opacity: @opacity;
73
+ -khtml-opacity: @opacity;
74
+ -webkit-opacity: @opacity;
75
+ opacity: @opacity;
76
+ @opperc: @opacity * 100;
77
+ -ms-filter: ~"progid:DXImageTransform.Microsoft.Alpha(opacity=@{opperc})";
78
+ filter: ~"alpha(opacity=@{opperc})";
79
+ }
80
+
81
+ .transition-duration(@duration: 0.2s) {
82
+ -moz-transition-duration: @duration;
83
+ -webkit-transition-duration: @duration;
84
+ -o-transition-duration: @duration;
85
+ transition-duration: @duration;
86
+ }
87
+
88
+ .transform(...) {
89
+ -webkit-transform: @arguments;
90
+ -moz-transform: @arguments;
91
+ -o-transform: @arguments;
92
+ -ms-transform: @arguments;
93
+ transform: @arguments;
94
+ }
95
+
96
+ .rotation(@deg:5deg) {
97
+ .transform(rotate(@deg));
98
+ }
99
+
100
+ .scale(@ratio:1.5) {
101
+ .transform(scale(@ratio));
102
+ }
103
+
104
+ .transition(@duration:0.2s, @on: all, @ease:ease) {
105
+ -webkit-transition: @on @duration @ease;
106
+ -moz-transition: @on @duration @ease;
107
+ -o-transition: @on @duration @ease;
108
+ transition: @on @duration @ease;
109
+ }
110
+
111
+ .inner-shadow(@horizontal:0, @vertical:1px, @blur:2px, @alpha: 0.4) {
112
+ -webkit-box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha);
113
+ -moz-box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha);
114
+ box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha);
115
+ }
116
+
117
+ .box-sizing(@sizing: border-box) {
118
+ -ms-box-sizing: @sizing;
119
+ -moz-box-sizing: @sizing;
120
+ -webkit-box-sizing: @sizing;
121
+ box-sizing: @sizing;
122
+ }
123
+
124
+ .user-select(@argument: none) {
125
+ -webkit-user-select: @argument;
126
+ -moz-user-select: @argument;
127
+ -ms-user-select: @argument;
128
+ user-select: @argument;
129
+ }
130
+
131
+ .columns(@colwidth: 250px, @colcount: 0, @colgap: 50px, @columnRuleColor: #EEE, @columnRuleStyle: solid, @columnRuleWidth: 1px) {
132
+ -moz-column-width: @colwidth;
133
+ -moz-column-count: @colcount;
134
+ -moz-column-gap: @colgap;
135
+ -moz-column-rule-color: @columnRuleColor;
136
+ -moz-column-rule-style: @columnRuleStyle;
137
+ -moz-column-rule-width: @columnRuleWidth;
138
+ -webkit-column-width: @colwidth;
139
+ -webkit-column-count: @colcount;
140
+ -webkit-column-gap: @colgap;
141
+ -webkit-column-rule-color: @columnRuleColor;
142
+ -webkit-column-rule-style: @columnRuleStyle;
143
+ -webkit-column-rule-width: @columnRuleWidth;
144
+ column-width: @colwidth;
145
+ column-count: @colcount;
146
+ column-gap: @colgap;
147
+ column-rule-color: @columnRuleColor;
148
+ column-rule-style: @columnRuleStyle;
149
+ column-rule-width: @columnRuleWidth;
150
+ }
151
+
152
+ .translate(@x:0, @y:0) {
153
+ .transform(translate(@x, @y));
154
+ }
155
+
156
+ .background-clip(@argument: padding-box) {
157
+ -moz-background-clip: @argument;
158
+ -webkit-background-clip: @argument;
159
+ background-clip: @argument;
160
+ }
161
+
162
+ .clearfix() {
163
+ zoom: 1;
164
+ &:before {
165
+ content: '';
166
+ display: block;
167
+ }
168
+ &:after {
169
+ content: '';
170
+ display: table;
171
+ clear: both;
172
+ }
173
+ }
174
+
175
+ .button-style(@base_color, @bg_var: 3.5%, @border_darken: 18%, @border_var: 4%) {
176
+ @gradient_start: darken(@base_color, @bg_var);
177
+ @gradient_end: lighten(@base_color, @bg_var);
178
+
179
+ @border_color: darken(@base_color, @border_darken);
180
+
181
+ @border_top: lighten(@border_color, @border_var );
182
+ @border_bottom: darken(@border_color, @border_var );
183
+
184
+ .gradient(@base_color, @gradient_start, @gradient_end);
185
+ .bordered(@border_top, @border_color, @border_bottom, @border_color);
186
+ }
187
+
188
+ .font(@font, @weight) when not (@font = default) {
189
+ font-family: @font;
190
+ font-weight: @weight;
191
+ }
192
+
193
+ //this is to remove annoying IDE warnings for not being able to resolve .widget-function() calls
194
  .widget-function(...){}
base/siteorigin-widget.class.php CHANGED
@@ -1,1406 +1,1406 @@
1
- <?php
2
-
3
- /**
4
- * Class SiteOrigin_Widget
5
- *
6
- * @author SiteOrigin <support@siteorigin.com>
7
- */
8
- abstract class SiteOrigin_Widget extends WP_Widget {
9
- protected $form_options;
10
- protected $base_folder;
11
- protected $field_ids;
12
- protected $fields;
13
-
14
- /**
15
- * The name of this widget class. Whatever the key for $wp_widgets_factory is.
16
- *
17
- * @var string
18
- */
19
- protected $widget_class;
20
-
21
- /**
22
- * @var array The array of registered frontend scripts
23
- */
24
- protected $frontend_scripts = array();
25
-
26
- /**
27
- * @var array The array of registered frontend styles
28
- */
29
- protected $frontend_styles = array();
30
-
31
- protected $generated_css = array();
32
- protected $current_instance;
33
- protected $instance_storage;
34
-
35
- /**
36
- * @var int How many seconds a CSS file is valid for.
37
- */
38
- static $css_expire = 604800; // 7 days
39
-
40
- /**
41
- * @param string $id
42
- * @param string $name
43
- * @param array $widget_options Optional Normal WP_Widget widget options and a few extras.
44
- * - help: A URL which, if present, causes a help link to be displayed on the Edit Widget modal.
45
- * - instance_storage: Whether or not to temporarily store instances of this widget.
46
- * - has_preview: Whether or not this widget has a preview to display. If false, the form does not output a
47
- * 'Preview' button.
48
- * @param array $control_options Optional Normal WP_Widget control options.
49
- * @param array $form_options Optional An array describing the form fields used to configure SiteOrigin widgets.
50
- * @param mixed $base_folder Optional
51
- *
52
- */
53
- function __construct($id, $name, $widget_options = array(), $control_options = array(), $form_options = array(), $base_folder = false) {
54
- $this->form_options = $form_options;
55
- $this->base_folder = $base_folder;
56
- $this->field_ids = array();
57
- $this->fields = array();
58
-
59
- $widget_options = wp_parse_args( $widget_options, array(
60
- 'has_preview' => true,
61
- ) );
62
-
63
- $control_options = wp_parse_args( $control_options, array(
64
- 'width' => 800,
65
- ) );
66
-
67
- if( empty( $this->widget_class ) ) {
68
- $this->widget_class = get_class( $this );
69
- }
70
-
71
- parent::__construct($id, $name, $widget_options, $control_options);
72
- $this->initialize();
73
-
74
- // Let other plugins do additional initializing here
75
- do_action('siteorigin_widgets_initialize_widget_' . $this->id_base, $this);
76
- }
77
-
78
- /**
79
- * Initialize this widget in whatever way we need to. Run before rendering widget or form.
80
- */
81
- function initialize(){
82
-
83
- }
84
-
85
- /**
86
- * Get the main widget form. This should be overwritten by child widgets.
87
- *
88
- * @return array
89
- */
90
- function get_widget_form(){
91
- return method_exists( $this, 'initialize_form' ) ? $this->initialize_form() : array();
92
- }
93
-
94
- private function get_cached_widget_form() {
95
- $cache_key = $this->id_base . '_form';
96
- $form_options = wp_cache_get( $cache_key, 'siteorigin_widgets' );
97
-
98
- if ( empty( $form_options ) ) {
99
- $form_options = $this->get_widget_form();
100
- wp_cache_set( $cache_key, $form_options, 'siteorigin_widgets' );
101
- }
102
-
103
- return $form_options;
104
- }
105
-
106
- /**
107
- * Check if a child widget implements a specific form type.
108
- *
109
- * @param string $form_type
110
- * @return bool
111
- */
112
- function has_form( $form_type = 'widget' ){
113
- return method_exists( $this, 'get_' . $form_type . '_form' );
114
- }
115
-
116
- /**
117
- * Get a specific type of form.
118
- *
119
- * @param $form_type
120
- * @return array The form array, or an empty array if the form doesn't exist.
121
- */
122
- function get_form( $form_type ) {
123
- return $this->has_form( $form_type ) ? call_user_func( array( $this, 'get_' . $form_type . '_form' ) ) : array();
124
- }
125
-
126
- /**
127
- * Get the main form options and allow child widgets to modify that form.
128
- *
129
- * @param bool|SiteOrigin_Widget $parent
130
- *
131
- * @return mixed
132
- */
133
- function form_options( $parent = false ) {
134
- if( empty( $this->form_options ) ) {
135
- // If the widget doesn't have form_options defined from the constructor, then it might be defining them in the get_widget_form function
136
- $this->form_options = $this->get_cached_widget_form();
137
- }
138
-
139
- $form_options = $this->modify_form( $this->form_options );
140
- if( !empty($parent) ) {
141
- $form_options = $parent->modify_child_widget_form( $form_options, $this );
142
- }
143
-
144
- // Give other plugins a way to modify this form.
145
- $form_options = apply_filters( 'siteorigin_widgets_form_options', $form_options, $this );
146
- $form_options = apply_filters( 'siteorigin_widgets_form_options_' . $this->id_base, $form_options, $this );
147
- return $form_options;
148
- }
149
-
150
- /**
151
- * Display the widget.
152
- *
153
- * @param array $args
154
- * @param array $instance
155
- */
156
- public function widget( $args, $instance ) {
157
- if( empty( $this->form_options ) ) {
158
- $form_options = $this->get_cached_widget_form();
159
- }
160
- else {
161
- $form_options = $this->modify_form( $this->form_options );
162
- }
163
-
164
- $instance = $this->modify_instance( $instance );
165
-
166
- // Filter the instance
167
- $instance = apply_filters( 'siteorigin_widgets_instance', $instance, $this );
168
- $instance = apply_filters( 'siteorigin_widgets_instance_' . $this->id_base, $instance, $this );
169
-
170
- $args = wp_parse_args( $args, array(
171
- 'before_widget' => '',
172
- 'after_widget' => '',
173
- 'before_title' => '',
174
- 'after_title' => '',
175
- ) );
176
-
177
- // Add any missing default values to the instance
178
- $instance = $this->add_defaults( $form_options, $instance );
179
-
180
- $css_name = $this->generate_and_enqueue_instance_styles( $instance );
181
- $this->enqueue_frontend_scripts( $instance );
182
-
183
- $template_vars = $this->get_template_variables($instance, $args);
184
- $template_vars = apply_filters( 'siteorigin_widgets_template_variables_' . $this->id_base, $template_vars, $instance, $args, $this );
185
-
186
- // Storage hash allows templates to get access to
187
- $template_vars[ 'storage_hash' ] = '';
188
- if( !empty($this->widget_options['instance_storage']) ) {
189
- $stored_instance = $this->modify_stored_instance($instance);
190
- // We probably don't want panels_info
191
- unset( $stored_instance['panels_info'] );
192
-
193
- $template_vars[ 'storage_hash' ] = substr( md5( serialize( $stored_instance ) ), 0, 8 );
194
- if( !empty( $stored_instance ) && !$this->is_preview( $instance ) ) {
195
- // Store this if we have a non empty instance and are not previewing
196
- set_transient('sow_inst[' . $this->id_base . '][' . $template_vars['storage_hash'] . ']', $stored_instance, 7*86400);
197
- }
198
- }
199
-
200
- if( ! method_exists( $this, 'get_html_content' ) ) {
201
- $template_file = siteorigin_widget_get_plugin_dir_path( $this->id_base ) . $this->get_template_dir( $instance ) . '/' . $this->get_template_name( $instance ) . '.php';
202
- $template_file = apply_filters('siteorigin_widgets_template_file_' . $this->id_base, $template_file, $instance, $this );
203
- $template_file = realpath($template_file);
204
-
205
- // Don't accept non PHP files
206
- if( substr($template_file, -4) != '.php' ) $template_file = false;
207
-
208
- ob_start();
209
- if( !empty($template_file) && file_exists($template_file) ) {
210
- extract( $template_vars );
211
- @ include $template_file;
212
- }
213
- $template_html = ob_get_clean();
214
-
215
- // This is a legacy, undocumented filter.
216
- $template_html = apply_filters( 'siteorigin_widgets_template', $template_html, $this->widget_class, $instance, $this );
217
- $template_html = apply_filters( 'siteorigin_widgets_template_html_' . $this->id_base, $template_html, $instance, $this );
218
- }
219
- else {
220
- $template_html = $this->get_html_content( $instance, $args, $template_vars, $css_name );
221
- }
222
-
223
- $wrapper_classes = apply_filters(
224
- 'siteorigin_widgets_wrapper_classes_' . $this->id_base,
225
- array( 'so-widget-' . $this->id_base, 'so-widget-'.$css_name ),
226
- $instance,
227
- $this
228
- );
229
- $wrapper_classes = array_map( 'sanitize_html_class', $wrapper_classes );
230
-
231
- $wrapper_data_string = $this->get_wrapper_data( $instance );
232
-
233
- do_action( 'siteorigin_widgets_before_widget_' . $this->id_base, $instance, $this );
234
- echo $args['before_widget'];
235
- echo '<div class="' . esc_attr( implode( ' ', $wrapper_classes ) ) . '"' . $wrapper_data_string . '>';
236
- echo $template_html;
237
- echo '</div>';
238
- echo $args['after_widget'];
239
- do_action( 'siteorigin_widgets_after_widget_' . $this->id_base, $instance, $this );
240
-
241
- if ( $this->is_preview( $instance ) ) {
242
- // print inline styles if we're preview the widget.
243
- siteorigin_widget_print_styles();
244
- }
245
- }
246
-
247
- private function get_wrapper_data( $instance ) {
248
- $data = apply_filters(
249
- 'siteorigin_widgets_wrapper_data_' . $this->id_base,
250
- array(),
251
- $instance,
252
- $this
253
- );
254
- $wrapper_attr_string = '';
255
- foreach ( $data as $name => $value ) {
256
- $wrapper_attr_string .= ' data-' . esc_html( $name ) . '="' . esc_attr( $value ) . '"';
257
- }
258
-
259
- return $wrapper_attr_string;
260
- }
261
-
262
- /**
263
- * Generate the CSS for this widget and display it in the appropriate way
264
- *
265
- * @param $instance array The instance array
266
- *
267
- * @return string The CSS name
268
- */
269
- function generate_and_enqueue_instance_styles( $instance ) {
270
- if( empty( $form_options ) ) {
271
- $form_options = $this->get_cached_widget_form();
272
- }
273
- else {
274
- $form_options = $this->modify_form( $this->form_options );
275
- }
276
-
277
- // We'll assume empty instances don't have styles
278
- if( empty($instance) ) return;
279
-
280
- // Make sure all the default values are in place
281
- $instance = $this->add_defaults( $form_options, $instance );
282
-
283
- $this->current_instance = $instance;
284
- $style = $this->get_style_name( $instance );
285
-
286
- $upload_dir = wp_upload_dir();
287
- $this->clear_file_cache();
288
-
289
- if( !empty($style) ) {
290
- $hash = $this->get_style_hash( $instance );
291
- $css_name = $this->id_base.'-'.$style.'-'.$hash;
292
-
293
- //Ensure styles aren't generated and enqueued more than once.
294
- $in_preview = $this->is_preview( $instance );
295
- if ( ! in_array( $css_name, $this->generated_css ) || $in_preview ) {
296
- if( $in_preview ) {
297
- siteorigin_widget_add_inline_css( $this->get_instance_css( $instance ) );
298
- }
299
- else {
300
- if( !file_exists( $upload_dir['basedir'] . '/siteorigin-widgets/' . $css_name .'.css' ) || ( defined('SITEORIGIN_WIDGETS_DEBUG') && SITEORIGIN_WIDGETS_DEBUG ) ) {
301
- // Attempt to recreate the CSS
302
- $this->save_css( $instance );
303
- }
304
-
305
- if( file_exists( $upload_dir['basedir'] . '/siteorigin-widgets/' . $css_name .'.css' ) ) {
306
- if ( ! wp_style_is( $css_name ) ) {
307
- wp_enqueue_style(
308
- $css_name,
309
- set_url_scheme($upload_dir['baseurl'] . '/siteorigin-widgets/' . $css_name .'.css')
310
- );
311
- }
312
- }
313
- else {
314
- // Fall back to using inline CSS if we can't find the cached CSS file.
315
- // Try get the cached value.
316
- $css = wp_cache_get( $css_name, 'siteorigin_widgets' );
317
- if ( empty( $css ) ) {
318
- $css = $this->get_instance_css( $instance );
319
- }
320
- siteorigin_widget_add_inline_css( $css );
321
- }
322
- }
323
- $this->generated_css[] = $css_name;
324
- }
325
- }
326
- else {
327
- $css_name = $this->id_base.'-base';
328
- }
329
-
330
- $this->current_instance = false;
331
- return $css_name;
332
- }
333
-
334
- private function is_customize_preview(){
335
- global $wp_customize;
336
- return is_a( $wp_customize, 'WP_Customize_Manager' ) && $wp_customize->is_preview();
337
- }
338
-
339
- private function is_block_editor_page() {
340
- $current_screen = function_exists( 'get_current_screen' ) ? get_current_screen() : null;
341
-
342
- // This is for the Gutenberg plugin.
343
- $is_gutenberg_page = $current_screen != null &&
344
- function_exists( 'is_gutenberg_page' ) &&
345
- is_gutenberg_page();
346
- // This is for WP 5 with the integrated block editor.
347
- $is_block_editor = false;
348
- if ( ! empty( $current_screen ) && method_exists( $current_screen, 'is_block_editor' ) ) {
349
- $is_block_editor = $current_screen->is_block_editor();
350
- }
351
-
352
- return $is_block_editor || $is_gutenberg_page;
353
- }
354
-
355
- /**
356
- * Get an array of variables to make available to templates. By default, just return an array. Should be overwritten by child widgets.
357
- *
358
- * @param $instance
359
- * @param $args
360
- *
361
- * @return array
362
- */
363
- public function get_template_variables( $instance, $args ){
364
- return array();
365
- }
366
-
367
- /**
368
- * Render a sub widget. This should be used inside template files.
369
- *
370
- * @param $class
371
- * @param $args
372
- * @param $instance
373
- */
374
- public function sub_widget($class, $args, $instance){
375
- if(!class_exists($class)) return;
376
- $widget = new $class;
377
-
378
- $args['before_widget'] = '';
379
- $args['after_widget'] = '';
380
-
381
- $widget->widget( $args, $instance );
382
- }
383
-
384
- /**
385
- * Add default values to the instance.
386
- *
387
- * @param $form
388
- * @param $instance
389
- */
390
- function add_defaults( $form, $instance, $level = 0 ){
391
- if( $level > 10 ) return $instance;
392
-
393
- foreach($form as $id => $field) {
394
-
395
- if( $field['type'] == 'repeater' ) {
396
- if( !empty($instance[$id]) ) {
397
- foreach( array_keys($instance[$id]) as $i ){
398
- $instance[$id][$i] = $this->add_defaults( $field['fields'], $instance[$id][$i], $level + 1 );
399
- }
400
- }
401
- }
402
- else if( $field['type'] == 'section' ) {
403
- if( empty($instance[$id]) ) {
404
- $instance[$id] = array();
405
- }
406
- $instance[$id] = $this->add_defaults( $field['fields'], $instance[$id], $level + 1 );
407
- }
408
- else if( $field['type'] == 'measurement' ) {
409
- if( ! isset( $instance[$id] ) ) {
410
- $instance[$id] = isset( $field['default'] ) ? $field['default'] : '';
411
- }
412
- if ( empty( $instance[ $id . '_unit' ] ) ) {
413
- $instance[ $id . '_unit' ] = 'px';
414
- }
415
- }
416
- else if ( $field['type'] == 'order') {
417
- if ( empty( $instance[$id] ) ) {
418
- if( ! empty( $field['default'] ) ) {
419
- $instance[$id] = $field['default'];
420
- } else {
421
- // If no default order is specified, just use the order of the options.
422
- $instance[$id] = array_keys( $field['options'] );
423
- }
424
- }
425
- }
426
- else {
427
- if( !isset( $instance[$id] ) ) {
428
- $instance[$id] = isset( $field['default'] ) ? $field['default'] : '';
429
- }
430
- }
431
- }
432
-
433
- return $instance;
434
- }
435
-
436
- /**
437
- * Display the widget form.
438
- *
439
- * @param array $instance
440
- * @param string $form_type Which type of form we're using
441
- *
442
- * @return string|void
443
- */
444
- public function form( $instance, $form_type = 'widget' ) {
445
- if( $form_type == 'widget' ) {
446
- if( empty( $this->form_options ) ) {
447
- $this->form_options = $this->form_options();
448
- }
449
- $form_options = $this->form_options;
450
- }
451
- else {
452
- $form_options = $this->get_form( $form_type );
453
- }
454
-
455
- $instance = $this->modify_instance($instance);
456
- $instance = $this->add_defaults( $form_options, $instance );
457
-
458
- if( empty( $this->number ) ) {
459
- // Compatibility with form widgets.
460
- $this->number = 1;
461
- }
462
-
463
- // Filter the instance specifically for the form
464
- $instance = apply_filters('siteorigin_widgets_form_instance_' . $this->id_base, $instance, $this);
465
-
466
- // `more_entropy` adds a period to the id.
467
- $id = str_replace( '.', '', uniqid( rand(), true ) );
468
- $form_id = 'siteorigin_widget_form_' . md5( $id );
469
- $class_name = str_replace( '_', '-', strtolower( $this->widget_class ) );
470
-
471
- if( empty( $instance['_sow_form_id'] ) ) {
472
- $instance['_sow_form_id'] = $id;
473
- }
474
- ?>
475
- <div class="siteorigin-widget-form siteorigin-widget-form-main siteorigin-widget-form-main-<?php echo esc_attr($class_name) ?>"
476
- id="<?php echo $form_id ?>" data-class="<?php echo esc_attr( $this->widget_class ) ?>"
477
- data-id-base="<?php echo esc_attr( $this->id_base ) ?>" style="display: none">
478
- <?php
479
- $this->display_teaser_message();
480
- /* @var $field_factory SiteOrigin_Widget_Field_Factory */
481
- $field_factory = SiteOrigin_Widget_Field_Factory::single();
482
- $fields_javascript_variables = array();
483
- foreach( $form_options as $field_name => $field_options ) {
484
- /* @var $field SiteOrigin_Widget_Field_Base */
485
- $field = $field_factory->create_field( $field_name, $field_options, $this );
486
- $field->render( isset( $instance[$field_name] ) ? $instance[$field_name] : null, $instance );
487
- $field_js_vars = $field->get_javascript_variables();
488
- if( ! empty( $field_js_vars ) ) {
489
- $fields_javascript_variables[$field_name] = $field_js_vars;
490
- }
491
- $field->enqueue_scripts();
492
- $this->fields[$field_name] = $field;
493
- }
494
- ?>
495
- <input type="hidden" name="<?php echo $this->so_get_field_name('_sow_form_id') ?>" value="<?php echo esc_attr( $instance['_sow_form_id'] ) ?>" class="siteorigin-widgets-form-id" />
496
- <input type="hidden" name="<?php echo $this->so_get_field_name('_sow_form_timestamp') ?>" value="<?php echo ! empty( $instance['_sow_form_timestamp'] ) ? esc_attr( $instance['_sow_form_timestamp'] ) : '' ?>" class="siteorigin-widgets-form-timestamp" />
497
- </div>
498
- <div class="siteorigin-widget-form-no-styles">
499
- <?php $this->scripts_loading_message() ?>
500
- </div>
501
-
502
- <?php if( $this->show_preview_button() ) : ?>
503
- <div class="siteorigin-widget-preview" style="display: none">
504
- <a href="#" class="siteorigin-widget-preview-button button-secondary"><?php _e('Preview', 'so-widgets-bundle') ?></a>
505
- </div>
506
- <?php endif; ?>
507
-
508
- <?php if( !empty( $this->widget_options['help'] ) ) : ?>
509
- <a href="<?php echo sow_esc_url($this->widget_options['help']) ?>" class="siteorigin-widget-help-link siteorigin-panels-help-link" target="_blank" rel="noopener noreferrer"><?php _e('Help', 'so-widgets-bundle') ?></a>
510
- <?php endif; ?>
511
-
512
- <script type="text/javascript">
513
- ( function($) {
514
- if(typeof window.sow_field_javascript_variables == 'undefined') window.sow_field_javascript_variables = {};
515
- window.sow_field_javascript_variables["<?php echo addslashes( $this->widget_class ) ?>"] = <?php echo json_encode( $fields_javascript_variables ) ?>;
516
-
517
- if( typeof $.fn.sowSetupForm != 'undefined' ) {
518
- $('#<?php echo $form_id ?>').sowSetupForm();
519
- }
520
- else {
521
- // Init once admin scripts have been loaded
522
- $( document).on('sowadminloaded', function(){
523
- $('#<?php echo $form_id ?>').sowSetupForm();
524
- });
525
- }
526
- } )( jQuery );
527
- </script>
528
- <?php
529
-
530
- $this->enqueue_scripts( $form_type );
531
- }
532
-
533
- /**
534
- * Display the teaser message.
535
- */
536
- function display_teaser_message(){
537
- if(
538
- method_exists( $this, 'get_form_teaser' ) &&
539
- ( $teaser = $this->get_form_teaser() )
540
- ) {
541
- if ( ! is_admin() ) {
542
- wp_enqueue_style( 'dashicons' );
543
- }
544
-
545
- $dismissed = get_user_meta( get_current_user_id(), 'teasers_dismissed', true );
546
- if( empty( $dismissed[ $this->id_base ] ) ) {
547
- $dismiss_url = add_query_arg( array(
548
- 'action' => 'so_dismiss_widget_teaser',
549
- 'widget' => $this->id_base,
550
- ), admin_url( 'admin-ajax.php' ) );
551
- $dismiss_url = wp_nonce_url( $dismiss_url, 'dismiss-widget-teaser' );
552
-
553
- ?>
554
- <div class="siteorigin-widget-teaser">
555
- <?php echo wp_kses_post( $teaser ) ?>
556
- <span class="dashicons dashicons-dismiss" data-dismiss-url="<?php echo esc_url( $dismiss_url ) ?>"></span>
557
- </div>
558
- <?php
559
- }
560
- }
561
- }
562
-
563
- /**
564
- * Should we display the teaser for SiteOrigin Premium
565
- *
566
- * @return bool
567
- */
568
- function display_siteorigin_premium_teaser(){
569
- return apply_filters( 'siteorigin_premium_upgrade_teaser', true ) &&
570
- ! defined( 'SITEORIGIN_PREMIUM_VERSION' );
571
- }
572
-
573
- function scripts_loading_message(){
574
- ?>
575
- <p><strong><?php _e('This widget has scripts and styles that need to be loaded before you can use it. Please save and reload your current page.', 'so-widgets-bundle') ?></strong></p>
576
- <p><strong><?php _e('You will only need to do this once.', 'so-widgets-bundle') ?></strong></p>
577
- <?php
578
- }
579
-
580
- /**
581
- * Enqueue the admin scripts for the widget form.
582
- *
583
- * @param bool|string $form_type Should we enqueue the field scripts too?
584
- */
585
- function enqueue_scripts( $form_type = false ) {
586
-
587
- if( ! wp_script_is('siteorigin-widget-admin') ) {
588
- wp_enqueue_style( 'wp-color-picker' );
589
- wp_enqueue_style( 'siteorigin-widget-admin', plugin_dir_url(SOW_BUNDLE_BASE_FILE).'base/css/admin.css', array( 'media-views' ), SOW_BUNDLE_VERSION );
590
-
591
- wp_enqueue_script( 'wp-color-picker' );
592
- wp_enqueue_media();
593
- wp_enqueue_script(
594
- 'siteorigin-widget-admin',
595
- plugin_dir_url( SOW_BUNDLE_BASE_FILE ) . 'base/js/admin' . SOW_BUNDLE_JS_SUFFIX . '.js',
596
- array( 'jquery', 'jquery-ui-sortable', 'jquery-ui-slider', 'underscore' ),
597
- SOW_BUNDLE_VERSION,
598
- true
599
- );
600
-
601
- wp_localize_script( 'siteorigin-widget-admin', 'soWidgets', array(
602
- 'ajaxurl' => wp_nonce_url( admin_url('admin-ajax.php'), 'widgets_action', '_widgets_nonce' ),
603
- 'sure' => __('Are you sure?', 'so-widgets-bundle'),
604
- 'backup' => array(
605
- 'newerVersion' => __( "There is a newer version of this widget's content available.", 'so-widgets-bundle' ),
606
- 'restore' => __( 'Restore', 'so-widgets-bundle' ),
607
- 'dismiss' => __( 'Dismiss', 'so-widgets-bundle' ),
608
- 'replaceWarning' => sprintf(
609
- __( 'Clicking %s will replace the current widget contents. You can revert by refreshing the page before updating.', 'so-widgets-bundle' ),
610
- '<em>' . __( 'Restore', 'so-widgets-bundle' ) . '</em>'
611
- ),
612
- ),
613
- ) );
614
-
615
- global $wp_customize;
616
- if ( isset( $wp_customize ) ) {
617
- $this->footer_admin_templates();
618
- }
619
- else {
620
- add_action( 'admin_footer', array( $this, 'footer_admin_templates' ) );
621
- }
622
- }
623
-
624
- if( !empty( $form_type ) && $this->has_form( $form_type ) ) {
625
- // Enqueue field scripts for the given form type
626
- $form_options = $this->get_form( $form_type );
627
- $this->enqueue_field_scripts( $form_options );
628
- }
629
-
630
- // This lets the widget enqueue any specific admin scripts
631
- $this->enqueue_admin_scripts();
632
- do_action( 'siteorigin_widgets_enqueue_admin_scripts_' . $this->id_base, $this );
633
- }
634
-
635
- function enqueue_field_scripts( $fields ){
636
- /* @var $field_factory SiteOrigin_Widget_Field_Factory */
637
- $field_factory = SiteOrigin_Widget_Field_Factory::single();
638
-
639
- foreach( $fields as $field_name => $field_options ) {
640
- /* @var $field SiteOrigin_Widget_Field_Base */
641
- $field = $field_factory->create_field( $field_name, $field_options, $this );
642
- $field->enqueue_scripts();
643
-
644
- if( !empty( $field_options['fields'] ) ) {
645
- $this->enqueue_field_scripts( $field_options['fields'] );
646
- }
647
- }
648
- }
649
-
650
- /**
651
- * Display all the admin stuff for the footer
652
- */
653
- function footer_admin_templates(){
654
- ?>
655
- <script type="text/template" id="so-widgets-bundle-tpl-preview-dialog">
656
- <div class="so-widgets-dialog">
657
- <div class="so-widgets-dialog-overlay"></div>
658
-
659
- <div class="so-widgets-toolbar">
660
- <h3><?php _e( 'Widget Preview', 'so-widgets-bundle' ) ?></h3>
661
- <div class="close"><span class="dashicons dashicons-arrow-left-alt2"></span></div>
662
- </div>
663
-
664
- <div class="so-widgets-dialog-frame">
665
- <iframe name="siteorigin-widgets-preview-iframe" id="siteorigin-widget-preview-iframe" style="visibility: hidden"></iframe>
666
- </div>
667
-
668
- <form target="siteorigin-widgets-preview-iframe" action="<?php echo wp_nonce_url( admin_url('admin-ajax.php'), 'widgets_action', '_widgets_nonce' ) ?>" method="post">
669
- <input type="hidden" name="action" value="so_widgets_preview" />
670
- <input type="hidden" name="data" value="" />
671
- <input type="hidden" name="class" value="" />
672
- </form>
673
-
674
- </div>
675
- </script>
676
- <?php
677
-
678
- // Give other plugins a chance to add their own
679
- do_action('siteorigin_widgets_footer_admin_templates');
680
- }
681
-
682
- /**
683
- * Update the widget instance.
684
- *
685
- * @param array $new_instance
686
- * @param array $old_instance
687
- * @param string $form_type The type of form we're using.
688
- * @return array|void
689
- */
690
- public function update( $new_instance, $old_instance, $form_type = 'widget' ) {
691
- if( !class_exists('SiteOrigin_Widgets_Color_Object') ) require plugin_dir_path( __FILE__ ).'inc/color.php';
692
-
693
- if( $form_type == 'widget' ) {
694
- if( empty( $this->form_options ) ) {
695
- $this->form_options = $this->form_options();
696
- }
697
- $form_options = $this->form_options;
698
- }
699
- else {
700
- $form_options = $this->get_form( $form_type );
701
- }
702
-
703
- if( ! empty( $form_options ) ) {
704
- /* @var $field_factory SiteOrigin_Widget_Field_Factory */
705
- $field_factory = SiteOrigin_Widget_Field_Factory::single();
706
- foreach ( $form_options as $field_name => $field_options ) {
707
- /* @var $field SiteOrigin_Widget_Field_Base */
708
- if ( !empty( $this->fields ) && !empty( $this->fields[$field_name] ) ) {
709
- $field = $this->fields[$field_name];
710
- }
711
- else {
712
- $field = $field_factory->create_field( $field_name, $field_options, $this );
713
- $this->fields[$field_name] = $field;
714
- }
715
- $new_instance[$field_name] = $field->sanitize(
716
- isset( $new_instance[$field_name] ) ? $new_instance[$field_name] : null,
717
- $new_instance,
718
- isset( $old_instance[$field_name] ) ? $old_instance[$field_name] : null
719
- );
720
- $new_instance = $field->sanitize_instance( $new_instance );
721
- }
722
-
723
- // Let other plugins also sanitize the instance
724
- $new_instance = apply_filters( 'siteorigin_widgets_sanitize_instance', $new_instance, $form_options, $this );
725
- $new_instance = apply_filters( 'siteorigin_widgets_sanitize_instance_' . $this->id_base, $new_instance, $form_options, $this );
726
- }
727
-
728
- // Remove the old CSS, it'll be regenerated on page load.
729
- $this->delete_css( $this->modify_instance( $old_instance ) );
730
- return $new_instance;
731
- }
732
-
733
- /**
734
- * Save the CSS to the filesystem
735
- *
736
- * @param $instance
737
- * @return bool|string
738
- */
739
- private function save_css( $instance ){
740
- require_once ABSPATH . 'wp-admin/includes/file.php';
741
-
742
- $style = $this->get_style_name($instance);
743
- $hash = $this->get_style_hash( $instance );
744
- $name = $this->id_base.'-'.$style.'-'.$hash.'.css';
745
-
746
- $css = $this->get_instance_css($instance);
747
-
748
- if ( ! empty( $css ) ) {
749
- if ( WP_Filesystem() ) {
750
- global $wp_filesystem;
751
- $upload_dir = wp_upload_dir();
752
-
753
- $dir_exists = $wp_filesystem->is_dir( $upload_dir['basedir'] . '/siteorigin-widgets/' );
754
-
755
- if ( empty( $dir_exists ) ) {
756
- // The 'siteorigin-widgets' directory doesn't exist, so try to create it.
757
- $dir_exists = $wp_filesystem->mkdir( $upload_dir['basedir'] . '/siteorigin-widgets/' );
758
- }
759
-
760
- if ( ! empty( $dir_exists ) ) {
761
- // The 'siteorigin-widgets' directory exists, so we can try to write the CSS to a file.
762
- $wp_filesystem->delete( $upload_dir['basedir'] . '/siteorigin-widgets/' . $name );
763
- $file_put_success = $wp_filesystem->put_contents(
764
- $upload_dir['basedir'] . '/siteorigin-widgets/' . $name,
765
- $css
766
- );
767
-
768
- // Alert other plugins that we've added a new CSS file
769
- do_action( 'siteorigin_widgets_stylesheet_added', $name, $instance );
770
- }
771
- }
772
-
773
- // We couldn't write to file, so let's use cache instead.
774
- if ( empty( $file_put_success ) ) {
775
- wp_cache_add( $name, $css, 'siteorigin_widgets' );
776
- }
777
-
778
- return $hash;
779
- }
780
-
781
- return false;
782
- }
783
-
784
- /**
785
- * Clears CSS for a specific instance
786
- */
787
- private function delete_css( $instance ){
788
- require_once ABSPATH . 'wp-admin/includes/file.php';
789
-
790
- if( WP_Filesystem() ) {
791
- global $wp_filesystem;
792
- $upload_dir = wp_upload_dir();
793
-
794
- $style = $this->get_style_name($instance);
795
- $hash = $this->get_style_hash( $instance );
796
- $name = $this->id_base.'-'.$style.'-'.$hash;
797
-
798
- $wp_filesystem->delete($upload_dir['basedir'] . '/siteorigin-widgets/' . $name . '.css');
799
- if ( in_array( $name, $this->generated_css ) ) {
800
- $index = array_search( $name, $this->generated_css );
801
- unset( $this->generated_css[$index] );
802
- //Reindex array
803
- $this->generated_css = array_values( $this->generated_css );
804
- }
805
-
806
- // Alert other plugins that we've deleted a CSS file
807
- do_action( 'siteorigin_widgets_stylesheet_deleted', $name, $instance );
808
- }
809
- }
810
-
811
- /**
812
- * Clear all old CSS files
813
- *
814
- * @var bool $force Must we force a cache refresh.
815
- */
816
- public static function clear_file_cache( $force_delete = false ){
817
- // Use this variable to ensure this only runs once per request
818
- static $done = false;
819
- if ( $done && !$force_delete ) return;
820
-
821
- if( !get_transient('sow:cleared') || $force_delete ) {
822
-
823
- require_once ABSPATH . 'wp-admin/includes/file.php';
824
- if( WP_Filesystem() ) {
825
- global $wp_filesystem;
826
- $upload_dir = wp_upload_dir();
827
-
828
- $list = $wp_filesystem->dirlist( $upload_dir['basedir'] . '/siteorigin-widgets/' );
829
- if ( ! empty( $list ) ) {
830
- foreach($list as $file) {
831
- if( $file['lastmodunix'] < time() - self::$css_expire || $force_delete ) {
832
- // Delete the file
833
- $wp_filesystem->delete( $upload_dir['basedir'] . '/siteorigin-widgets/' . $file['name'] );
834
- }
835
- }
836
- }
837
- }
838
-
839
- // Set this transient so we know when to clear all the generated CSS.
840
- set_transient('sow:cleared', true, self::$css_expire);
841
- }
842
-
843
- $done = true;
844
- }
845
-
846
- /**
847
- * Generate the CSS for the widget.
848
- *
849
- * @param $instance
850
- * @return string
851
- */
852
- public function get_instance_css( $instance ){
853
- if( !class_exists( 'SiteOrigin_LessC' ) ) require plugin_dir_path( __FILE__ ) . 'inc/lessc.inc.php';
854
- if( !class_exists('SiteOrigin_Widgets_Less_Functions') ) require plugin_dir_path( __FILE__ ).'inc/less-functions.php';
855
-
856
- if( !method_exists( $this, 'get_less_content' ) ) {
857
- $style_name = $this->get_style_name($instance);
858
- if( empty($style_name) ) return '';
859
-
860
- $less_file = siteorigin_widget_get_plugin_dir_path( $this->id_base ).'styles/'.$style_name . '.less';
861
- $less_file = apply_filters( 'siteorigin_widgets_less_file_' . $this->id_base, $less_file, $instance, $this );
862
-
863
- $less = ( substr( $less_file, -5 ) == '.less' && file_exists($less_file) ) ? file_get_contents( $less_file ) : '';
864
- }
865
- else {
866
- // The widget is going handle getting the instance LESS
867
- $less = $this->get_less_content( $instance );
868
- }
869
-
870
- // Substitute the variables
871
- if( !class_exists('SiteOrigin_Widgets_Color_Object') ) require plugin_dir_path( __FILE__ ) . 'inc/color.php';
872
-
873
- // Lets widgets insert their own custom generated LESS
874
- $less = preg_replace_callback( '/\.widget-function\((.*)\);/', array( $this, 'less_widget_inject' ), $less );
875
-
876
- //handle less @import statements
877
- $less = preg_replace_callback( '/^@import\s+".*?\/?([\w\-\.]+)";/m', array( $this, 'get_less_import_contents' ), $less );
878
-
879
- $vars = apply_filters( 'siteorigin_widgets_less_variables_' . $this->id_base, $this->get_less_variables( $instance ), $instance, $this );
880
- if( !empty( $vars ) ){
881
- foreach($vars as $name => $value) {
882
- // Ignore empty string, false and null values (but keep '0')
883
- if( $value === '' || $value === false || $value === null ) continue;
884
-
885
- $less = preg_replace('/\@'.preg_quote($name).' *\:.*?;/', '@'.$name.': '.$value.';', $less);
886
- }
887
- }
888
-
889
- $less = apply_filters( 'siteorigin_widgets_styles', $less, $this->widget_class, $instance );
890
- $less = apply_filters( 'siteorigin_widgets_less_' . $this->id_base, $less, $instance, $this );
891
-
892
- $css = '';
893
-
894
- if( ! empty( $less ) ) {
895
- $style = $this->get_style_name( $instance );
896
- $hash = $this->get_style_hash( $instance );
897
- $css_name = $this->id_base . '-' . $style . '-' . $hash;
898
-
899
- //we assume that any remaining @imports are plain css imports and should be kept outside selectors
900
- $css_imports = '';
901
- if ( preg_match_all( '/^@import.+/m', $less, $imports ) ) {
902
- $css_imports = implode( "\n", $imports[0] );
903
- $less = preg_replace( '/^@import.+/m', '', $less );
904
- }
905
-
906
- $less = $css_imports . "\n\n" . '.so-widget-'.$css_name." { \n".$less."\n } ";
907
-
908
- $compiler = new SiteOrigin_LessC();
909
- $lc_functions = new SiteOrigin_Widgets_Less_Functions($this, $instance);
910
- $lc_functions->registerFunctions( $compiler );
911
- $compiler = apply_filters( 'siteorigin_widgets_less_compiler', $compiler, $instance, $this );
912
-
913
- try {
914
- if( method_exists( $compiler, 'compile' ) ) {
915
- $css = $compiler->compile( $less );
916
- }
917
- }
918
- catch ( Exception $e ) {
919
- if( defined( 'SITEORIGIN_WIDGETS_DEBUG' ) && SITEORIGIN_WIDGETS_DEBUG ) {
920
- throw $e;
921
- }
922
- }
923
-
924
- // Remove any attributes with default as the value
925
- $css = preg_replace('/[a-zA-Z\-]+ *: *default *;/', '', $css);
926
-
927
- // Remove any empty CSS
928
- $css = preg_replace('/[^{}]*\{\s*\}/m', '', $css);
929
- $css = trim($css);
930
- }
931
-
932
- return apply_filters( 'siteorigin_widgets_instance_css', $css, $instance, $this );
933
- }
934
-
935
- /**
936
- * Replaces LESS imports with the content from the actual files. This used as a preg callback.
937
- *
938
- * @param $matches
939
- *
940
- * @return string
941
- */
942
- private function get_less_import_contents($matches) {
943
- $filename = $matches[1];
944
-
945
- // First, we'll deal with a few special cases
946
- switch( $filename ) {
947
- case 'mixins':
948
- return file_get_contents( plugin_dir_path( __FILE__ ) . 'less/mixins.less' );
949
- break;
950
-
951
- case 'lesshat':
952
- return file_get_contents( plugin_dir_path( __FILE__ ) . 'less/lesshat.less' );
953
- break;
954
- }
955
-
956
- //get file extension
957
- preg_match( '/\.\w+$/', $filename, $ext );
958
- //if there is a file extension and it's not .less or .css we ignore
959
- if ( ! empty( $ext ) ) {
960
- if ( ! ( $ext[0] == '.less' || $ext[0] == '.css' ) ) {
961
- return '';
962
- }
963
- }
964
- else {
965
- $filename .= '.less';
966
- }
967
- //first check local widget styles directory and then bundle less directory
968
- $search_path = array(
969
- siteorigin_widget_get_plugin_dir_path( $this->id_base ) . 'styles/',
970
- plugin_dir_path( __FILE__ ) . 'less/'
971
- );
972
-
973
- foreach ( $search_path as $dir ) {
974
- if ( file_exists( $dir . $filename ) ) {
975
- return file_get_contents( $dir . $filename )."\n\n";
976
- }
977
- }
978
-
979
- //file not found
980
- return '';
981
- }
982
-
983
- /**
984
- * Used as a preg callback to replace .widget-function('some_function', ...) with output from less_some_function($instance, $args).
985
- *
986
- * @param $matches
987
- *
988
- * @return mixed|string
989
- */
990
- private function less_widget_inject($matches){
991
- // We're going to lazily split the arguments by comma
992
- $args = explode(',', $matches[1]);
993
- if( empty($args[0]) ) return '';
994
-
995
- // Shift the function name from the arguments
996
- $func = 'less_' . trim( array_shift($args) , '\'"');
997
- if( !method_exists($this, $func) ) return '';
998
-
999
- // Finally call the function and include the
1000
- $args = array_map('trim', $args);
1001
- return call_user_func( array($this, $func), $this->current_instance, $args );
1002
- }
1003
-
1004
- /**
1005
- * Less function for importing Google web fonts.
1006
- *
1007
- * @param $instance
1008
- * @param $args
1009
- *
1010
- * @return string
1011
- */
1012
- function less_import_google_font($instance, $args) {
1013
- if( empty( $instance ) ) return;
1014
-
1015
- $fonts = $this->get_google_font_fields($instance);
1016
- if( empty( $fonts ) || ! is_array( $fonts ) ) return '';
1017
-
1018
- $font_imports = array();
1019
-
1020
- foreach ( $fonts as $font ) {
1021
- $font_imports[] = siteorigin_widget_get_font( $font );
1022
- }
1023
-
1024
- $import_strings = array();
1025
- foreach( $font_imports as $import ) {
1026
- $import_strings[] = !empty($import['css_import']) ? $import['css_import'] : '';
1027
- }
1028
-
1029
- // Remove empty and duplicate items from the array
1030
- $import_strings = array_filter( $import_strings );
1031
- $import_strings = array_unique( $import_strings );
1032
-
1033
- return implode( "\n", $import_strings );
1034
- }
1035
-
1036
- /**
1037
- * Get any font fields which may be used by this widget.
1038
- *
1039
- * @param $instance
1040
- *
1041
- * @return array
1042
- */
1043
- function get_google_font_fields( $instance ) {
1044
- return apply_filters( 'siteorigin_widgets_google_font_fields_' . $this->id_base, array(), $instance, $this );
1045
- }
1046
-
1047
- /**
1048
- * Utility function to get a field name for a widget field.
1049
- *
1050
- * @param $field_name
1051
- * @param array $container
1052
- * @return mixed|string
1053
- */
1054
- public function so_get_field_name( $field_name, $container = array() ) {
1055
- if( empty($container) ) {
1056
- $name = $this->get_field_name( $field_name );
1057
- }
1058
- else {
1059
- // We also need to add the container fields
1060
- $container_extras = '';
1061
- foreach($container as $r) {
1062
- $container_extras .= '[' . $r['name'] . ']';
1063
-
1064
- if( $r['type'] == 'repeater' ) {
1065
- $container_extras .= '[#' . $r['name'] . '#]';
1066
- }
1067
- }
1068
-
1069
- $name = $this->get_field_name( '{{{FIELD_NAME}}}' );
1070
- $name = str_replace('[{{{FIELD_NAME}}}]', $container_extras.'[' . esc_attr($field_name) . ']', $name);
1071
- }
1072
-
1073
- $name = apply_filters( 'siteorigin_widgets_get_field_name', $name );
1074
- $name = apply_filters( 'siteorigin_widgets_get_field_name_' . $this->id_base, $name );
1075
-
1076
- return $name;
1077
- }
1078
-
1079
- /**
1080
- * Get the ID of this field.
1081
- *
1082
- * @param $field_name
1083
- * @param array $container
1084
- * @param boolean $is_template
1085
- *
1086
- * @return string
1087
- */
1088
- public function so_get_field_id( $field_name, $container = array(), $is_template = false ) {
1089
- if( empty($container) ) {
1090
- return $this->get_field_id($field_name);
1091
- }
1092
- else {
1093
- $name = array();
1094
- foreach ( $container as $container_item ) {
1095
- $name[] = $container_item['name'];
1096
- }
1097
- $name[] = $field_name;
1098
- $field_id_base = $this->get_field_id(implode('-', $name));
1099
- if ( $is_template ) {
1100
- return $field_id_base . '-_id_';
1101
- }
1102
- if ( ! isset( $this->field_ids[ $field_id_base ] ) ) {
1103
- $this->field_ids[ $field_id_base ] = 1;
1104
- }
1105
- $curId = $this->field_ids[ $field_id_base ]++;
1106
- return $field_id_base . '-' . $curId;
1107
- }
1108
- }
1109
-
1110
- /**
1111
- * Parse markdown
1112
- *
1113
- * @param $markdown
1114
- * @return string The HTML
1115
- *
1116
- * @deprecated Will be removed in version 2.0
1117
- */
1118
- function parse_markdown( $markdown ){
1119
- if( !class_exists('Parsedown') ) include plugin_dir_path(__FILE__).'inc/Parsedown.php';
1120
- $parser = new Parsedown();
1121
-
1122
- return $parser->text($markdown);
1123
- }
1124
-
1125
- /**
1126
- * Get a hash that uniquely identifies this instance.
1127
- *
1128
- * @param $instance
1129
- * @return string
1130
- */
1131
- function get_style_hash( $instance ) {
1132
- $style_hash = apply_filters('siteorigin_widgets_widget_style_hash', '', $this);
1133
- if( empty( $style_hash ) ) {
1134
- if( method_exists( $this, 'get_style_hash_variables' ) ) {
1135
- $vars = apply_filters( 'siteorigin_widgets_hash_variables_' . $this->id_base, $this->get_style_hash_variables( $instance ), $instance, $this );
1136
- } else {
1137
- $vars = apply_filters( 'siteorigin_widgets_less_variables_' . $this->id_base, $this->get_less_variables( $instance ), $instance, $this );
1138
- }
1139
- $version = property_exists( $this, 'version' ) ? $this->version : '';
1140
-
1141
- $style_hash = substr( md5( json_encode( $vars ) . $version ), 0, 12 );
1142
- }
1143
-
1144
- return $style_hash;
1145
- }
1146
-
1147
- /**
1148
- * Get the template name that we'll be using to render this widget.
1149
- *
1150
- * @param $instance
1151
- * @return mixed
1152
- */
1153
- function get_template_name( $instance ) {
1154
- return 'default';
1155
- }
1156
-
1157
- /**
1158
- * Get the name of the directory in which we should look for the template. Relative to root of widget folder.
1159
- *
1160
- * @return mixed
1161
- */
1162
- function get_template_dir( $instance ) {
1163
- return 'tpl';
1164
- }
1165
-
1166
- /**
1167
- * Get the LESS style name we'll be using for this widget.
1168
- *
1169
- * @param $instance
1170
- * @return mixed
1171
- */
1172
- function get_style_name( $instance ) {
1173
- return 'default';
1174
- }
1175
-
1176
- /**
1177
- * Get any variables that need to be substituted by
1178
- *
1179
- * @param $instance
1180
- * @return array
1181
- */
1182
- function get_less_variables( $instance ){
1183
- return array();
1184
- }
1185
-
1186
- /**
1187
- * Filter the variables we'll be storing in temporary storage for this instance if we're using `instance_storage`
1188
- *
1189
- * @param $instance
1190
- *
1191
- * @return mixed
1192
- */
1193
- function modify_stored_instance( $instance ){
1194
- return $instance;
1195
- }
1196
-
1197
- /**
1198
- * Get the stored instance based on the hash.
1199
- *
1200
- * @param $hash
1201
- *
1202
- * @return object The instance
1203
- */
1204
- function get_stored_instance( $hash ) {
1205
- return get_transient('sow_inst[' . $this->id_base . '][' . $hash . ']');
1206
- }
1207
-
1208
- /**
1209
- * This function can be overwritten to modify form values in the child widget.
1210
- *
1211
- * @param $form
1212
- * @return mixed
1213
- */
1214
- function modify_form( $form ) {
1215
- return $form;
1216
- }
1217
-
1218
-
1219
- /**
1220
- * This function can be overwritten to modify form values in the child widget.
1221
- *
1222
- * @param $child_widget_form
1223
- * @param $child_widget
1224
- * @return mixed
1225
- */
1226
- function modify_child_widget_form($child_widget_form, $child_widget) {
1227
- return $child_widget_form;
1228
- }
1229
-
1230
- /**
1231
- * This function should be overwritten by child widgets to filter an instance. Run before rendering the form and widget.
1232
- *
1233
- * @param $instance
1234
- *
1235
- * @return mixed
1236
- */
1237
- function modify_instance( $instance ){
1238
- return $instance;
1239
- }
1240
-
1241
- /**
1242
- * Can be overwritten by child widgets to make variables available to javascript via ajax calls. These are designed to be used in the admin.
1243
- */
1244
- function get_javascript_variables(){
1245
-
1246
- }
1247
-
1248
- /**
1249
- * Used by child widgets to register scripts to be enqueued for the frontend.
1250
- *
1251
- * @param array $scripts an array of scripts. Each element is an array that corresponds to wp_enqueue_script arguments
1252
- */
1253
- public function register_frontend_scripts( $scripts ){
1254
- foreach ( $scripts as $script ) {
1255
- if ( ! isset( $this->frontend_scripts[ $script[0] ] ) ) {
1256
- $this->frontend_scripts[$script[0]] = $script;
1257
- }
1258
- }
1259
- }
1260
-
1261
- /**
1262
- * Enqueue all the registered scripts
1263
- */
1264
- function enqueue_registered_scripts( $instance ) {
1265
- $f_scripts = apply_filters(
1266
- 'siteorigin_widgets_frontend_scripts_' . $this->id_base,
1267
- $this->frontend_scripts,
1268
- $instance,
1269
- $this
1270
- );
1271
-
1272
- foreach ( $f_scripts as $f_script ) {
1273
- if ( ! wp_script_is( $f_script[0] ) ) {
1274
- wp_enqueue_script(
1275
- $f_script[0],
1276
- isset( $f_script[1] ) ? $f_script[1] : false,
1277
- isset( $f_script[2] ) ? $f_script[2] : array(),
1278
- !empty( $f_script[3] ) ? $f_script[3] : SOW_BUNDLE_VERSION,
1279
- isset( $f_script[4] ) ? $f_script[4] : false
1280
- );
1281
- }
1282
- }
1283
- }
1284
-
1285
- /**
1286
- * Used by child widgets to register styles to be enqueued for the frontend.
1287
- *
1288
- * @param array $styles an array of styles. Each element is an array that corresponds to wp_enqueue_style arguments
1289
- */
1290
- public function register_frontend_styles( $styles ) {
1291
- foreach ( $styles as $style ) {
1292
- if ( ! isset( $this->frontend_styles[ $style[0] ] ) ) {
1293
- $this->frontend_styles[$style[0]] = $style;
1294
- }
1295
- }
1296
- }
1297
-
1298
- /**
1299
- * Enqueue any frontend styles that were registered
1300
- */
1301
- function enqueue_registered_styles( $instance ) {
1302
- $f_styles = apply_filters(
1303
- 'siteorigin_widgets_frontend_styles_' . $this->id_base,
1304
- $this->frontend_styles,
1305
- $instance,
1306
- $this
1307
- );
1308
-
1309
- foreach ( $f_styles as $f_style ) {
1310
- if ( ! wp_style_is( $f_style[0] ) ) {
1311
- wp_enqueue_style(
1312
- $f_style[0],
1313
- isset( $f_style[1] ) ? $f_style[1] : false,
1314
- isset( $f_style[2] ) ? $f_style[2] : array(),
1315
- !empty( $f_style[3] ) ? $f_style[3] : SOW_BUNDLE_VERSION,
1316
- isset( $f_style[4] ) ? $f_style[4] : "all"
1317
- );
1318
- }
1319
- }
1320
- }
1321
-
1322
- /**
1323
- * Can be overridden by child widgets to enqueue scripts and styles for the frontend, but child widgets should
1324
- * rather register scripts and styles using register_frontend_scripts() and register_frontend_styles(). This function
1325
- * will then ensure that the scripts are not enqueued more than once.
1326
- */
1327
- function enqueue_frontend_scripts( $instance ) {
1328
- $this->enqueue_registered_scripts( $instance );
1329
- $this->enqueue_registered_styles( $instance );
1330
-
1331
- // Give plugins a chance to enqueue additional frontend scripts
1332
- do_action('siteorigin_widgets_enqueue_frontend_scripts_' . $this->id_base, $instance, $this);
1333
- }
1334
-
1335
- /**
1336
- * Can be overwritten by child widgets to enqueue admin scripts and styles if necessary.
1337
- */
1338
- function enqueue_admin_scripts(){ }
1339
-
1340
- /**
1341
- * Check if we're currently in a preview
1342
- *
1343
- * @param array $instance
1344
- *
1345
- * @return bool
1346
- */
1347
- function is_preview( $instance = array() ) {
1348
- // Check if the instance is a preview
1349
- if( !empty( $instance[ 'is_preview' ] ) ) return true;
1350
-
1351
- // Check if the general request is a preview
1352
- $is_preview =
1353
- is_preview() || // Is this a standard preview
1354
- $this->is_customize_preview() || // Is this a customizer preview
1355
- $this->is_block_editor_page() || // Is this a block editor page
1356
- !empty( $_GET['siteorigin_panels_live_editor'] ) || // Is this a Page Builder live editor request
1357
- ( !empty( $_REQUEST['action'] ) && $_REQUEST['action'] == 'so_panels_builder_content' ) || // Is this a Page Builder content ajax request
1358
- ! empty( $GLOBALS[ 'SITEORIGIN_PANELS_PREVIEW_RENDER' ] ); // Is this a Page Builder preview render.
1359
-
1360
- return apply_filters( 'siteorigin_widgets_is_preview', $is_preview, $this );
1361
- }
1362
-
1363
- /**
1364
- * Whether or not so show the 'Preview' button
1365
- *
1366
- * @return bool
1367
- */
1368
- function show_preview_button(){
1369
- $show_preview = ! empty( $this->widget_options['has_preview'] ) && ! $this->is_customize_preview();
1370
- $show_preview = apply_filters( 'siteorigin_widgets_form_show_preview_button', $show_preview, $this );
1371
- return $show_preview;
1372
- }
1373
-
1374
- /**
1375
- * Get the global settings from the options table.
1376
- *
1377
- * @return mixed
1378
- */
1379
- function get_global_settings( ){
1380
- $values = get_option( 'so_widget_settings[' . $this->widget_class . ']', array() );
1381
-
1382
- // Add in the defaults
1383
- if( $this->has_form( 'settings' ) ) {
1384
- $values = $this->add_defaults( $this->get_settings_form(), $values );
1385
- }
1386
-
1387
- return $values;
1388
- }
1389
-
1390
- /**
1391
- * Save the global settings. Handles validation too.
1392
- *
1393
- * @param array $values The new values
1394
- * @return array The sanitized values.
1395
- */
1396
- function save_global_settings( $values ){
1397
- $current = $this->get_global_settings();
1398
-
1399
- $values = $this->update( $values, $current, 'settings' );
1400
-
1401
- unset( $values['_sow_form_id'] );
1402
- update_option( 'so_widget_settings[' . $this->widget_class . ']', $values );
1403
-
1404
- return $values;
1405
- }
1406
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class SiteOrigin_Widget
5
+ *
6
+ * @author SiteOrigin <support@siteorigin.com>
7
+ */
8
+ abstract class SiteOrigin_Widget extends WP_Widget {
9
+ protected $form_options;
10
+ protected $base_folder;
11
+ protected $field_ids;
12
+ protected $fields;
13
+
14
+ /**
15
+ * The name of this widget class. Whatever the key for $wp_widgets_factory is.
16
+ *
17
+ * @var string
18
+ */
19
+ protected $widget_class;
20
+
21
+ /**
22
+ * @var array The array of registered frontend scripts
23
+ */
24
+ protected $frontend_scripts = array();
25
+
26
+ /**
27
+ * @var array The array of registered frontend styles
28
+ */
29
+ protected $frontend_styles = array();
30
+
31
+ protected $generated_css = array();
32
+ protected $current_instance;
33
+ protected $instance_storage;
34
+
35
+ /**
36
+ * @var int How many seconds a CSS file is valid for.
37
+ */
38
+ static $css_expire = 604800; // 7 days
39
+
40
+ /**
41
+ * @param string $id
42
+ * @param string $name
43
+ * @param array $widget_options Optional Normal WP_Widget widget options and a few extras.
44
+ * - help: A URL which, if present, causes a help link to be displayed on the Edit Widget modal.
45
+ * - instance_storage: Whether or not to temporarily store instances of this widget.
46
+ * - has_preview: Whether or not this widget has a preview to display. If false, the form does not output a
47
+ * 'Preview' button.
48
+ * @param array $control_options Optional Normal WP_Widget control options.
49
+ * @param array $form_options Optional An array describing the form fields used to configure SiteOrigin widgets.
50
+ * @param mixed $base_folder Optional
51
+ *
52
+ */
53
+ function __construct($id, $name, $widget_options = array(), $control_options = array(), $form_options = array(), $base_folder = false) {
54
+ $this->form_options = $form_options;
55
+ $this->base_folder = $base_folder;
56
+ $this->field_ids = array();
57
+ $this->fields = array();
58
+
59
+ $widget_options = wp_parse_args( $widget_options, array(
60
+ 'has_preview' => true,
61
+ ) );
62
+
63
+ $control_options = wp_parse_args( $control_options, array(
64
+ 'width' => 800,
65
+ ) );
66
+
67
+ if( empty( $this->widget_class ) ) {
68
+ $this->widget_class = get_class( $this );
69
+ }
70
+
71
+ parent::__construct($id, $name, $widget_options, $control_options);
72
+ $this->initialize();
73
+
74
+ // Let other plugins do additional initializing here
75
+ do_action('siteorigin_widgets_initialize_widget_' . $this->id_base, $this);
76
+ }
77
+
78
+ /**
79
+ * Initialize this widget in whatever way we need to. Run before rendering widget or form.
80
+ */
81
+ function initialize(){
82
+
83
+ }
84
+
85
+ /**
86
+ * Get the main widget form. This should be overwritten by child widgets.
87
+ *
88
+ * @return array
89
+ */
90
+ function get_widget_form(){
91
+ return method_exists( $this, 'initialize_form' ) ? $this->initialize_form() : array();
92
+ }
93
+
94
+ private function get_cached_widget_form() {
95
+ $cache_key = $this->id_base . '_form';
96
+ $form_options = wp_cache_get( $cache_key, 'siteorigin_widgets' );
97
+
98
+ if ( empty( $form_options ) ) {
99
+ $form_options = $this->get_widget_form();
100
+ wp_cache_set( $cache_key, $form_options, 'siteorigin_widgets' );
101
+ }
102
+
103
+ return $form_options;
104
+ }
105
+
106
+ /**
107
+ * Check if a child widget implements a specific form type.
108
+ *
109
+ * @param string $form_type
110
+ * @return bool
111
+ */
112
+ function has_form( $form_type = 'widget' ){
113
+ return method_exists( $this, 'get_' . $form_type . '_form' );
114
+ }
115
+
116
+ /**
117
+ * Get a specific type of form.
118
+ *
119
+ * @param $form_type
120
+ * @return array The form array, or an empty array if the form doesn't exist.
121
+ */
122
+ function get_form( $form_type ) {
123
+ return $this->has_form( $form_type ) ? call_user_func( array( $this, 'get_' . $form_type . '_form' ) ) : array();
124
+ }
125
+
126
+ /**
127
+ * Get the main form options and allow child widgets to modify that form.
128
+ *
129
+ * @param bool|SiteOrigin_Widget $parent
130
+ *
131
+ * @return mixed
132
+ */
133
+ function form_options( $parent = false ) {
134
+ if( empty( $this->form_options ) ) {
135
+ // If the widget doesn't have form_options defined from the constructor, then it might be defining them in the get_widget_form function
136
+ $this->form_options = $this->get_cached_widget_form();
137
+ }
138
+
139
+ $form_options = $this->modify_form( $this->form_options );
140
+ if( !empty($parent) ) {
141
+ $form_options = $parent->modify_child_widget_form( $form_options, $this );
142
+ }
143
+
144
+ // Give other plugins a way to modify this form.
145
+ $form_options = apply_filters( 'siteorigin_widgets_form_options', $form_options, $this );
146
+ $form_options = apply_filters( 'siteorigin_widgets_form_options_' . $this->id_base, $form_options, $this );
147
+ return $form_options;
148
+ }
149
+
150
+ /**
151
+ * Display the widget.
152
+ *
153
+ * @param array $args
154
+ * @param array $instance
155
+ */
156
+ public function widget( $args, $instance ) {
157
+ if( empty( $this->form_options ) ) {
158
+ $form_options = $this->get_cached_widget_form();
159
+ }
160
+ else {
161
+ $form_options = $this->modify_form( $this->form_options );
162
+ }
163
+
164
+ $instance = $this->modify_instance( $instance );
165
+
166
+ // Filter the instance
167
+ $instance = apply_filters( 'siteorigin_widgets_instance', $instance, $this );
168
+ $instance = apply_filters( 'siteorigin_widgets_instance_' . $this->id_base, $instance, $this );
169
+
170
+ $args = wp_parse_args( $args, array(
171
+ 'before_widget' => '',
172
+ 'after_widget' => '',
173
+ 'before_title' => '',
174
+ 'after_title' => '',
175
+ ) );
176
+
177
+ // Add any missing default values to the instance
178
+ $instance = $this->add_defaults( $form_options, $instance );
179
+
180
+ $css_name = $this->generate_and_enqueue_instance_styles( $instance );
181
+ $this->enqueue_frontend_scripts( $instance );
182
+
183
+ $template_vars = $this->get_template_variables($instance, $args);
184
+ $template_vars = apply_filters( 'siteorigin_widgets_template_variables_' . $this->id_base, $template_vars, $instance, $args, $this );
185
+
186
+ // Storage hash allows templates to get access to
187
+ $template_vars[ 'storage_hash' ] = '';
188
+ if( !empty($this->widget_options['instance_storage']) ) {
189
+ $stored_instance = $this->modify_stored_instance($instance);
190
+ // We probably don't want panels_info
191
+ unset( $stored_instance['panels_info'] );
192
+
193
+ $template_vars[ 'storage_hash' ] = substr( md5( serialize( $stored_instance ) ), 0, 8 );
194
+ if( !empty( $stored_instance ) && !$this->is_preview( $instance ) ) {
195
+ // Store this if we have a non empty instance and are not previewing
196
+ set_transient('sow_inst[' . $this->id_base . '][' . $template_vars['storage_hash'] . ']', $stored_instance, 7*86400);
197
+ }
198
+ }
199
+
200
+ if( ! method_exists( $this, 'get_html_content' ) ) {
201
+ $template_file = siteorigin_widget_get_plugin_dir_path( $this->id_base ) . $this->get_template_dir( $instance ) . '/' . $this->get_template_name( $instance ) . '.php';
202
+ $template_file = apply_filters('siteorigin_widgets_template_file_' . $this->id_base, $template_file, $instance, $this );
203
+ $template_file = realpath($template_file);
204
+
205
+ // Don't accept non PHP files
206
+ if( substr($template_file, -4) != '.php' ) $template_file = false;
207
+
208
+ ob_start();
209
+ if( !empty($template_file) && file_exists($template_file) ) {
210
+ extract( $template_vars );
211
+ @ include $template_file;
212
+ }
213
+ $template_html = ob_get_clean();
214
+
215
+ // This is a legacy, undocumented filter.
216
+ $template_html = apply_filters( 'siteorigin_widgets_template', $template_html, $this->widget_class, $instance, $this );
217
+ $template_html = apply_filters( 'siteorigin_widgets_template_html_' . $this->id_base, $template_html, $instance, $this );
218
+ }
219
+ else {
220
+ $template_html = $this->get_html_content( $instance, $args, $template_vars, $css_name );
221
+ }
222
+
223
+ $wrapper_classes = apply_filters(
224
+ 'siteorigin_widgets_wrapper_classes_' . $this->id_base,
225
+ array( 'so-widget-' . $this->id_base, 'so-widget-'.$css_name ),
226
+ $instance,
227
+ $this
228
+ );
229
+ $wrapper_classes = array_map( 'sanitize_html_class', $wrapper_classes );
230
+
231
+ $wrapper_data_string = $this->get_wrapper_data( $instance );
232
+
233
+ do_action( 'siteorigin_widgets_before_widget_' . $this->id_base, $instance, $this );
234
+ echo $args['before_widget'];
235
+ echo '<div class="' . esc_attr( implode( ' ', $wrapper_classes ) ) . '"' . $wrapper_data_string . '>';
236
+ echo $template_html;
237
+ echo '</div>';
238
+ echo $args['after_widget'];
239
+ do_action( 'siteorigin_widgets_after_widget_' . $this->id_base, $instance, $this );
240
+
241
+ if ( $this->is_preview( $instance ) ) {
242
+ // print inline styles if we're preview the widget.
243
+ siteorigin_widget_print_styles();
244
+ }
245
+ }
246
+
247
+ private function get_wrapper_data( $instance ) {
248
+ $data = apply_filters(
249
+ 'siteorigin_widgets_wrapper_data_' . $this->id_base,
250
+ array(),
251
+ $instance,
252
+ $this
253
+ );
254
+ $wrapper_attr_string = '';
255
+ foreach ( $data as $name => $value ) {
256
+ $wrapper_attr_string .= ' data-' . esc_html( $name ) . '="' . esc_attr( $value ) . '"';
257
+ }
258
+
259
+ return $wrapper_attr_string;
260
+ }
261
+
262
+ /**
263
+ * Generate the CSS for this widget and display it in the appropriate way
264
+ *
265
+ * @param $instance array The instance array
266
+ *
267
+ * @return string The CSS name
268
+ */
269
+ function generate_and_enqueue_instance_styles( $instance ) {
270
+ if( empty( $form_options ) ) {
271
+ $form_options = $this->get_cached_widget_form();
272
+ }
273
+ else {
274
+ $form_options = $this->modify_form( $this->form_options );
275
+ }
276
+
277
+ // We'll assume empty instances don't have styles
278
+ if( empty($instance) ) return;
279
+
280
+ // Make sure all the default values are in place
281
+ $instance = $this->add_defaults( $form_options, $instance );
282
+
283
+ $this->current_instance = $instance;
284
+ $style = $this->get_style_name( $instance );
285
+
286
+ $upload_dir = wp_upload_dir();
287
+ $this->clear_file_cache();
288
+
289
+ if( !empty($style) ) {
290
+ $hash = $this->get_style_hash( $instance );
291
+ $css_name = $this->id_base.'-'.$style.'-'.$hash;
292
+
293
+ //Ensure styles aren't generated and enqueued more than once.
294
+ $in_preview = $this->is_preview( $instance );
295
+ if ( ! in_array( $css_name, $this->generated_css ) || $in_preview ) {
296
+ if( $in_preview ) {
297
+ siteorigin_widget_add_inline_css( $this->get_instance_css( $instance ) );
298
+ }
299
+ else {
300
+ if( !file_exists( $upload_dir['basedir'] . '/siteorigin-widgets/' . $css_name .'.css' ) || ( defined('SITEORIGIN_WIDGETS_DEBUG') && SITEORIGIN_WIDGETS_DEBUG ) ) {
301
+ // Attempt to recreate the CSS
302
+ $this->save_css( $instance );
303
+ }
304
+
305
+ if( file_exists( $upload_dir['basedir'] . '/siteorigin-widgets/' . $css_name .'.css' ) ) {
306
+ if ( ! wp_style_is( $css_name ) ) {
307
+ wp_enqueue_style(
308
+ $css_name,
309
+ set_url_scheme($upload_dir['baseurl'] . '/siteorigin-widgets/' . $css_name .'.css')
310
+ );
311
+ }
312
+ }
313
+ else {
314
+ // Fall back to using inline CSS if we can't find the cached CSS file.
315
+ // Try get the cached value.
316
+ $css = wp_cache_get( $css_name, 'siteorigin_widgets' );
317
+ if ( empty( $css ) ) {
318
+ $css = $this->get_instance_css( $instance );
319
+ }
320
+ siteorigin_widget_add_inline_css( $css );
321
+ }
322
+ }
323
+ $this->generated_css[] = $css_name;
324
+ }
325
+ }
326
+ else {
327
+ $css_name = $this->id_base.'-base';
328
+ }
329
+
330
+ $this->current_instance = false;
331
+ return $css_name;
332
+ }
333
+
334
+ private function is_customize_preview(){
335
+ global $wp_customize;
336
+ return is_a( $wp_customize, 'WP_Customize_Manager' ) && $wp_customize->is_preview();
337
+ }
338
+
339
+ private function is_block_editor_page() {
340
+ $current_screen = function_exists( 'get_current_screen' ) ? get_current_screen() : null;
341
+
342
+ // This is for the Gutenberg plugin.
343
+ $is_gutenberg_page = $current_screen != null &&
344
+ function_exists( 'is_gutenberg_page' ) &&
345
+ is_gutenberg_page();
346
+ // This is for WP 5 with the integrated block editor.
347
+ $is_block_editor = false;
348
+ if ( ! empty( $current_screen ) && method_exists( $current_screen, 'is_block_editor' ) ) {
349
+ $is_block_editor = $current_screen->is_block_editor();
350
+ }
351
+
352
+ return $is_block_editor || $is_gutenberg_page;
353
+ }
354
+
355
+ /**
356
+ * Get an array of variables to make available to templates. By default, just return an array. Should be overwritten by child widgets.
357
+ *
358
+ * @param $instance
359
+ * @param $args
360
+ *
361
+ * @return array
362
+ */
363
+ public function get_template_variables( $instance, $args ){
364
+ return array();
365
+ }
366
+
367
+ /**
368
+ * Render a sub widget. This should be used inside template files.
369
+ *
370
+ * @param $class
371
+ * @param $args
372
+ * @param $instance
373
+ */
374
+ public function sub_widget($class, $args, $instance){
375
+ if(!class_exists($class)) return;
376
+ $widget = new $class;
377
+
378
+ $args['before_widget'] = '';
379
+ $args['after_widget'] = '';
380
+
381
+ $widget->widget( $args, $instance );
382
+ }
383
+
384
+ /**
385
+ * Add default values to the instance.
386
+ *
387
+ * @param $form
388
+ * @param $instance
389
+ */
390
+ function add_defaults( $form, $instance, $level = 0 ){
391
+ if( $level > 10 ) return $instance;
392
+
393
+ foreach($form as $id => $field) {
394
+
395
+ if( $field['type'] == 'repeater' ) {
396
+ if( !empty($instance[$id]) ) {
397
+ foreach( array_keys($instance[$id]) as $i ){
398
+ $instance[$id][$i] = $this->add_defaults( $field['fields'], $instance[$id][$i], $level + 1 );
399
+ }
400
+ }
401
+ }
402
+ else if( $field['type'] == 'section' ) {
403
+ if( empty($instance[$id]) ) {
404
+ $instance[$id] = array();
405
+ }
406
+ $instance[$id] = $this->add_defaults( $field['fields'], $instance[$id], $level + 1 );
407
+ }
408
+ else if( $field['type'] == 'measurement' ) {
409
+ if( ! isset( $instance[$id] ) ) {
410
+ $instance[$id] = isset( $field['default'] ) ? $field['default'] : '';
411
+ }
412
+ if ( empty( $instance[ $id . '_unit' ] ) ) {
413
+ $instance[ $id . '_unit' ] = 'px';
414
+ }
415
+ }
416
+ else if ( $field['type'] == 'order') {
417
+ if ( empty( $instance[$id] ) ) {
418
+ if( ! empty( $field['default'] ) ) {
419
+ $instance[$id] = $field['default'];
420
+ } else {
421
+ // If no default order is specified, just use the order of the options.
422
+ $instance[$id] = array_keys( $field['options'] );
423
+ }
424
+ }
425
+ }
426
+ else {
427
+ if( !isset( $instance[$id] ) ) {
428
+ $instance[$id] = isset( $field['default'] ) ? $field['default'] : '';
429
+ }
430
+ }
431
+ }
432
+
433
+ return $instance;
434
+ }
435
+
436
+ /**
437
+ * Display the widget form.
438
+ *
439
+ * @param array $instance
440
+ * @param string $form_type Which type of form we're using
441
+ *
442
+ * @return string|void
443
+ */
444
+ public function form( $instance, $form_type = 'widget' ) {
445
+ if( $form_type == 'widget' ) {
446
+ if( empty( $this->form_options ) ) {
447
+ $this->form_options = $this->form_options();
448
+ }
449
+ $form_options = $this->form_options;
450
+ }
451
+ else {
452
+ $form_options = $this->get_form( $form_type );
453
+ }
454
+
455
+ $instance = $this->modify_instance($instance);
456
+ $instance = $this->add_defaults( $form_options, $instance );
457
+
458
+ if( empty( $this->number ) ) {
459
+ // Compatibility with form widgets.
460
+ $this->number = 1;
461
+ }
462
+
463
+ // Filter the instance specifically for the form
464
+ $instance = apply_filters('siteorigin_widgets_form_instance_' . $this->id_base, $instance, $this);
465
+
466
+ // `more_entropy` adds a period to the id.
467
+ $id = str_replace( '.', '', uniqid( rand(), true ) );
468
+ $form_id = 'siteorigin_widget_form_' . md5( $id );
469
+ $class_name = str_replace( '_', '-', strtolower( $this->widget_class ) );
470
+
471
+ if( empty( $instance['_sow_form_id'] ) ) {
472
+ $instance['_sow_form_id'] = $id;
473
+ }
474
+ ?>
475
+ <div class="siteorigin-widget-form siteorigin-widget-form-main siteorigin-widget-form-main-<?php echo esc_attr($class_name) ?>"
476
+ id="<?php echo $form_id ?>" data-class="<?php echo esc_attr( $this->widget_class ) ?>"
477
+ data-id-base="<?php echo esc_attr( $this->id_base ) ?>" style="display: none">
478
+ <?php
479
+ $this->display_teaser_message();
480
+ /* @var $field_factory SiteOrigin_Widget_Field_Factory */
481
+ $field_factory = SiteOrigin_Widget_Field_Factory::single();
482
+ $fields_javascript_variables = array();
483
+ foreach( $form_options as $field_name => $field_options ) {
484
+ /* @var $field SiteOrigin_Widget_Field_Base */
485
+ $field = $field_factory->create_field( $field_name, $field_options, $this );
486
+ $field->render( isset( $instance[$field_name] ) ? $instance[$field_name] : null, $instance );
487
+ $field_js_vars = $field->get_javascript_variables();
488
+ if( ! empty( $field_js_vars ) ) {
489
+ $fields_javascript_variables[$field_name] = $field_js_vars;
490
+ }
491
+ $field->enqueue_scripts();
492
+ $this->fields[$field_name] = $field;
493
+ }
494
+ ?>
495
+ <input type="hidden" name="<?php echo $this->so_get_field_name('_sow_form_id') ?>" value="<?php echo esc_attr( $instance['_sow_form_id'] ) ?>" class="siteorigin-widgets-form-id" />
496
+ <input type="hidden" name="<?php echo $this->so_get_field_name('_sow_form_timestamp') ?>" value="<?php echo ! empty( $instance['_sow_form_timestamp'] ) ? esc_attr( $instance['_sow_form_timestamp'] ) : '' ?>" class="siteorigin-widgets-form-timestamp" />
497
+ </div>
498
+ <div class="siteorigin-widget-form-no-styles">
499
+ <?php $this->scripts_loading_message() ?>
500
+ </div>
501
+
502
+ <?php if( $this->show_preview_button() ) : ?>
503
+ <div class="siteorigin-widget-preview" style="display: none">
504
+ <a href="#" class="siteorigin-widget-preview-button button-secondary"><?php _e('Preview', 'so-widgets-bundle') ?></a>
505
+ </div>
506
+ <?php endif; ?>
507
+
508
+ <?php if( !empty( $this->widget_options['help'] ) ) : ?>
509
+ <a href="<?php echo sow_esc_url($this->widget_options['help']) ?>" class="siteorigin-widget-help-link siteorigin-panels-help-link" target="_blank" rel="noopener noreferrer"><?php _e('Help', 'so-widgets-bundle') ?></a>
510
+ <?php endif; ?>
511
+
512
+ <script type="text/javascript">
513
+ ( function($) {
514
+ if(typeof window.sow_field_javascript_variables == 'undefined') window.sow_field_javascript_variables = {};
515
+ window.sow_field_javascript_variables["<?php echo addslashes( $this->widget_class ) ?>"] = <?php echo json_encode( $fields_javascript_variables ) ?>;
516
+
517
+ if( typeof $.fn.sowSetupForm != 'undefined' ) {
518
+ $('#<?php echo $form_id ?>').sowSetupForm();
519
+ }
520
+ else {
521
+ // Init once admin scripts have been loaded
522
+ $( document).on('sowadminloaded', function(){
523
+ $('#<?php echo $form_id ?>').sowSetupForm();
524
+ });
525
+ }
526
+ } )( jQuery );
527
+ </script>
528
+ <?php
529
+
530
+ $this->enqueue_scripts( $form_type );
531
+ }
532
+
533
+ /**
534
+ * Display the teaser message.
535
+ */
536
+ function display_teaser_message(){
537
+ if(
538
+ method_exists( $this, 'get_form_teaser' ) &&
539
+ ( $teaser = $this->get_form_teaser() )
540
+ ) {
541
+ if ( ! is_admin() ) {
542
+ wp_enqueue_style( 'dashicons' );
543
+ }
544
+
545
+ $dismissed = get_user_meta( get_current_user_id(), 'teasers_dismissed', true );
546
+ if( empty( $dismissed[ $this->id_base ] ) ) {
547
+ $dismiss_url = add_query_arg( array(
548
+ 'action' => 'so_dismiss_widget_teaser',
549
+ 'widget' => $this->id_base,
550
+ ), admin_url( 'admin-ajax.php' ) );
551
+ $dismiss_url = wp_nonce_url( $dismiss_url, 'dismiss-widget-teaser' );
552
+
553
+ ?>
554
+ <div class="siteorigin-widget-teaser">
555
+ <?php echo wp_kses_post( $teaser ) ?>
556
+ <span class="dashicons dashicons-dismiss" data-dismiss-url="<?php echo esc_url( $dismiss_url ) ?>"></span>
557
+ </div>
558
+ <?php
559
+ }
560
+ }
561
+ }
562
+
563
+ /**
564
+ * Should we display the teaser for SiteOrigin Premium
565
+ *
566
+ * @return bool
567
+ */
568
+ function display_siteorigin_premium_teaser(){
569
+ return apply_filters( 'siteorigin_premium_upgrade_teaser', true ) &&
570
+ ! defined( 'SITEORIGIN_PREMIUM_VERSION' );
571
+ }
572
+
573
+ function scripts_loading_message(){
574
+ ?>
575
+ <p><strong><?php _e('This widget has scripts and styles that need to be loaded before you can use it. Please save and reload your current page.', 'so-widgets-bundle') ?></strong></p>
576
+ <p><strong><?php _e('You will only need to do this once.', 'so-widgets-bundle') ?></strong></p>
577
+ <?php
578
+ }
579
+
580
+ /**
581
+ * Enqueue the admin scripts for the widget form.
582
+ *
583
+ * @param bool|string $form_type Should we enqueue the field scripts too?
584
+ */
585
+ function enqueue_scripts( $form_type = false ) {
586
+
587
+ if( ! wp_script_is('siteorigin-widget-admin') ) {
588
+ wp_enqueue_style( 'wp-color-picker' );
589
+ wp_enqueue_style( 'siteorigin-widget-admin', plugin_dir_url(SOW_BUNDLE_BASE_FILE).'base/css/admin.css', array( 'media-views' ), SOW_BUNDLE_VERSION );
590
+
591
+ wp_enqueue_script( 'wp-color-picker' );
592
+ wp_enqueue_media();
593
+ wp_enqueue_script(
594
+ 'siteorigin-widget-admin',
595
+ plugin_dir_url( SOW_BUNDLE_BASE_FILE ) . 'base/js/admin' . SOW_BUNDLE_JS_SUFFIX . '.js',
596
+ array( 'jquery', 'jquery-ui-sortable', 'jquery-ui-slider', 'underscore' ),
597
+ SOW_BUNDLE_VERSION,
598
+ true
599
+ );
600
+
601
+ wp_localize_script( 'siteorigin-widget-admin', 'soWidgets', array(
602
+ 'ajaxurl' => wp_nonce_url( admin_url('admin-ajax.php'), 'widgets_action', '_widgets_nonce' ),
603
+ 'sure' => __('Are you sure?', 'so-widgets-bundle'),
604
+ 'backup' => array(
605
+ 'newerVersion' => __( "There is a newer version of this widget's content available.", 'so-widgets-bundle' ),
606
+ 'restore' => __( 'Restore', 'so-widgets-bundle' ),
607
+ 'dismiss' => __( 'Dismiss', 'so-widgets-bundle' ),
608
+ 'replaceWarning' => sprintf(
609
+ __( 'Clicking %s will replace the current widget contents. You can revert by refreshing the page before updating.', 'so-widgets-bundle' ),
610
+ '<em>' . __( 'Restore', 'so-widgets-bundle' ) . '</em>'
611
+ ),
612
+ ),
613
+ ) );
614
+
615
+ global $wp_customize;
616
+ if ( isset( $wp_customize ) ) {
617
+ $this->footer_admin_templates();
618
+ }
619
+ else {
620
+ add_action( 'admin_footer', array( $this, 'footer_admin_templates' ) );
621
+ }
622
+ }
623
+
624
+ if( !empty( $form_type ) && $this->has_form( $form_type ) ) {
625
+ // Enqueue field scripts for the given form type
626
+ $form_options = $this->get_form( $form_type );
627
+ $this->enqueue_field_scripts( $form_options );
628
+ }
629
+
630
+ // This lets the widget enqueue any specific admin scripts
631
+ $this->enqueue_admin_scripts();
632
+ do_action( 'siteorigin_widgets_enqueue_admin_scripts_' . $this->id_base, $this );
633
+ }
634
+
635
+ function enqueue_field_scripts( $fields ){
636
+ /* @var $field_factory SiteOrigin_Widget_Field_Factory */
637
+ $field_factory = SiteOrigin_Widget_Field_Factory::single();
638
+
639
+ foreach( $fields as $field_name => $field_options ) {
640
+ /* @var $field SiteOrigin_Widget_Field_Base */
641
+ $field = $field_factory->create_field( $field_name, $field_options, $this );
642
+ $field->enqueue_scripts();
643
+
644
+ if( !empty( $field_options['fields'] ) ) {
645
+ $this->enqueue_field_scripts( $field_options['fields'] );
646
+ }
647
+ }
648
+ }
649
+
650
+ /**
651
+ * Display all the admin stuff for the footer
652
+ */
653
+ function footer_admin_templates(){
654
+ ?>
655
+ <script type="text/template" id="so-widgets-bundle-tpl-preview-dialog">
656
+ <div class="so-widgets-dialog">
657
+ <div class="so-widgets-dialog-overlay"></div>
658
+
659
+ <div class="so-widgets-toolbar">
660
+ <h3><?php _e( 'Widget Preview', 'so-widgets-bundle' ) ?></h3>
661
+ <div class="close"><span class="dashicons dashicons-arrow-left-alt2"></span></div>
662
+ </div>
663
+
664
+ <div class="so-widgets-dialog-frame">
665
+ <iframe name="siteorigin-widgets-preview-iframe" id="siteorigin-widget-preview-iframe" style="visibility: hidden"></iframe>
666
+ </div>
667
+
668
+ <form target="siteorigin-widgets-preview-iframe" action="<?php echo wp_nonce_url( admin_url('admin-ajax.php'), 'widgets_action', '_widgets_nonce' ) ?>" method="post">
669
+ <input type="hidden" name="action" value="so_widgets_preview" />
670
+ <input type="hidden" name="data" value="" />
671
+ <input type="hidden" name="class" value="" />
672
+ </form>
673
+
674
+ </div>
675
+ </script>
676
+ <?php
677
+
678
+ // Give other plugins a chance to add their own
679
+ do_action('siteorigin_widgets_footer_admin_templates');
680
+ }
681
+
682
+ /**
683
+ * Update the widget instance.
684
+ *
685
+ * @param array $new_instance
686
+ * @param array $old_instance
687
+ * @param string $form_type The type of form we're using.
688
+ * @return array|void
689
+ */
690
+ public function update( $new_instance, $old_instance, $form_type = 'widget' ) {
691
+ if( !class_exists('SiteOrigin_Widgets_Color_Object') ) require plugin_dir_path( __FILE__ ).'inc/color.php';
692
+
693
+ if( $form_type == 'widget' ) {
694
+ if( empty( $this->form_options ) ) {
695
+ $this->form_options = $this->form_options();
696
+ }
697
+ $form_options = $this->form_options;
698
+ }
699
+ else {
700
+ $form_options = $this->get_form( $form_type );
701
+ }
702
+
703
+ if( ! empty( $form_options ) ) {
704
+ /* @var $field_factory SiteOrigin_Widget_Field_Factory */
705
+ $field_factory = SiteOrigin_Widget_Field_Factory::single();
706
+ foreach ( $form_options as $field_name => $field_options ) {
707
+ /* @var $field SiteOrigin_Widget_Field_Base */
708
+ if ( !empty( $this->fields ) && !empty( $this->fields[$field_name] ) ) {
709
+ $field = $this->fields[$field_name];
710
+ }
711
+ else {
712
+ $field = $field_factory->create_field( $field_name, $field_options, $this );
713
+ $this->fields[$field_name] = $field;
714
+ }
715
+ $new_instance[$field_name] = $field->sanitize(
716
+ isset( $new_instance[$field_name] ) ? $new_instance[$field_name] : null,
717
+ $new_instance,
718
+ isset( $old_instance[$field_name] ) ? $old_instance[$field_name] : null
719
+ );
720
+ $new_instance = $field->sanitize_instance( $new_instance );
721
+ }
722
+
723
+ // Let other plugins also sanitize the instance
724
+ $new_instance = apply_filters( 'siteorigin_widgets_sanitize_instance', $new_instance, $form_options, $this );
725
+ $new_instance = apply_filters( 'siteorigin_widgets_sanitize_instance_' . $this->id_base, $new_instance, $form_options, $this );
726
+ }
727
+
728
+ // Remove the old CSS, it'll be regenerated on page load.
729
+ $this->delete_css( $this->modify_instance( $old_instance ) );
730
+ return $new_instance;
731
+ }
732
+
733
+ /**
734
+ * Save the CSS to the filesystem
735
+ *
736
+ * @param $instance
737
+ * @return bool|string
738
+ */
739
+ private function save_css( $instance ){
740
+ require_once ABSPATH . 'wp-admin/includes/file.php';
741
+
742
+ $style = $this->get_style_name($instance);
743
+ $hash = $this->get_style_hash( $instance );
744
+ $name = $this->id_base.'-'.$style.'-'.$hash.'.css';
745
+
746
+ $css = $this->get_instance_css($instance);
747
+
748
+ if ( ! empty( $css ) ) {
749
+ if ( WP_Filesystem() ) {
750
+ global $wp_filesystem;
751
+ $upload_dir = wp_upload_dir();
752
+
753
+ $dir_exists = $wp_filesystem->is_dir( $upload_dir['basedir'] . '/siteorigin-widgets/' );
754
+
755
+ if ( empty( $dir_exists ) ) {
756
+ // The 'siteorigin-widgets' directory doesn't exist, so try to create it.
757
+ $dir_exists = $wp_filesystem->mkdir( $upload_dir['basedir'] . '/siteorigin-widgets/' );
758
+ }
759
+
760
+ if ( ! empty( $dir_exists ) ) {
761
+ // The 'siteorigin-widgets' directory exists, so we can try to write the CSS to a file.
762
+ $wp_filesystem->delete( $upload_dir['basedir'] . '/siteorigin-widgets/' . $name );
763
+ $file_put_success = $wp_filesystem->put_contents(
764
+ $upload_dir['basedir'] . '/siteorigin-widgets/' . $name,
765
+ $css
766
+ );
767
+
768
+ // Alert other plugins that we've added a new CSS file
769
+ do_action( 'siteorigin_widgets_stylesheet_added', $name, $instance );
770
+ }
771
+ }
772
+
773
+ // We couldn't write to file, so let's use cache instead.
774
+ if ( empty( $file_put_success ) ) {
775
+ wp_cache_add( $name, $css, 'siteorigin_widgets' );
776
+ }
777
+
778
+ return $hash;
779
+ }
780
+
781
+ return false;
782
+ }
783
+
784
+ /**
785
+ * Clears CSS for a specific instance
786
+ */
787
+ private function delete_css( $instance ){
788
+ require_once ABSPATH . 'wp-admin/includes/file.php';
789
+
790
+ if( WP_Filesystem() ) {
791
+ global $wp_filesystem;
792
+ $upload_dir = wp_upload_dir();
793
+
794
+ $style = $this->get_style_name($instance);
795
+ $hash = $this->get_style_hash( $instance );
796
+ $name = $this->id_base.'-'.$style.'-'.$hash;
797
+
798
+ $wp_filesystem->delete($upload_dir['basedir'] . '/siteorigin-widgets/' . $name . '.css');
799
+ if ( in_array( $name, $this->generated_css ) ) {
800
+ $index = array_search( $name, $this->generated_css );
801
+ unset( $this->generated_css[$index] );
802
+ //Reindex array
803
+ $this->generated_css = array_values( $this->generated_css );
804
+ }
805
+
806
+ // Alert other plugins that we've deleted a CSS file
807
+ do_action( 'siteorigin_widgets_stylesheet_deleted', $name, $instance );
808
+ }
809
+ }
810
+
811
+ /**
812
+ * Clear all old CSS files
813
+ *
814
+ * @var bool $force Must we force a cache refresh.
815
+ */
816
+ public static function clear_file_cache( $force_delete = false ){
817
+ // Use this variable to ensure this only runs once per request
818
+ static $done = false;
819
+ if ( $done && !$force_delete ) return;
820
+
821
+ if( !get_transient('sow:cleared') || $force_delete ) {
822
+
823
+ require_once ABSPATH . 'wp-admin/includes/file.php';
824
+ if( WP_Filesystem() ) {
825
+ global $wp_filesystem;
826
+ $upload_dir = wp_upload_dir();
827
+
828
+ $list = $wp_filesystem->dirlist( $upload_dir['basedir'] . '/siteorigin-widgets/' );
829
+ if ( ! empty( $list ) ) {
830
+ foreach($list as $file) {
831
+ if( $file['lastmodunix'] < time() - self::$css_expire || $force_delete ) {
832
+ // Delete the file
833
+ $wp_filesystem->delete( $upload_dir['basedir'] . '/siteorigin-widgets/' . $file['name'] );
834
+ }
835
+ }
836
+ }
837
+ }
838
+
839
+ // Set this transient so we know when to clear all the generated CSS.
840
+ set_transient('sow:cleared', true, self::$css_expire);
841
+ }
842
+
843
+ $done = true;
844
+ }
845
+
846
+ /**
847
+ * Generate the CSS for the widget.
848
+ *
849
+ * @param $instance
850
+ * @return string
851
+ */
852
+ public function get_instance_css( $instance ){
853
+ if( !class_exists( 'SiteOrigin_LessC' ) ) require plugin_dir_path( __FILE__ ) . 'inc/lessc.inc.php';
854
+ if( !class_exists('SiteOrigin_Widgets_Less_Functions') ) require plugin_dir_path( __FILE__ ).'inc/less-functions.php';
855
+
856
+ if( !method_exists( $this, 'get_less_content' ) ) {
857
+ $style_name = $this->get_style_name($instance);
858
+ if( empty($style_name) ) return '';
859
+
860
+ $less_file = siteorigin_widget_get_plugin_dir_path( $this->id_base ).'styles/'.$style_name . '.less';
861
+ $less_file = apply_filters( 'siteorigin_widgets_less_file_' . $this->id_base, $less_file, $instance, $this );
862
+
863
+ $less = ( substr( $less_file, -5 ) == '.less' && file_exists($less_file) ) ? file_get_contents( $less_file ) : '';
864
+ }
865
+ else {
866
+ // The widget is going handle getting the instance LESS
867
+ $less = $this->get_less_content( $instance );
868
+ }
869
+
870
+ // Substitute the variables
871
+ if( !class_exists('SiteOrigin_Widgets_Color_Object') ) require plugin_dir_path( __FILE__ ) . 'inc/color.php';
872
+
873
+ // Lets widgets insert their own custom generated LESS
874
+ $less = preg_replace_callback( '/\.widget-function\((.*)\);/', array( $this, 'less_widget_inject' ), $less );
875
+
876
+ //handle less @import statements
877
+ $less = preg_replace_callback( '/^@import\s+".*?\/?([\w\-\.]+)";/m', array( $this, 'get_less_import_contents' ), $less );
878
+
879
+ $vars = apply_filters( 'siteorigin_widgets_less_variables_' . $this->id_base, $this->get_less_variables( $instance ), $instance, $this );
880
+ if( !empty( $vars ) ){
881
+ foreach($vars as $name => $value) {
882
+ // Ignore empty string, false and null values (but keep '0')
883
+ if( $value === '' || $value === false || $value === null ) continue;
884
+
885
+ $less = preg_replace('/\@'.preg_quote($name).' *\:.*?;/', '@'.$name.': '.$value.';', $less);
886
+ }
887
+ }
888
+
889
+ $less = apply_filters( 'siteorigin_widgets_styles', $less, $this->widget_class, $instance );
890
+ $less = apply_filters( 'siteorigin_widgets_less_' . $this->id_base, $less, $instance, $this );
891
+
892
+ $css = '';
893
+
894
+ if( ! empty( $less ) ) {
895
+ $style = $this->get_style_name( $instance );
896
+ $hash = $this->get_style_hash( $instance );
897
+ $css_name = $this->id_base . '-' . $style . '-' . $hash;
898
+
899
+ //we assume that any remaining @imports are plain css imports and should be kept outside selectors
900
+ $css_imports = '';
901
+ if ( preg_match_all( '/^@import.+/m', $less, $imports ) ) {
902
+ $css_imports = implode( "\n", $imports[0] );
903
+ $less = preg_replace( '/^@import.+/m', '', $less );
904
+ }
905
+
906
+ $less = $css_imports . "\n\n" . '.so-widget-'.$css_name." { \n".$less."\n } ";
907
+
908
+ $compiler = new SiteOrigin_LessC();
909
+ $lc_functions = new SiteOrigin_Widgets_Less_Functions($this, $instance);
910
+ $lc_functions->registerFunctions( $compiler );
911
+ $compiler = apply_filters( 'siteorigin_widgets_less_compiler', $compiler, $instance, $this );
912
+
913
+ try {
914
+ if( method_exists( $compiler, 'compile' ) ) {
915
+ $css = $compiler->compile( $less );
916
+ }
917
+ }
918
+ catch ( Exception $e ) {
919
+ if( defined( 'SITEORIGIN_WIDGETS_DEBUG' ) && SITEORIGIN_WIDGETS_DEBUG ) {
920
+ throw $e;
921
+ }
922
+ }
923
+
924
+ // Remove any attributes with default as the value
925
+ $css = preg_replace('/[a-zA-Z\-]+ *: *default *;/', '', $css);
926
+
927
+ // Remove any empty CSS
928
+ $css = preg_replace('/[^{}]*\{\s*\}/m', '', $css);
929
+ $css = trim($css);
930
+ }
931
+
932
+ return apply_filters( 'siteorigin_widgets_instance_css', $css, $instance, $this );
933
+ }
934
+
935
+ /**
936
+ * Replaces LESS imports with the content from the actual files. This used as a preg callback.
937
+ *
938
+ * @param $matches
939
+ *
940
+ * @return string
941
+ */
942
+ private function get_less_import_contents($matches) {
943
+ $filename = $matches[1];
944
+
945
+ // First, we'll deal with a few special cases
946
+ switch( $filename ) {
947
+ case 'mixins':
948
+ return file_get_contents( plugin_dir_path( __FILE__ ) . 'less/mixins.less' );
949
+ break;
950
+
951
+ case 'lesshat':
952
+ return file_get_contents( plugin_dir_path( __FILE__ ) . 'less/lesshat.less' );
953
+ break;
954
+ }
955
+
956
+ //get file extension
957
+ preg_match( '/\.\w+$/', $filename, $ext );
958
+ //if there is a file extension and it's not .less or .css we ignore
959
+ if ( ! empty( $ext ) ) {
960
+ if ( ! ( $ext[0] == '.less' || $ext[0] == '.css' ) ) {
961
+ return '';
962
+ }
963
+ }
964
+ else {
965
+ $filename .= '.less';
966
+ }
967
+ //first check local widget styles directory and then bundle less directory
968
+ $search_path = array(
969
+ siteorigin_widget_get_plugin_dir_path( $this->id_base ) . 'styles/',
970
+ plugin_dir_path( __FILE__ ) . 'less/'
971
+ );
972
+
973
+ foreach ( $search_path as $dir ) {
974
+ if ( file_exists( $dir . $filename ) ) {
975
+ return file_get_contents( $dir . $filename )."\n\n";
976
+ }
977
+ }
978
+
979
+ //file not found
980
+ return '';
981
+ }
982
+
983
+ /**
984
+ * Used as a preg callback to replace .widget-function('some_function', ...) with output from less_some_function($instance, $args).
985
+ *
986
+ * @param $matches
987
+ *
988
+ * @return mixed|string
989
+ */
990
+ private function less_widget_inject($matches){
991
+ // We're going to lazily split the arguments by comma
992
+ $args = explode(',', $matches[1]);
993
+ if( empty($args[0]) ) return '';
994
+
995
+ // Shift the function name from the arguments
996
+ $func = 'less_' . trim( array_shift($args) , '\'"');
997
+ if( !method_exists($this, $func) ) return '';
998
+
999
+ // Finally call the function and include the
1000
+ $args = array_map('trim', $args);
1001
+ return call_user_func( array($this, $func), $this->current_instance, $args );
1002
+ }
1003
+
1004
+ /**
1005
+ * Less function for importing Google web fonts.
1006
+ *
1007
+ * @param $instance
1008
+ * @param $args
1009
+ *
1010
+ * @return string
1011
+ */
1012
+ function less_import_google_font($instance, $args) {
1013
+ if( empty( $instance ) ) return;
1014
+
1015
+ $fonts = $this->get_google_font_fields($instance);
1016
+ if( empty( $fonts ) || ! is_array( $fonts ) ) return '';
1017
+
1018
+ $font_imports = array();
1019
+
1020
+ foreach ( $fonts as $font ) {
1021
+ $font_imports[] = siteorigin_widget_get_font( $font );
1022
+ }
1023
+
1024
+ $import_strings = array();
1025
+ foreach( $font_imports as $import ) {
1026
+ $import_strings[] = !empty($import['css_import']) ? $import['css_import'] : '';
1027
+ }
1028
+
1029
+ // Remove empty and duplicate items from the array
1030
+ $import_strings = array_filter( $import_strings );
1031
+ $import_strings = array_unique( $import_strings );
1032
+
1033
+ return implode( "\n", $import_strings );
1034
+ }
1035
+
1036
+ /**
1037
+ * Get any font fields which may be used by this widget.
1038
+ *
1039
+ * @param $instance
1040
+ *
1041
+ * @return array
1042
+ */
1043
+ function get_google_font_fields( $instance ) {
1044
+ return apply_filters( 'siteorigin_widgets_google_font_fields_' . $this->id_base, array(), $instance, $this );
1045
+ }
1046
+
1047
+ /**
1048
+ * Utility function to get a field name for a widget field.
1049
+ *
1050
+ * @param $field_name
1051
+ * @param array $container
1052
+ * @return mixed|string
1053
+ */
1054
+ public function so_get_field_name( $field_name, $container = array() ) {
1055
+ if( empty($container) ) {
1056
+ $name = $this->get_field_name( $field_name );
1057
+ }
1058
+ else {
1059
+ // We also need to add the container fields
1060
+ $container_extras = '';
1061
+ foreach($container as $r) {
1062
+ $container_extras .= '[' . $r['name'] . ']';
1063
+
1064
+ if( $r['type'] == 'repeater' ) {
1065
+ $container_extras .= '[#' . $r['name'] . '#]';
1066
+ }
1067
+ }
1068
+
1069
+ $name = $this->get_field_name( '{{{FIELD_NAME}}}' );
1070
+ $name = str_replace('[{{{FIELD_NAME}}}]', $container_extras.'[' . esc_attr($field_name) . ']', $name);
1071
+ }
1072
+
1073
+ $name = apply_filters( 'siteorigin_widgets_get_field_name', $name );
1074
+ $name = apply_filters( 'siteorigin_widgets_get_field_name_' . $this->id_base, $name );
1075
+
1076
+ return $name;
1077
+ }
1078
+
1079
+ /**
1080
+ * Get the ID of this field.
1081
+ *
1082
+ * @param $field_name
1083
+ * @param array $container
1084
+ * @param boolean $is_template
1085
+ *
1086
+ * @return string
1087
+ */
1088
+ public function so_get_field_id( $field_name, $container = array(), $is_template = false ) {
1089
+ if( empty($container) ) {
1090
+ return $this->get_field_id($field_name);
1091
+ }
1092
+ else {
1093
+ $name = array();
1094
+ foreach ( $container as $container_item ) {
1095
+ $name[] = $container_item['name'];
1096
+ }
1097
+ $name[] = $field_name;
1098
+ $field_id_base = $this->get_field_id(implode('-', $name));
1099
+ if ( $is_template ) {
1100
+ return $field_id_base . '-_id_';
1101
+ }
1102
+ if ( ! isset( $this->field_ids[ $field_id_base ] ) ) {
1103
+ $this->field_ids[ $field_id_base ] = 1;
1104
+ }
1105
+ $curId = $this->field_ids[ $field_id_base ]++;
1106
+ return $field_id_base . '-' . $curId;
1107
+ }
1108
+ }
1109
+
1110
+ /**
1111
+ * Parse markdown
1112
+ *
1113
+ * @param $markdown
1114
+ * @return string The HTML
1115
+ *
1116
+ * @deprecated Will be removed in version 2.0
1117
+ */
1118
+ function parse_markdown( $markdown ){
1119
+ if( !class_exists('Parsedown') ) include plugin_dir_path(__FILE__).'inc/Parsedown.php';
1120
+ $parser = new Parsedown();
1121
+
1122
+ return $parser->text($markdown);
1123
+ }
1124
+
1125
+ /**
1126
+ * Get a hash that uniquely identifies this instance.
1127
+ *
1128
+ * @param $instance
1129
+ * @return string
1130
+ */
1131
+ function get_style_hash( $instance ) {
1132
+ $style_hash = apply_filters('siteorigin_widgets_widget_style_hash', '', $this);
1133
+ if( empty( $style_hash ) ) {
1134
+ if( method_exists( $this, 'get_style_hash_variables' ) ) {
1135
+ $vars = apply_filters( 'siteorigin_widgets_hash_variables_' . $this->id_base, $this->get_style_hash_variables( $instance ), $instance, $this );
1136
+ } else {
1137
+ $vars = apply_filters( 'siteorigin_widgets_less_variables_' . $this->id_base, $this->get_less_variables( $instance ), $instance, $this );
1138
+ }
1139
+ $version = property_exists( $this, 'version' ) ? $this->version : '';
1140
+
1141
+ $style_hash = substr( md5( json_encode( $vars ) . $version ), 0, 12 );
1142
+ }
1143
+
1144
+ return $style_hash;
1145
+ }
1146
+
1147
+ /**
1148
+ * Get the template name that we'll be using to render this widget.
1149
+ *
1150
+ * @param $instance
1151
+ * @return mixed
1152
+ */
1153
+ function get_template_name( $instance ) {
1154
+ return 'default';
1155
+ }
1156
+
1157
+ /**
1158
+ * Get the name of the directory in which we should look for the template. Relative to root of widget folder.
1159
+ *
1160
+ * @return mixed
1161
+ */
1162
+ function get_template_dir( $instance ) {
1163
+ return 'tpl';
1164
+ }
1165
+
1166
+ /**
1167
+ * Get the LESS style name we'll be using for this widget.
1168
+ *
1169
+ * @param $instance
1170
+ * @return mixed
1171
+ */
1172
+ function get_style_name( $instance ) {
1173
+ return 'default';
1174
+ }
1175
+
1176
+ /**
1177
+ * Get any variables that need to be substituted by
1178
+ *
1179
+ * @param $instance
1180
+ * @return array
1181
+ */
1182
+ function get_less_variables( $instance ){
1183
+ return array();
1184
+ }
1185
+
1186
+ /**
1187
+ * Filter the variables we'll be storing in temporary storage for this instance if we're using `instance_storage`
1188
+ *
1189
+ * @param $instance
1190
+ *
1191
+ * @return mixed
1192
+ */
1193
+ function modify_stored_instance( $instance ){
1194
+ return $instance;
1195
+ }
1196
+
1197
+ /**
1198
+ * Get the stored instance based on the hash.
1199
+ *
1200
+ * @param $hash
1201
+ *
1202
+ * @return object The instance
1203
+ */
1204
+ function get_stored_instance( $hash ) {
1205
+ return get_transient('sow_inst[' . $this->id_base . '][' . $hash . ']');
1206
+ }
1207
+
1208
+ /**
1209
+ * This function can be overwritten to modify form values in the child widget.
1210
+ *
1211
+ * @param $form
1212
+ * @return mixed
1213
+ */
1214
+ function modify_form( $form ) {
1215
+ return $form;
1216
+ }
1217
+
1218
+
1219
+ /**
1220
+ * This function can be overwritten to modify form values in the child widget.
1221
+ *
1222
+ * @param $child_widget_form
1223
+ * @param $child_widget
1224
+ * @return mixed
1225
+ */
1226
+ function modify_child_widget_form($child_widget_form, $child_widget) {
1227
+ return $child_widget_form;
1228
+ }
1229
+
1230
+ /**
1231
+ * This function should be overwritten by child widgets to filter an instance. Run before rendering the form and widget.
1232
+ *
1233
+ * @param $instance
1234
+ *
1235
+ * @return mixed
1236
+ */
1237
+ function modify_instance( $instance ){
1238
+ return $instance;
1239
+ }
1240
+
1241
+ /**
1242
+ * Can be overwritten by child widgets to make variables available to javascript via ajax calls. These are designed to be used in the admin.
1243
+ */
1244
+ function get_javascript_variables(){
1245
+
1246
+ }
1247
+
1248
+ /**
1249
+ * Used by child widgets to register scripts to be enqueued for the frontend.
1250
+ *
1251
+ * @param array $scripts an array of scripts. Each element is an array that corresponds to wp_enqueue_script arguments
1252
+ */
1253
+ public function register_frontend_scripts( $scripts ){
1254
+ foreach ( $scripts as $script ) {
1255
+ if ( ! isset( $this->frontend_scripts[ $script[0] ] ) ) {
1256
+ $this->frontend_scripts[$script[0]] = $script;
1257
+ }
1258
+ }
1259
+ }
1260
+
1261
+ /**
1262
+ * Enqueue all the registered scripts
1263
+ */
1264
+ function enqueue_registered_scripts( $instance ) {
1265
+ $f_scripts = apply_filters(
1266
+ 'siteorigin_widgets_frontend_scripts_' . $this->id_base,
1267
+ $this->frontend_scripts,
1268
+ $instance,
1269
+ $this
1270
+ );
1271
+
1272
+ foreach ( $f_scripts as $f_script ) {
1273
+ if ( ! wp_script_is( $f_script[0] ) ) {
1274
+ wp_enqueue_script(
1275
+ $f_script[0],
1276
+ isset( $f_script[1] ) ? $f_script[1] : false,
1277
+ isset( $f_script[2] ) ? $f_script[2] : array(),
1278
+ !empty( $f_script[3] ) ? $f_script[3] : SOW_BUNDLE_VERSION,
1279
+ isset( $f_script[4] ) ? $f_script[4] : false
1280
+ );
1281
+ }
1282
+ }
1283
+ }
1284
+
1285
+ /**
1286
+ * Used by child widgets to register styles to be enqueued for the frontend.
1287
+ *
1288
+ * @param array $styles an array of styles. Each element is an array that corresponds to wp_enqueue_style arguments
1289
+ */
1290
+ public function register_frontend_styles( $styles ) {
1291
+ foreach ( $styles as $style ) {
1292
+ if ( ! isset( $this->frontend_styles[ $style[0] ] ) ) {
1293
+ $this->frontend_styles[$style[0]] = $style;
1294
+ }
1295
+ }
1296
+ }
1297
+
1298
+ /**
1299
+ * Enqueue any frontend styles that were registered
1300
+ */
1301
+ function enqueue_registered_styles( $instance ) {
1302
+ $f_styles = apply_filters(
1303
+ 'siteorigin_widgets_frontend_styles_' . $this->id_base,
1304
+ $this->frontend_styles,
1305
+ $instance,
1306
+ $this
1307
+ );
1308
+
1309
+ foreach ( $f_styles as $f_style ) {
1310
+ if ( ! wp_style_is( $f_style[0] ) ) {
1311
+ wp_enqueue_style(
1312
+ $f_style[0],
1313
+ isset( $f_style[1] ) ? $f_style[1] : false,
1314
+ isset( $f_style[2] ) ? $f_style[2] : array(),
1315
+ !empty( $f_style[3] ) ? $f_style[3] : SOW_BUNDLE_VERSION,
1316
+ isset( $f_style[4] ) ? $f_style[4] : "all"
1317
+ );
1318
+ }
1319
+ }
1320
+ }
1321
+
1322
+ /**
1323
+ * Can be overridden by child widgets to enqueue scripts and styles for the frontend, but child widgets should
1324
+ * rather register scripts and styles using register_frontend_scripts() and register_frontend_styles(). This function
1325
+ * will then ensure that the scripts are not enqueued more than once.
1326
+ */
1327
+ function enqueue_frontend_scripts( $instance ) {
1328
+ $this->enqueue_registered_scripts( $instance );
1329
+ $this->enqueue_registered_styles( $instance );
1330
+
1331
+ // Give plugins a chance to enqueue additional frontend scripts
1332
+ do_action('siteorigin_widgets_enqueue_frontend_scripts_' . $this->id_base, $instance, $this);
1333
+ }
1334
+
1335
+ /**
1336
+ * Can be overwritten by child widgets to enqueue admin scripts and styles if necessary.
1337
+ */
1338
+ function enqueue_admin_scripts(){ }
1339
+
1340
+ /**
1341
+ * Check if we're currently in a preview
1342
+ *
1343
+ * @param array $instance
1344
+ *
1345
+ * @return bool
1346
+ */
1347
+ function is_preview( $instance = array() ) {
1348
+ // Check if the instance is a preview
1349
+ if( !empty( $instance[ 'is_preview' ] ) ) return true;
1350
+
1351
+ // Check if the general request is a preview
1352
+ $is_preview =
1353
+ is_preview() || // Is this a standard preview
1354
+ $this->is_customize_preview() || // Is this a customizer preview
1355
+ $this->is_block_editor_page() || // Is this a block editor page
1356
+ !empty( $_GET['siteorigin_panels_live_editor'] ) || // Is this a Page Builder live editor request
1357
+ ( !empty( $_REQUEST['action'] ) && $_REQUEST['action'] == 'so_panels_builder_content' ) || // Is this a Page Builder content ajax request
1358
+ ! empty( $GLOBALS[ 'SITEORIGIN_PANELS_PREVIEW_RENDER' ] ); // Is this a Page Builder preview render.
1359
+
1360
+ return apply_filters( 'siteorigin_widgets_is_preview', $is_preview, $this );
1361
+ }
1362
+
1363
+ /**
1364
+ * Whether or not so show the 'Preview' button
1365
+ *
1366
+ * @return bool
1367
+ */
1368
+ function show_preview_button(){
1369
+ $show_preview = ! empty( $this->widget_options['has_preview'] ) && ! $this->is_customize_preview();
1370
+ $show_preview = apply_filters( 'siteorigin_widgets_form_show_preview_button', $show_preview, $this );
1371
+ return $show_preview;
1372
+ }
1373
+
1374
+ /**
1375
+ * Get the global settings from the options table.
1376
+ *
1377
+ * @return mixed
1378
+ */
1379
+ function get_global_settings( ){
1380
+ $values = get_option( 'so_widget_settings[' . $this->widget_class . ']', array() );
1381
+
1382
+ // Add in the defaults
1383
+ if( $this->has_form( 'settings' ) ) {
1384
+ $values = $this->add_defaults( $this->get_settings_form(), $values );
1385
+ }
1386
+
1387
+ return $values;
1388
+ }
1389
+
1390
+ /**
1391
+ * Save the global settings. Handles validation too.
1392
+ *
1393
+ * @param array $values The new values
1394
+ * @return array The sanitized values.
1395
+ */
1396
+ function save_global_settings( $values ){
1397
+ $current = $this->get_global_settings();
1398
+
1399
+ $values = $this->update( $values, $current, 'settings' );
1400
+
1401
+ unset( $values['_sow_form_id'] );
1402
+ update_option( 'so_widget_settings[' . $this->widget_class . ']', $values );
1403
+
1404
+ return $values;
1405
+ }
1406
+ }
compat/beaver-builder/beaver-builder.php CHANGED
@@ -1,98 +1,98 @@
1
- <?php
2
-
3
- class SiteOrigin_Widgets_Bundle_Beaver_Builder {
4
-
5
- /**
6
- * Get the singleton instance
7
- *
8
- * @return SiteOrigin_Widgets_Bundle_Beaver_Builder
9
- */
10
- public static function single() {
11
- static $single;
12
- return empty( $single ) ? $single = new self() : $single;
13
- }
14
-
15
- function __construct() {
16
- add_action('wp', array( $this, 'init' ), 9 );
17
- }
18
-
19
- function init() {
20
- if ( ! FLBuilderModel::is_builder_active() ) {
21
- return;
22
- }
23
-
24
- add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_active_widgets_scripts' ) );
25
- add_action( 'wp_print_footer_scripts', array( $this, 'print_footer_templates' ) );
26
-
27
- // Don't want to show the form preview button when using Beaver Builder
28
- add_filter( 'siteorigin_widgets_form_show_preview_button', '__return_false' );
29
- }
30
-
31
- function enqueue_active_widgets_scripts() {
32
- global $wp_widget_factory;
33
-
34
- // Beaver Builder does it's editing in the front end so enqueue required form scripts for active widgets.
35
- $so_widgets_bundle = SiteOrigin_Widgets_Bundle::single();
36
- $so_widgets_bundle->enqueue_registered_widgets_scripts( false, true );
37
-
38
- $any_widgets_active = false;
39
- foreach ( $wp_widget_factory->widgets as $class => $widget_obj ) {
40
- if ( ! empty( $widget_obj ) && is_object( $widget_obj ) && is_subclass_of( $widget_obj, 'SiteOrigin_Widget' ) ) {
41
- $any_widgets_active = true;
42
- break;
43
- }
44
- }
45
-
46
- // No widgets active. :/ Let's get outta here.
47
- if ( ! $any_widgets_active ) {
48
- return;
49
- }
50
-
51
- if ( ! wp_script_is( 'wp-color-picker' ) ) {
52
- // wp-color-picker hasn't been registered because we're in the front end, so enqueue with full args.
53
- wp_enqueue_script( 'iris', '/wp-admin/js/iris.min.js', array(
54
- 'jquery-ui-draggable',
55
- 'jquery-ui-slider',
56
- 'jquery-touch-punch'
57
- ), '1.0.7', 1 );
58
-
59
- wp_enqueue_script( 'wp-color-picker', '/wp-admin/js/color-picker' . SOW_BUNDLE_JS_SUFFIX . '.js', array( 'iris' ), false, 1 );
60
-
61
- wp_enqueue_style( 'wp-color-picker' );
62
-
63
- // Localization args for when wp-color-picker script hasn't been registered.
64
- wp_localize_script( 'wp-color-picker', 'wpColorPickerL10n', array(
65
- 'clear' => __( 'Clear', 'so-widgets-bundle' ),
66
- 'defaultString' => __( 'Default', 'so-widgets-bundle' ),
67
- 'pick' => __( 'Select Color', 'so-widgets-bundle' ),
68
- 'current' => __( 'Current Color', 'so-widgets-bundle' ),
69
- ) );
70
- }
71
-
72
- wp_enqueue_style( 'sowb-styles-for-beaver', plugin_dir_url( __FILE__ ) . 'styles.css' );
73
-
74
- $deps = ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ? array( 'jquery', 'fl-builder' ) : array( 'fl-builder-min' );
75
- wp_enqueue_script(
76
- 'sowb-js-for-beaver',
77
- plugin_dir_url( __FILE__ ) . 'sowb-beaver-builder' . SOW_BUNDLE_JS_SUFFIX . '.js',
78
- $deps
79
- );
80
-
81
- wp_enqueue_style( 'siteorigin-widget-admin', plugin_dir_url(SOW_BUNDLE_BASE_FILE).'base/css/admin.css', array( 'media-views' ), SOW_BUNDLE_VERSION );
82
-
83
- }
84
-
85
- function print_footer_templates() {
86
- global $wp_widget_factory;
87
-
88
- // Beaver Builder does it's editing in the front end so print required footer templates for active widgets.
89
- foreach ( $wp_widget_factory->widgets as $class => $widget_obj ) {
90
- if ( ! empty( $widget_obj ) && is_object( $widget_obj ) && is_subclass_of( $widget_obj, 'SiteOrigin_Widget' ) ) {
91
- $widget_obj->footer_admin_templates();
92
- }
93
- }
94
- }
95
-
96
- }
97
-
98
- SiteOrigin_Widgets_Bundle_Beaver_Builder::single();
1
+ <?php
2
+
3
+ class SiteOrigin_Widgets_Bundle_Beaver_Builder {
4
+
5
+ /**
6
+ * Get the singleton instance
7
+ *
8
+ * @return SiteOrigin_Widgets_Bundle_Beaver_Builder
9
+ */
10
+ public static function single() {
11
+ static $single;
12
+ return empty( $single ) ? $single = new self() : $single;
13
+ }
14
+
15
+ function __construct() {
16
+ add_action('wp', array( $this, 'init' ), 9 );
17
+ }
18
+
19
+ function init() {
20
+ if ( ! FLBuilderModel::is_builder_active() ) {
21
+ return;
22
+ }
23
+
24
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_active_widgets_scripts' ) );
25
+ add_action( 'wp_print_footer_scripts', array( $this, 'print_footer_templates' ) );
26
+
27
+ // Don't want to show the form preview button when using Beaver Builder
28
+ add_filter( 'siteorigin_widgets_form_show_preview_button', '__return_false' );
29
+ }
30
+
31
+ function enqueue_active_widgets_scripts() {
32
+ global $wp_widget_factory;
33
+
34
+ // Beaver Builder does it's editing in the front end so enqueue required form scripts for active widgets.
35
+ $so_widgets_bundle = SiteOrigin_Widgets_Bundle::single();
36
+ $so_widgets_bundle->enqueue_registered_widgets_scripts( false, true );
37
+
38
+ $any_widgets_active = false;
39
+ foreach ( $wp_widget_factory->widgets as $class => $widget_obj ) {
40
+ if ( ! empty( $widget_obj ) && is_object( $widget_obj ) && is_subclass_of( $widget_obj, 'SiteOrigin_Widget' ) ) {
41
+ $any_widgets_active = true;
42
+ break;
43
+ }
44
+ }
45
+
46
+ // No widgets active. :/ Let's get outta here.
47
+ if ( ! $any_widgets_active ) {
48
+ return;
49
+ }
50
+
51
+ if ( ! wp_script_is( 'wp-color-picker' ) ) {
52
+ // wp-color-picker hasn't been registered because we're in the front end, so enqueue with full args.
53
+ wp_enqueue_script( 'iris', '/wp-admin/js/iris.min.js', array(
54
+ 'jquery-ui-draggable',
55
+ 'jquery-ui-slider',
56
+ 'jquery-touch-punch'
57
+ ), '1.0.7', 1 );
58
+
59
+ wp_enqueue_script( 'wp-color-picker', '/wp-admin/js/color-picker' . SOW_BUNDLE_JS_SUFFIX . '.js', array( 'iris' ), false, 1 );
60
+
61
+ wp_enqueue_style( 'wp-color-picker' );
62
+
63
+ // Localization args for when wp-color-picker script hasn't been registered.
64
+ wp_localize_script( 'wp-color-picker', 'wpColorPickerL10n', array(
65
+ 'clear' => __( 'Clear', 'so-widgets-bundle' ),
66
+ 'defaultString' => __( 'Default', 'so-widgets-bundle' ),
67
+ 'pick' => __( 'Select Color', 'so-widgets-bundle' ),
68
+ 'current' => __( 'Current Color', 'so-widgets-bundle' ),
69
+ ) );
70
+ }
71
+
72
+ wp_enqueue_style( 'sowb-styles-for-beaver', plugin_dir_url( __FILE__ ) . 'styles.css' );
73
+
74
+ $deps = ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ? array( 'jquery', 'fl-builder' ) : array( 'fl-builder-min' );
75
+ wp_enqueue_script(
76
+ 'sowb-js-for-beaver',
77
+ plugin_dir_url( __FILE__ ) . 'sowb-beaver-builder' . SOW_BUNDLE_JS_SUFFIX . '.js',
78
+ $deps
79
+ );
80
+
81
+ wp_enqueue_style( 'siteorigin-widget-admin', plugin_dir_url(SOW_BUNDLE_BASE_FILE).'base/css/admin.css', array( 'media-views' ), SOW_BUNDLE_VERSION );
82
+
83
+ }
84
+
85
+ function print_footer_templates() {
86
+ global $wp_widget_factory;
87
+
88
+ // Beaver Builder does it's editing in the front end so print required footer templates for active widgets.
89
+ foreach ( $wp_widget_factory->widgets as $class => $widget_obj ) {
90
+ if ( ! empty( $widget_obj ) && is_object( $widget_obj ) && is_subclass_of( $widget_obj, 'SiteOrigin_Widget' ) ) {
91
+ $widget_obj->footer_admin_templates();
92
+ }
93
+ }
94
+ }
95
+
96
+ }
97
+
98
+ SiteOrigin_Widgets_Bundle_Beaver_Builder::single();
compat/beaver-builder/sowb-beaver-builder.js CHANGED
@@ -1,142 +1,142 @@
1
- /* globals jQuery, FLBuilder, sowb, sowbForms */
2
-
3
- var sowb = window.sowb || {};
4
-
5
- ( function($){
6
- if( typeof FLBuilder !== 'undefined') {
7
- // If you're going to override jQuery's `ready` function, at least make sure it still works. :/
8
- sowb.orig_FLBuilder_initJQueryReadyFix = FLBuilder._initJQueryReadyFix;
9
- FLBuilder._initJQueryReadyFix = function() {
10
- return;
11
- };
12
-
13
- sowb.orig_FLBuilder_getSettings = FLBuilder._getSettings;
14
-
15
- /**
16
- * Replace Beaver Builder's form data collection function with our modified version.
17
- */
18
- FLBuilder._getSettings = function(form) {
19
- FLBuilder._updateEditorFields();
20
-
21
- var data = form.serializeArray(),
22
- i = 0,
23
- k = 0,
24
- value = '',
25
- name = '',
26
- key = '',
27
- keys = [],
28
- matches = [],
29
- settings = {};
30
-
31
- // Loop through the form data.
32
- for ( i = 0; i < data.length; i++ ) {
33
-
34
- value = data[ i ].value.replace( /\r/gm, '' ).replace( /&#39;/g, "'" );
35
-
36
- // Don't save text editor textareas.
37
- if ( data[ i ].name.indexOf( 'flrich' ) > -1 ) {
38
- continue;
39
- }
40
- // Support foo[]... setting keys.
41
- else if ( data[ i ].name.indexOf( '[' ) > -1 ) {
42
-
43
- name = data[ i ].name.replace( /\[(.*)\]/, '' );
44
- key = data[ i ].name.replace( name, '' );
45
- keys = [];
46
- matches = key.match( /\[[^\]]*\]/g );
47
-
48
- // Remove [] from the keys.
49
- for ( k = 0; k < matches.length; k++ ) {
50
-
51
- if ( '[]' === matches[ k ] ) {
52
- continue;
53
- }
54
-
55
- keys.push( matches[ k ].replace( /[\[\]]/g, '' ) );
56
- }
57
-
58
-
59
- var f = function(object, val, head, tail) {
60
- if( tail.length === 0) {
61
- object[ head ] = val;
62
- } else {
63
- if( 'undefined' === typeof object [ head ] ) {
64
- object [ head ] = {};
65
- }
66
- f(object[ head ], val, tail.shift(), tail);
67
- }
68
- };
69
-
70
- if(keys.length > 0) {
71
-
72
- var keysCopy = keys.slice();
73
- if ( 'undefined' === typeof settings[ name ] ) {
74
- settings[ name ] = {};
75
- }
76
- f(settings[ name ], value, keysCopy.shift(), keysCopy);
77
- } else {
78
-
79
- if ( 'undefined' === typeof settings[ name ] ) {
80
- settings[ name ] = [];
81
- }
82
-
83
- settings[ name ].push( value );
84
- }
85
- }
86
- // Standard name/value pair.
87
- else {
88
- settings[ data[ i ].name ] = value;
89
- }
90
- }
91
-
92
- // Update auto suggest values.
93
- for ( key in settings ) {
94
-
95
- if ( 'undefined' !== typeof settings[ 'as_values_' + key ] ) {
96
-
97
- settings[ key ] = $.grep(
98
- settings[ 'as_values_' + key ].split( ',' ),
99
- function( n ) {
100
- return n !== '';
101
- }
102
- ).join( ',' );
103
-
104
- try {
105
- delete settings[ 'as_values_' + key ];
106
- }
107
- catch( e ) {}
108
- }
109
- }
110
-
111
- // In the case of multi-select or checkboxes we need to put the blank setting back in.
112
- $.each( form.find( '[name]' ), function( key, input ) {
113
- var name = $( input ).attr( 'name' ).replace( /\[(.*)\]/, '' );
114
- if ( ! ( name in settings ) ) {
115
- settings[ name ] = '';
116
- }
117
- });
118
-
119
- if ( typeof FLBuilder._getOriginalSettings === 'function' ) {
120
- // Merge in the original settings in case legacy fields haven't rendered yet.
121
- settings = $.extend( {}, FLBuilder._getOriginalSettings( form ), settings );
122
- }
123
-
124
- var widgetForm = form.find( '.siteorigin-widget-form' );
125
- if ( widgetForm.length ) {
126
- var widgetSettingKey = 'widget-' + sowbForms.getWidgetIdBase( widgetForm );
127
- settings[ widgetSettingKey ] = sowbForms.getWidgetFormValues( widgetForm );
128
- }
129
- // Return the settings.
130
- return settings;
131
- }
132
- }
133
-
134
- // To ensure necessary scripts are executed again when settings are changed
135
- $( document ).on( 'fl-builder.preview-rendered fl-builder.layout-rendered', '.fl-builder-content', function() {
136
- // Trigger Widgets Bundle widgets to setup
137
- $( sowb ).trigger( 'setup_widgets', { preview: true } );
138
- } );
139
-
140
- })(jQuery);
141
-
142
- window.sowb = sowb;
1
+ /* globals jQuery, FLBuilder, sowb, sowbForms */
2
+
3
+ var sowb = window.sowb || {};
4
+
5
+ ( function($){
6
+ if( typeof FLBuilder !== 'undefined') {
7
+ // If you're going to override jQuery's `ready` function, at least make sure it still works. :/
8
+ sowb.orig_FLBuilder_initJQueryReadyFix = FLBuilder._initJQueryReadyFix;
9
+ FLBuilder._initJQueryReadyFix = function() {
10
+ return;
11
+ };
12
+
13
+ sowb.orig_FLBuilder_getSettings = FLBuilder._getSettings;
14
+
15
+ /**
16
+ * Replace Beaver Builder's form data collection function with our modified version.
17
+ */
18
+ FLBuilder._getSettings = function(form) {
19
+ FLBuilder._updateEditorFields();
20
+
21
+ var data = form.serializeArray(),
22
+ i = 0,
23
+ k = 0,
24
+ value = '',
25
+ name = '',
26
+ key = '',
27
+ keys = [],
28
+ matches = [],
29
+ settings = {};
30
+
31
+ // Loop through the form data.
32
+ for ( i = 0; i < data.length; i++ ) {
33
+
34
+ value = data[ i ].value.replace( /\r/gm, '' ).replace( /&#39;/g, "'" );
35
+
36
+ // Don't save text editor textareas.
37
+ if ( data[ i ].name.indexOf( 'flrich' ) > -1 ) {
38
+ continue;
39
+ }
40
+ // Support foo[]... setting keys.
41
+ else if ( data[ i ].name.indexOf( '[' ) > -1 ) {
42
+
43
+ name = data[ i ].name.replace( /\[(.*)\]/, '' );
44
+ key = data[ i ].name.replace( name, '' );
45
+ keys = [];
46
+ matches = key.match( /\[[^\]]*\]/g );
47
+
48
+ // Remove [] from the keys.
49
+ for ( k = 0; k < matches.length; k++ ) {
50
+
51
+ if ( '[]' === matches[ k ] ) {
52
+ continue;
53
+ }
54
+
55
+ keys.push( matches[ k ].replace( /[\[\]]/g, '' ) );
56
+ }
57
+
58
+
59
+ var f = function(object, val, head, tail) {
60
+ if( tail.length === 0) {
61
+ object[ head ] = val;
62
+ } else {
63
+ if( 'undefined' === typeof object [ head ] ) {
64
+ object [ head ] = {};
65
+ }
66
+ f(object[ head ], val, tail.shift(), tail);
67
+ }
68
+ };
69
+
70
+ if(keys.length > 0) {
71
+
72
+ var keysCopy = keys.slice();
73
+ if ( 'undefined' === typeof settings[ name ] ) {
74
+ settings[ name ] = {};
75
+ }
76
+ f(settings[ name ], value, keysCopy.shift(), keysCopy);
77
+ } else {
78
+
79
+ if ( 'undefined' === typeof settings[ name ] ) {
80
+ settings[ name ] = [];
81
+ }
82
+
83
+ settings[ name ].push( value );
84
+ }
85
+ }
86
+ // Standard name/value pair.
87
+ else {
88
+ settings[ data[ i ].name ] = value;
89
+ }
90
+ }
91
+
92
+ // Update auto suggest values.
93
+ for ( key in settings ) {
94
+
95
+ if ( 'undefined' !== typeof settings[ 'as_values_' + key ] ) {
96
+
97
+ settings[ key ] = $.grep(
98
+ settings[ 'as_values_' + key ].split( ',' ),
99
+ function( n ) {
100
+ return n !== '';
101
+ }
102
+ ).join( ',' );
103
+
104
+ try {
105
+ delete settings[ 'as_values_' + key ];
106
+ }
107
+ catch( e ) {}
108
+ }
109
+ }
110
+
111
+ // In the case of multi-select or checkboxes we need to put the blank setting back in.
112
+ $.each( form.find( '[name]' ), function( key, input ) {
113
+ var name = $( input ).attr( 'name' ).replace( /\[(.*)\]/, '' );
114
+ if ( ! ( name in settings ) ) {
115
+ settings[ name ] = '';
116
+ }
117
+ });
118
+
119
+ if ( typeof FLBuilder._getOriginalSettings === 'function' ) {
120
+ // Merge in the original settings in case legacy fields haven't rendered yet.
121
+ settings = $.extend( {}, FLBuilder._getOriginalSettings( form ), settings );
122
+ }
123
+
124
+ var widgetForm = form.find( '.siteorigin-widget-form' );
125
+ if ( widgetForm.length ) {
126
+ var widgetSettingKey = 'widget-' + sowbForms.getWidgetIdBase( widgetForm );
127
+ settings[ widgetSettingKey ] = sowbForms.getWidgetFormValues( widgetForm );
128
+ }
129
+ // Return the settings.
130
+ return settings;
131
+ }
132
+ }
133
+
134
+ // To ensure necessary scripts are executed again when settings are changed
135
+ $( document ).on( 'fl-builder.preview-rendered fl-builder.layout-rendered', '.fl-builder-content', function() {
136
+ // Trigger Widgets Bundle widgets to setup
137
+ $( sowb ).trigger( 'setup_widgets', { preview: true } );
138
+ } );
139
+
140
+ })(jQuery);
141
+
142
+ window.sowb = sowb;
compat/block-editor/widget-block.js CHANGED
@@ -1,299 +1,303 @@
1
- ( function ( editor, blocks, i18n, element, components, compose ) {
2
-
3
- var el = element.createElement;
4
- var registerBlockType = blocks.registerBlockType;
5
- var BlockControls = editor.BlockControls;
6
- var SelectControl = components.SelectControl;
7
- var withState = compose.withState;
8
- var Toolbar = components.Toolbar;
9
- var IconButton = components.IconButton;
10
- var Placeholder = components.Placeholder;
11
- var Spinner = components.Spinner;
12
- var __ = i18n.__;
13
-
14
- registerBlockType( 'sowb/widget-block', {
15
- title: __( 'SiteOrigin Widget', 'so-widgets-bundle' ),
16
-
17
- description: __( 'Select a SiteOrigin widget from the dropdown.', 'so-widgets-bundle' ),
18
-
19
- icon: function() {
20
- return el(
21
- 'span',
22
- {
23
- className: 'widget-icon so-widget-icon so-block-editor-icon'
24
- }
25
- )
26
- },
27
-
28
- category: 'widgets',
29
-
30
- keywords: [sowbBlockEditorAdmin.widgets.reduce( function ( keywords, widgetObj ) {
31
- if ( keywords.length > 0 ) {
32
- keywords += ',';
33
- }
34
- return keywords + widgetObj.name;
35
- }, '' )],
36
-
37
- supports: {
38
- html: false,
39
- },
40
-
41
- attributes: {
42
- widgetClass: {
43
- type: 'string',
44
- },
45
- widgetData: {
46
- type: 'object',
47
- }
48
- },
49
-
50
- edit: withState( {
51
- editing: false,
52
- formInitialized: false,
53
- previewInitialized: false,
54
- widgetFormHtml: '',
55
- widgetSettingsChanged: false,
56
- widgetPreviewHtml: '',
57
- } )( function ( props ) {
58
-
59
- function onWidgetClassChange( newWidgetClass ) {
60
- if ( newWidgetClass !== '' ) {
61
- if ( props.widgetSettingsChanged && ! confirm( sowbBlockEditorAdmin.confirmChangeWidget ) ) {
62
- return false;
63
- }
64
- props.setAttributes( { widgetClass: newWidgetClass, widgetData: null } );
65
- props.setState( {
66
- editing: true,
67
- widgetFormHtml: null,
68
- formInitialized: false,
69
- widgetSettingsChanged: false,
70
- widgetPreviewHtml: null,
71
- previewInitialized: false
72
- } );
73
- }
74
- }
75
-
76
- function switchToEditing() {
77
- props.setState( { editing: true, formInitialized: false } );
78
- }
79
-
80
- function switchToPreview() {
81
- props.setState( { editing: false, previewInitialized: false } );
82
- }
83
-
84
- function setupWidgetForm( formContainer ) {
85
- var $mainForm = $( formContainer ).find( '.siteorigin-widget-form-main' );
86
- if ( $mainForm.length > 0 && ! props.formInitialized ) {
87
- var $previewContainer = $mainForm.siblings('.siteorigin-widget-preview');
88
- $previewContainer.find( '> a' ).on( 'click', function ( event ) {
89
- event.stopImmediatePropagation();
90
- switchToPreview();
91
- } );
92
- $mainForm.data( 'backupDisabled', true );
93
- $mainForm.sowSetupForm();
94
- if ( ! props.attributes.widgetData ) {
95
- props.setAttributes( { widgetData: sowbForms.getWidgetFormValues( $mainForm ) } );
96
- }
97
- $mainForm.on( 'change', function () {
98
- props.setAttributes( { widgetData: sowbForms.getWidgetFormValues( $mainForm ) } );
99
- props.setState( {
100
- widgetSettingsChanged: true,
101
- widgetPreviewHtml: null,
102
- previewInitialized: false
103
- } );
104
- } );
105
- props.setState( { formInitialized: true } );
106
- }
107
- }
108
-
109
- function setupWidgetPreview() {
110
- if ( ! props.previewInitialized ) {
111
- $( window.sowb ).trigger( 'setup_widgets', { preview: true } );
112
- props.setState( { previewInitialized: true } );
113
- }
114
- }
115
-
116
- if ( props.editing || ! props.attributes.widgetClass || ! props.attributes.widgetData ) {
117
- var widgetsOptions = [];
118
- if ( sowbBlockEditorAdmin.widgets ) {
119
- sowbBlockEditorAdmin.widgets.sort( function ( a, b ) {
120
- if ( a.name < b.name ) {
121
- return -1;
122
- } else if ( a.name > b.name ) {
123
- return 1;
124
- }
125
- return 0;
126
- } );
127
- widgetsOptions = sowbBlockEditorAdmin.widgets.map( function ( widget ) {
128
- return { value: widget.class, label: widget.name };
129
- } );
130
- widgetsOptions.unshift( { value: '', label: __( 'Select widget type', 'so-widgets-bundle' ) } );
131
- }
132
-
133
- var loadWidgetForm = props.attributes.widgetClass && ! props.widgetFormHtml;
134
- if ( loadWidgetForm ) {
135
- $.post( {
136
- url: sowbBlockEditorAdmin.restUrl + 'sowb/v1/widgets/forms',
137
- beforeSend: function ( xhr ) {
138
- xhr.setRequestHeader( 'X-WP-Nonce', sowbBlockEditorAdmin.nonce );
139
- },
140
- data: {
141
- widgetClass: props.attributes.widgetClass,
142
- widgetData: props.attributes.widgetData,
143
- }
144
- } )
145
- .done( function( widgetForm ) {
146
- props.setState( { widgetFormHtml: widgetForm } );
147
- } )
148
- .fail( function ( response ) {
149
-
150
- var errorMessage = '';
151
- if ( response.hasOwnProperty( 'responseJSON' ) ) {
152
- errorMessage = response.responseJSON.message;
153
- } else if ( response.hasOwnProperty( 'responseText' ) ) {
154
- errorMessage = response.responseText;
155
- }
156
-
157
- props.setState( { widgetFormHtml: '<div>' + errorMessage + '</div>', } );
158
- });
159
- }
160
-
161
- var widgetForm = props.widgetFormHtml ? props.widgetFormHtml : '';
162
-
163
- return [
164
- !! widgetForm && el(
165
- BlockControls,
166
- { key: 'controls' },
167
- el(
168
- Toolbar,
169
- null,
170
- el(
171
- IconButton,
172
- {
173
- className: 'components-icon-button components-toolbar__control',
174
- label: __( 'Preview widget.', 'so-widgets-bundle' ),
175
- onClick: switchToPreview,
176
- icon: 'visibility'
177
- }
178
- )
179
- )
180
- ),
181
- el(
182
- Placeholder,
183
- {
184
- key: 'placeholder',
185
- className: 'so-widget-placeholder',
186
- label: __( 'SiteOrigin Widget', 'so-widgets-bundle' ),
187
- instructions: __( 'Select the type of widget you want to use:', 'so-widgets-bundle' )
188
- },
189
- ( props.loadingWidgets || loadWidgetForm ?
190
- el( Spinner ) :
191
- el(
192
- 'div',
193
- { className: 'so-widget-block-container' },
194
- el(
195
- SelectControl,
196
- {
197
- options: widgetsOptions,
198
- value: props.attributes.widgetClass,
199
- onChange: onWidgetClassChange,
200
- }
201
- ),
202
- el( 'div', {
203
- className: 'so-widget-block-form-container',
204
- dangerouslySetInnerHTML: { __html: widgetForm },
205
- ref: setupWidgetForm,
206
- } )
207
- )
208
- )
209
- )
210
- ];
211
- } else {
212
-
213
- var loadWidgetPreview = ! props.loadingWidgets &&
214
- ! props.editing &&
215
- ! props.widgetPreviewHtml &&
216
- props.attributes.widgetClass &&
217
- props.attributes.widgetData;
218
- if ( loadWidgetPreview ) {
219
- $.post( {
220
- url: sowbBlockEditorAdmin.restUrl + 'sowb/v1/widgets/previews',
221
- beforeSend: function ( xhr ) {
222
- xhr.setRequestHeader( 'X-WP-Nonce', sowbBlockEditorAdmin.nonce );
223
- },
224
- data: {
225
- widgetClass: props.attributes.widgetClass,
226
- widgetData: props.attributes.widgetData || {}
227
- }
228
- } )
229
- .done( function( widgetPreview ) {
230
- props.setState( {
231
- widgetPreviewHtml: widgetPreview,
232
- previewInitialized: false,
233
- } );
234
- } )
235
- .fail( function ( response ) {
236
-
237
- var errorMessage = '';
238
- if ( response.hasOwnProperty( 'responseJSON' ) ) {
239
- errorMessage = response.responseJSON.message;
240
- } else if ( response.hasOwnProperty( 'responseText' ) ) {
241
- errorMessage = response.responseText;
242
- }
243
-
244
- props.setState( {
245
- widgetPreviewHtml: '<div>' + errorMessage + '</div>',
246
- } );
247
- });
248
- }
249
- var widgetPreview = props.widgetPreviewHtml ? props.widgetPreviewHtml : '';
250
- return [
251
- el(
252
- BlockControls,
253
- { key: 'controls' },
254
- el(
255
- Toolbar,
256
- null,
257
- el(
258
- IconButton,
259
- {
260
- className: 'components-icon-button components-toolbar__control',
261
- label: __( 'Edit widget.', 'so-widgets-bundle' ),
262
- onClick: switchToEditing,
263
- icon: 'edit'
264
- }
265
- )
266
- )
267
- ),
268
- el(
269
- 'div',
270
- {
271
- key: 'preview',
272
- className: 'so-widget-preview-container'
273
- },
274
- ( loadWidgetPreview ?
275
- el( 'div', {
276
- className: 'so-widgets-spinner-container'
277
- },
278
- el(
279
- 'span',
280
- null,
281
- el( Spinner )
282
- )
283
- ) :
284
- el( 'div', {
285
- dangerouslySetInnerHTML: { __html: widgetPreview },
286
- ref: setupWidgetPreview,
287
- } )
288
- )
289
- )
290
- ];
291
- }
292
- } ),
293
-
294
- save: function () {
295
- // Render in PHP
296
- return null;
297
- }
298
- } );
299
- } )( window.wp.editor, window.wp.blocks, window.wp.i18n, window.wp.element, window.wp.components, window.wp.compose );
 
 
 
 
1
+ ( function ( editor, blocks, i18n, element, components, compose ) {
2
+
3
+ var el = element.createElement;
4
+ var registerBlockType = blocks.registerBlockType;
5
+ var BlockControls = editor.BlockControls;
6
+ var SelectControl = components.SelectControl;
7
+ var withState = compose.withState;
8
+ var Toolbar = components.Toolbar;
9
+ var IconButton = components.IconButton;
10
+ var Placeholder = components.Placeholder;
11
+ var Spinner = components.Spinner;
12
+ var __ = i18n.__;
13
+
14
+ registerBlockType( 'sowb/widget-block', {
15
+ title: __( 'SiteOrigin Widget', 'so-widgets-bundle' ),
16
+
17
+ description: __( 'Select a SiteOrigin widget from the dropdown.', 'so-widgets-bundle' ),
18
+
19
+ icon: function() {
20
+ return el(
21
+ 'span',
22
+ {
23
+ className: 'widget-icon so-widget-icon so-block-editor-icon'
24
+ }
25
+ )
26
+ },
27
+
28
+ category: 'widgets',
29
+
30
+ keywords: [sowbBlockEditorAdmin.widgets.reduce( function ( keywords, widgetObj ) {
31
+ if ( keywords.length > 0 ) {
32
+ keywords += ',';
33
+ }
34
+ return keywords + widgetObj.name;
35
+ }, '' )],
36
+
37
+ supports: {
38
+ html: false,
39
+ },
40
+
41
+ attributes: {
42
+ widgetClass: {
43
+ type: 'string',
44
+ },
45
+ widgetData: {
46
+ type: 'object',
47
+ }
48
+ },
49
+
50
+ edit: withState( {
51
+ editing: false,
52
+ formInitialized: false,
53
+ previewInitialized: false,
54
+ widgetFormHtml: '',
55
+ widgetSettingsChanged: false,
56
+ widgetPreviewHtml: '',
57
+ } )( function ( props ) {
58
+
59
+ function onWidgetClassChange( newWidgetClass ) {
60
+ if ( newWidgetClass !== '' ) {
61
+ if ( props.widgetSettingsChanged && ! confirm( sowbBlockEditorAdmin.confirmChangeWidget ) ) {
62
+ return false;
63
+ }
64
+ props.setAttributes( { widgetClass: newWidgetClass, widgetData: null } );
65
+ props.setState( {
66
+ editing: true,
67
+ widgetFormHtml: null,
68
+ formInitialized: false,
69
+ widgetSettingsChanged: false,
70
+ widgetPreviewHtml: null,
71
+ previewInitialized: false
72
+ } );
73
+ }
74
+ }
75
+
76
+ function switchToEditing() {
77
+ props.setState( { editing: true, formInitialized: false } );
78
+ }
79
+
80
+ function switchToPreview() {
81
+ props.setState( { editing: false, previewInitialized: false } );
82
+ }
83
+
84
+ function setupWidgetForm( formContainer ) {
85
+ var $mainForm = $( formContainer ).find( '.siteorigin-widget-form-main' );
86
+ if ( $mainForm.length > 0 && ! props.formInitialized ) {
87
+ var $previewContainer = $mainForm.siblings('.siteorigin-widget-preview');
88
+ $previewContainer.find( '> a' ).on( 'click', function ( event ) {
89
+ event.stopImmediatePropagation();
90
+ switchToPreview();
91
+ } );
92
+ $mainForm.data( 'backupDisabled', true );
93
+ $mainForm.sowSetupForm();
94
+ if ( props.attributes.widgetData ) {
95
+ // If we call `setWidgetFormValues` with the last parameter ( `triggerChange` ) set to false,
96
+ // it won't show the correct values for some fields e.g. color and media fields.
97
+ sowbForms.setWidgetFormValues( $mainForm, props.attributes.widgetData );
98
+ } else {
99
+ props.setAttributes( { widgetData: sowbForms.getWidgetFormValues( $mainForm ) } );
100
+ }
101
+ $mainForm.on( 'change', function () {
102
+ props.setAttributes( { widgetData: sowbForms.getWidgetFormValues( $mainForm ) } );
103
+ props.setState( {
104
+ widgetSettingsChanged: true,
105
+ widgetPreviewHtml: null,
106
+ previewInitialized: false
107
+ } );
108
+ } );
109
+ props.setState( { formInitialized: true } );
110
+ }
111
+ }
112
+
113
+ function setupWidgetPreview() {
114
+ if ( ! props.previewInitialized ) {
115
+ $( window.sowb ).trigger( 'setup_widgets', { preview: true } );
116
+ props.setState( { previewInitialized: true } );
117
+ }
118
+ }
119
+
120
+ if ( props.editing || ! props.attributes.widgetClass || ! props.attributes.widgetData ) {
121
+ var widgetsOptions = [];
122
+ if ( sowbBlockEditorAdmin.widgets ) {
123
+ sowbBlockEditorAdmin.widgets.sort( function ( a, b ) {
124
+ if ( a.name < b.name ) {
125
+ return -1;
126
+ } else if ( a.name > b.name ) {
127
+ return 1;
128
+ }
129
+ return 0;
130
+ } );
131
+ widgetsOptions = sowbBlockEditorAdmin.widgets.map( function ( widget ) {
132
+ return { value: widget.class, label: widget.name };
133
+ } );
134
+ widgetsOptions.unshift( { value: '', label: __( 'Select widget type', 'so-widgets-bundle' ) } );
135
+ }
136
+
137
+ var loadWidgetForm = props.attributes.widgetClass && ! props.widgetFormHtml;
138
+ if ( loadWidgetForm ) {
139
+ $.post( {
140
+ url: sowbBlockEditorAdmin.restUrl + 'sowb/v1/widgets/forms',
141
+ beforeSend: function ( xhr ) {
142
+ xhr.setRequestHeader( 'X-WP-Nonce', sowbBlockEditorAdmin.nonce );
143
+ },
144
+ data: {
145
+ widgetClass: props.attributes.widgetClass,
146
+ widgetData: props.attributes.widgetData,
147
+ }
148
+ } )
149
+ .done( function( widgetForm ) {
150
+ props.setState( { widgetFormHtml: widgetForm } );
151
+ } )
152
+ .fail( function ( response ) {
153
+
154
+ var errorMessage = '';
155
+ if ( response.hasOwnProperty( 'responseJSON' ) ) {
156
+ errorMessage = response.responseJSON.message;
157
+ } else if ( response.hasOwnProperty( 'responseText' ) ) {
158
+ errorMessage = response.responseText;
159
+ }
160
+
161
+ props.setState( { widgetFormHtml: '<div>' + errorMessage + '</div>', } );
162
+ });
163
+ }
164
+
165
+ var widgetForm = props.widgetFormHtml ? props.widgetFormHtml : '';
166
+
167
+ return [
168
+ !! widgetForm && el(
169
+ BlockControls,
170
+ { key: 'controls' },
171
+ el(
172
+ Toolbar,
173
+ null,
174
+ el(
175
+ IconButton,
176
+ {
177
+ className: 'components-icon-button components-toolbar__control',
178
+ label: __( 'Preview widget.', 'so-widgets-bundle' ),
179
+ onClick: switchToPreview,
180
+ icon: 'visibility'
181
+ }
182
+ )
183
+ )
184
+ ),
185
+ el(
186
+ Placeholder,
187
+ {
188
+ key: 'placeholder',
189
+ className: 'so-widget-placeholder',
190
+ label: __( 'SiteOrigin Widget', 'so-widgets-bundle' ),
191
+ instructions: __( 'Select the type of widget you want to use:', 'so-widgets-bundle' )
192
+ },
193
+ ( props.loadingWidgets || loadWidgetForm ?
194
+ el( Spinner ) :
195
+ el(
196
+ 'div',
197
+ { className: 'so-widget-block-container' },
198
+ el(
199
+ SelectControl,
200
+ {
201
+ options: widgetsOptions,
202
+ value: props.attributes.widgetClass,
203
+ onChange: onWidgetClassChange,
204
+ }
205
+ ),
206
+ el( 'div', {
207
+ className: 'so-widget-block-form-container',
208
+ dangerouslySetInnerHTML: { __html: widgetForm },
209
+ ref: setupWidgetForm,
210
+ } )
211
+ )
212
+ )
213
+ )
214
+ ];
215
+ } else {
216
+
217
+ var loadWidgetPreview = ! props.loadingWidgets &&
218
+ ! props.editing &&
219
+ ! props.widgetPreviewHtml &&
220
+ props.attributes.widgetClass &&
221
+ props.attributes.widgetData;
222
+ if ( loadWidgetPreview ) {
223
+ $.post( {
224
+ url: sowbBlockEditorAdmin.restUrl + 'sowb/v1/widgets/previews',
225
+ beforeSend: function ( xhr ) {
226
+ xhr.setRequestHeader( 'X-WP-Nonce', sowbBlockEditorAdmin.nonce );
227
+ },
228
+ data: {
229
+ widgetClass: props.attributes.widgetClass,
230
+ widgetData: props.attributes.widgetData || {}
231
+ }
232
+ } )
233
+ .done( function( widgetPreview ) {
234
+ props.setState( {
235
+ widgetPreviewHtml: widgetPreview,
236
+ previewInitialized: false,
237
+ } );
238
+ } )
239
+ .fail( function ( response ) {
240
+
241
+ var errorMessage = '';
242
+ if ( response.hasOwnProperty( 'responseJSON' ) ) {
243
+ errorMessage = response.responseJSON.message;
244
+ } else if ( response.hasOwnProperty( 'responseText' ) ) {
245
+ errorMessage = response.responseText;
246
+ }
247
+
248
+ props.setState( {
249
+ widgetPreviewHtml: '<div>' + errorMessage + '</div>',
250
+ } );
251
+ });
252
+ }
253
+ var widgetPreview = props.widgetPreviewHtml ? props.widgetPreviewHtml : '';
254
+ return [
255
+ el(
256
+ BlockControls,
257
+ { key: 'controls' },
258
+ el(
259
+ Toolbar,
260
+ null,
261
+ el(
262
+ IconButton,
263
+ {
264
+ className: 'components-icon-button components-toolbar__control',
265
+ label: __( 'Edit widget.', 'so-widgets-bundle' ),
266
+ onClick: switchToEditing,
267
+ icon: 'edit'
268
+ }
269
+ )
270
+ )
271
+ ),
272
+ el(
273
+ 'div',
274
+ {
275
+ key: 'preview',
276
+ className: 'so-widget-preview-container'
277
+ },
278
+ ( loadWidgetPreview ?
279
+ el( 'div', {
280
+ className: 'so-widgets-spinner-container'
281
+ },
282
+ el(
283
+ 'span',
284
+ null,
285
+ el( Spinner )
286
+ )
287
+ ) :
288
+ el( 'div', {
289
+ dangerouslySetInnerHTML: { __html: widgetPreview },
290
+ ref: setupWidgetPreview,
291
+ } )
292
+ )
293
+ )
294
+ ];
295
+ }
296
+ } ),
297
+
298
+ save: function () {
299
+ // Render in PHP
300
+ return null;
301
+ }
302
+ } );
303
+ } )( window.wp.editor, window.wp.blocks, window.wp.i18n, window.wp.element, window.wp.components, window.wp.compose );
compat/block-editor/widget-block.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,t,i,n,o,s){var r=n.createElement,d=t.registerBlockType,a=e.BlockControls,l=o.SelectControl,w=s.withState,g=o.Toolbar,c=o.IconButton,u=o.Placeholder,m=o.Spinner,p=i.__;d("sowb/widget-block",{title:p("SiteOrigin Widget","so-widgets-bundle"),description:p("Select a SiteOrigin widget from the dropdown.","so-widgets-bundle"),icon:function(){return r("span",{className:"widget-icon so-widget-icon so-block-editor-icon"})},category:"widgets",keywords:[sowbBlockEditorAdmin.widgets.reduce(function(e,t){return 0<e.length&&(e+=","),e+t.name},"")],supports:{html:!1},attributes:{widgetClass:{type:"string"},widgetData:{type:"object"}},edit:w({editing:!1,formInitialized:!1,previewInitialized:!1,widgetFormHtml:"",widgetSettingsChanged:!1,widgetPreviewHtml:""})(function(i){function n(){i.setState({editing:!1,previewInitialized:!1})}if(!i.editing&&i.attributes.widgetClass&&i.attributes.widgetData){var e=!i.loadingWidgets&&!i.editing&&!i.widgetPreviewHtml&&i.attributes.widgetClass&&i.attributes.widgetData;e&&$.post({url:sowbBlockEditorAdmin.restUrl+"sowb/v1/widgets/previews",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",sowbBlockEditorAdmin.nonce)},data:{widgetClass:i.attributes.widgetClass,widgetData:i.attributes.widgetData||{}}}).done(function(e){i.setState({widgetPreviewHtml:e,previewInitialized:!1})}).fail(function(e){var t="";e.hasOwnProperty("responseJSON")?t=e.responseJSON.message:e.hasOwnProperty("responseText")&&(t=e.responseText),i.setState({widgetPreviewHtml:"<div>"+t+"</div>"})});var t=i.widgetPreviewHtml?i.widgetPreviewHtml:"";return[r(a,{key:"controls"},r(g,null,r(c,{className:"components-icon-button components-toolbar__control",label:p("Edit widget.","so-widgets-bundle"),onClick:function(){i.setState({editing:!0,formInitialized:!1})},icon:"edit"}))),r("div",{key:"preview",className:"so-widget-preview-container"},e?r("div",{className:"so-widgets-spinner-container"},r("span",null,r(m))):r("div",{dangerouslySetInnerHTML:{__html:t},ref:function(){i.previewInitialized||($(window.sowb).trigger("setup_widgets",{preview:!0}),i.setState({previewInitialized:!0}))}}))]}var o=[];sowbBlockEditorAdmin.widgets&&(sowbBlockEditorAdmin.widgets.sort(function(e,t){return e.name<t.name?-1:e.name>t.name?1:0}),(o=sowbBlockEditorAdmin.widgets.map(function(e){return{value:e.class,label:e.name}})).unshift({value:"",label:p("Select widget type","so-widgets-bundle")}));var s=i.attributes.widgetClass&&!i.widgetFormHtml;s&&$.post({url:sowbBlockEditorAdmin.restUrl+"sowb/v1/widgets/forms",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",sowbBlockEditorAdmin.nonce)},data:{widgetClass:i.attributes.widgetClass,widgetData:i.attributes.widgetData}}).done(function(e){i.setState({widgetFormHtml:e})}).fail(function(e){var t="";e.hasOwnProperty("responseJSON")?t=e.responseJSON.message:e.hasOwnProperty("responseText")&&(t=e.responseText),i.setState({widgetFormHtml:"<div>"+t+"</div>"})});var d=i.widgetFormHtml?i.widgetFormHtml:"";return[!!d&&r(a,{key:"controls"},r(g,null,r(c,{className:"components-icon-button components-toolbar__control",label:p("Preview widget.","so-widgets-bundle"),onClick:n,icon:"visibility"}))),r(u,{key:"placeholder",className:"so-widget-placeholder",label:p("SiteOrigin Widget","so-widgets-bundle"),instructions:p("Select the type of widget you want to use:","so-widgets-bundle")},i.loadingWidgets||s?r(m):r("div",{className:"so-widget-block-container"},r(l,{options:o,value:i.attributes.widgetClass,onChange:function(e){if(""!==e){if(i.widgetSettingsChanged&&!confirm(sowbBlockEditorAdmin.confirmChangeWidget))return!1;i.setAttributes({widgetClass:e,widgetData:null}),i.setState({editing:!0,widgetFormHtml:null,formInitialized:!1,widgetSettingsChanged:!1,widgetPreviewHtml:null,previewInitialized:!1})}}}),r("div",{className:"so-widget-block-form-container",dangerouslySetInnerHTML:{__html:d},ref:function(e){var t=$(e).find(".siteorigin-widget-form-main");0<t.length&&!i.formInitialized&&(t.siblings(".siteorigin-widget-preview").find("> a").on("click",function(e){e.stopImmediatePropagation(),n()}),t.data("backupDisabled",!0),t.sowSetupForm(),i.attributes.widgetData||i.setAttributes({widgetData:sowbForms.getWidgetFormValues(t)}),t.on("change",function(){i.setAttributes({widgetData:sowbForms.getWidgetFormValues(t)}),i.setState({widgetSettingsChanged:!0,widgetPreviewHtml:null,previewInitialized:!1})}),i.setState({formInitialized:!0}))}})))]}),save:function(){return null}})}(window.wp.editor,window.wp.blocks,window.wp.i18n,window.wp.element,window.wp.components,window.wp.compose);
1
+ !function(e,t,i,n,o,s){var r=n.createElement,d=t.registerBlockType,a=e.BlockControls,l=o.SelectControl,w=s.withState,g=o.Toolbar,c=o.IconButton,u=o.Placeholder,m=o.Spinner,b=i.__;d("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 r("span",{className:"widget-icon so-widget-icon so-block-editor-icon"})},category:"widgets",keywords:[sowbBlockEditorAdmin.widgets.reduce(function(e,t){return 0<e.length&&(e+=","),e+t.name},"")],supports:{html:!1},attributes:{widgetClass:{type:"string"},widgetData:{type:"object"}},edit:w({editing:!1,formInitialized:!1,previewInitialized:!1,widgetFormHtml:"",widgetSettingsChanged:!1,widgetPreviewHtml:""})(function(i){function n(){i.setState({editing:!1,previewInitialized:!1})}if(!i.editing&&i.attributes.widgetClass&&i.attributes.widgetData){var e=!i.loadingWidgets&&!i.editing&&!i.widgetPreviewHtml&&i.attributes.widgetClass&&i.attributes.widgetData;e&&$.post({url:sowbBlockEditorAdmin.restUrl+"sowb/v1/widgets/previews",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",sowbBlockEditorAdmin.nonce)},data:{widgetClass:i.attributes.widgetClass,widgetData:i.attributes.widgetData||{}}}).done(function(e){i.setState({widgetPreviewHtml:e,previewInitialized:!1})}).fail(function(e){var t="";e.hasOwnProperty("responseJSON")?t=e.responseJSON.message:e.hasOwnProperty("responseText")&&(t=e.responseText),i.setState({widgetPreviewHtml:"<div>"+t+"</div>"})});var t=i.widgetPreviewHtml?i.widgetPreviewHtml:"";return[r(a,{key:"controls"},r(g,null,r(c,{className:"components-icon-button components-toolbar__control",label:b("Edit widget.","so-widgets-bundle"),onClick:function(){i.setState({editing:!0,formInitialized:!1})},icon:"edit"}))),r("div",{key:"preview",className:"so-widget-preview-container"},e?r("div",{className:"so-widgets-spinner-container"},r("span",null,r(m))):r("div",{dangerouslySetInnerHTML:{__html:t},ref:function(){i.previewInitialized||($(window.sowb).trigger("setup_widgets",{preview:!0}),i.setState({previewInitialized:!0}))}}))]}var o=[];sowbBlockEditorAdmin.widgets&&(sowbBlockEditorAdmin.widgets.sort(function(e,t){return e.name<t.name?-1:e.name>t.name?1:0}),(o=sowbBlockEditorAdmin.widgets.map(function(e){return{value:e.class,label:e.name}})).unshift({value:"",label:b("Select widget type","so-widgets-bundle")}));var s=i.attributes.widgetClass&&!i.widgetFormHtml;s&&$.post({url:sowbBlockEditorAdmin.restUrl+"sowb/v1/widgets/forms",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",sowbBlockEditorAdmin.nonce)},data:{widgetClass:i.attributes.widgetClass,widgetData:i.attributes.widgetData}}).done(function(e){i.setState({widgetFormHtml:e})}).fail(function(e){var t="";e.hasOwnProperty("responseJSON")?t=e.responseJSON.message:e.hasOwnProperty("responseText")&&(t=e.responseText),i.setState({widgetFormHtml:"<div>"+t+"</div>"})});var d=i.widgetFormHtml?i.widgetFormHtml:"";return[!!d&&r(a,{key:"controls"},r(g,null,r(c,{className:"components-icon-button components-toolbar__control",label:b("Preview widget.","so-widgets-bundle"),onClick:n,icon:"visibility"}))),r(u,{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")},i.loadingWidgets||s?r(m):r("div",{className:"so-widget-block-container"},r(l,{options:o,value:i.attributes.widgetClass,onChange:function(e){if(""!==e){if(i.widgetSettingsChanged&&!confirm(sowbBlockEditorAdmin.confirmChangeWidget))return!1;i.setAttributes({widgetClass:e,widgetData:null}),i.setState({editing:!0,widgetFormHtml:null,formInitialized:!1,widgetSettingsChanged:!1,widgetPreviewHtml:null,previewInitialized:!1})}}}),r("div",{className:"so-widget-block-form-container",dangerouslySetInnerHTML:{__html:d},ref:function(e){var t=$(e).find(".siteorigin-widget-form-main");0<t.length&&!i.formInitialized&&(t.siblings(".siteorigin-widget-preview").find("> a").on("click",function(e){e.stopImmediatePropagation(),n()}),t.data("backupDisabled",!0),t.sowSetupForm(),i.attributes.widgetData?sowbForms.setWidgetFormValues(t,i.attributes.widgetData):i.setAttributes({widgetData:sowbForms.getWidgetFormValues(t)}),t.on("change",function(){i.setAttributes({widgetData:sowbForms.getWidgetFormValues(t)}),i.setState({widgetSettingsChanged:!0,widgetPreviewHtml:null,previewInitialized:!1})}),i.setState({formInitialized:!0}))}})))]}),save:function(){return null}})}(window.wp.editor,window.wp.blocks,window.wp.i18n,window.wp.element,window.wp.components,window.wp.compose);
compat/block-editor/widget-block.php CHANGED
@@ -1,102 +1,102 @@
1
- <?php
2
-
3
- class SiteOrigin_Widgets_Bundle_Widget_Block {
4
- /**
5
- * Get the singleton instance
6
- *
7
- * @return SiteOrigin_Widgets_Bundle_Widget_Block
8
- */
9
- public static function single() {
10
- static $single;
11
-
12
- return empty( $single ) ? $single = new self() : $single;
13
- }
14
-
15
- public function __construct() {
16
- add_action( 'init', array( $this, 'register_widget_block' ) );
17
- add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_widget_block_editor_assets' ) );
18
- }
19
-
20
- public function register_widget_block() {
21
- register_block_type( 'sowb/widget-block', array(
22
- 'render_callback' => array( $this, 'render_widget_block' ),
23
- ) );
24
- }
25
-
26
- public function enqueue_widget_block_editor_assets() {
27
- wp_enqueue_script(
28
- 'sowb-widget-block',
29
- plugins_url( 'widget-block' . SOW_BUNDLE_JS_SUFFIX . '.js', __FILE__ ),
30
- array( 'wp-editor', 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-components', 'wp-compose' ),
31
- SOW_BUNDLE_VERSION
32
- );
33
-
34
- global $wp_widget_factory;
35
- $so_widgets = array();
36
- foreach ( $wp_widget_factory->widgets as $class => $widget_obj ) {
37
- if ( ! empty( $widget_obj ) && is_object( $widget_obj ) && is_subclass_of( $widget_obj, 'SiteOrigin_Widget' ) ) {
38
- $so_widgets[] = array(
39
- 'name' => preg_replace( '/^SiteOrigin /', '', $widget_obj->name ),
40
- 'class' => $class,
41
- );
42
- }
43
- }
44
-
45
- wp_localize_script(
46
- 'sowb-widget-block',
47
- 'sowbBlockEditorAdmin',
48
- array(
49
- 'widgets' => $so_widgets,
50
- 'restUrl' => esc_url_raw( rest_url() ),
51
- 'nonce' => wp_create_nonce( 'wp_rest' ),
52
- 'confirmChangeWidget' => __( 'Selecting a different widget will revert any changes. Continue?', 'so-widgets-bundle' ),
53
- )
54
- );
55
- if ( function_exists( 'wp_set_script_translations' ) ) {
56
- wp_set_script_translations( 'sowb-widget-block', 'so-widgets-bundle' );
57
- }
58
-
59
- $so_widgets_bundle = SiteOrigin_Widgets_Bundle::single();
60
- // This is to ensure necessary scripts can be enqueued for previews.
61
- $so_widgets_bundle->register_general_scripts();
62
- $so_widgets_bundle->enqueue_registered_widgets_scripts();
63
- }
64
-
65
- public function render_widget_block( $attributes ) {
66
- if ( empty( $attributes['widgetClass'] ) ) {
67
- return '<div>'.
68
- __( 'You need to select a widget type before you\'ll see anything here. :)', 'so-widgets-bundle' ) .
69
- '</div>';
70
- }
71
-
72
- $widget_class = $attributes['widgetClass'];
73
-
74
- global $wp_widget_factory;
75
-
76
- $widget = ! empty( $wp_widget_factory->widgets[ $widget_class ] ) ? $wp_widget_factory->widgets[ $widget_class ] : false;
77
-
78
- $instance = $attributes['widgetData'];
79
-
80
- if ( ! empty( $widget ) && is_object( $widget ) && is_subclass_of( $widget, 'SiteOrigin_Widget' ) ) {
81
- $GLOBALS['SITEORIGIN_WIDGET_BLOCK_RENDER'] = true;
82
- ob_start();
83
- /* @var $widget SiteOrigin_Widget */
84
- $instance = $widget->update( $instance, $instance );
85
- $widget->widget( array(), $instance );
86
- $rendered_widget = ob_get_clean();
87
- unset( $GLOBALS['SITEORIGIN_WIDGET_BLOCK_RENDER'] );
88
- } else {
89
- return '<div>'.
90
- sprintf(
91
- __( 'Invalid widget class %s. Please make sure the widget has been activated in %sSiteOrigin Widgets%s.', 'so-widgets-bundle' ),
92
- $widget_class,
93
- '<a href="' . admin_url( 'plugins.php?page=so-widgets-plugins' ) . '">',
94
- '</a>'
95
- ) .
96
- '</div>';
97
- }
98
- return $rendered_widget;
99
- }
100
- }
101
-
102
- SiteOrigin_Widgets_Bundle_Widget_Block::single();
1
+ <?php
2
+
3
+ class SiteOrigin_Widgets_Bundle_Widget_Block {
4
+ /**
5
+ * Get the singleton instance
6
+ *
7
+ * @return SiteOrigin_Widgets_Bundle_Widget_Block
8
+ */
9
+ public static function single() {
10
+ static $single;
11
+
12
+ return empty( $single ) ? $single = new self() : $single;
13
+ }
14
+
15
+ public function __construct() {
16
+ add_action( 'init', array( $this, 'register_widget_block' ) );
17
+ add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_widget_block_editor_assets' ) );
18
+ }
19
+
20
+ public function register_widget_block() {
21
+ register_block_type( 'sowb/widget-block', array(
22
+ 'render_callback' => array( $this, 'render_widget_block' ),
23
+ ) );
24
+ }
25
+
26
+ public function enqueue_widget_block_editor_assets() {
27
+ wp_enqueue_script(
28
+ 'sowb-widget-block',
29
+ plugins_url( 'widget-block' . SOW_BUNDLE_JS_SUFFIX . '.js', __FILE__ ),
30
+ array( 'wp-editor', 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-components', 'wp-compose' ),
31
+ SOW_BUNDLE_VERSION
32
+ );
33
+
34
+ global $wp_widget_factory;
35
+ $so_widgets = array();
36
+ foreach ( $wp_widget_factory->widgets as $class => $widget_obj ) {
37
+ if ( ! empty( $widget_obj ) && is_object( $widget_obj ) && is_subclass_of( $widget_obj, 'SiteOrigin_Widget' ) ) {
38
+ $so_widgets[] = array(
39
+ 'name' => preg_replace( '/^SiteOrigin /', '', $widget_obj->name ),
40
+ 'class' => $class,
41
+ );
42
+ }
43
+ }
44
+
45
+ wp_localize_script(
46
+ 'sowb-widget-block',
47
+ 'sowbBlockEditorAdmin',
48
+ array(
49
+ 'widgets' => $so_widgets,
50
+ 'restUrl' => esc_url_raw( rest_url() ),
51
+ 'nonce' => wp_create_nonce( 'wp_rest' ),
52
+ 'confirmChangeWidget' => __( 'Selecting a different widget will revert any changes. Continue?', 'so-widgets-bundle' ),
53
+ )
54
+ );
55
+ if ( function_exists( 'wp_set_script_translations' ) ) {
56
+ wp_set_script_translations( 'sowb-widget-block', 'so-widgets-bundle' );
57
+ }
58
+
59
+ $so_widgets_bundle = SiteOrigin_Widgets_Bundle::single();
60
+ // This is to ensure necessary scripts can be enqueued for previews.
61
+ $so_widgets_bundle->register_general_scripts();
62
+ $so_widgets_bundle->enqueue_registered_widgets_scripts();
63
+ }
64
+
65
+ public function render_widget_block( $attributes ) {
66
+ if ( empty( $attributes['widgetClass'] ) ) {
67
+ return '<div>'.
68
+ __( 'You need to select a widget type before you\'ll see anything here. :)', 'so-widgets-bundle' ) .
69
+ '</div>';
70
+ }
71
+
72
+ $widget_class = $attributes['widgetClass'];
73
+
74
+ global $wp_widget_factory;
75
+
76
+ $widget = ! empty( $wp_widget_factory->widgets[ $widget_class ] ) ? $wp_widget_factory->widgets[ $widget_class ] : false;
77
+
78
+ $instance = $attributes['widgetData'];
79
+
80
+ if ( ! empty( $widget ) && is_object( $widget ) && is_subclass_of( $widget, 'SiteOrigin_Widget' ) ) {
81
+ $GLOBALS['SITEORIGIN_WIDGET_BLOCK_RENDER'] = true;
82
+ ob_start();
83
+ /* @var $widget SiteOrigin_Widget */
84
+ $instance = $widget->update( $instance, $instance );
85
+ $widget->widget( array(), $instance );
86
+ $rendered_widget = ob_get_clean();
87
+ unset( $GLOBALS['SITEORIGIN_WIDGET_BLOCK_RENDER'] );
88
+ } else {
89
+ return '<div>'.
90
+ sprintf(
91
+ __( 'Invalid widget class %s. Please make sure the widget has been activated in %sSiteOrigin Widgets%s.', 'so-widgets-bundle' ),
92
+ $widget_class,
93
+ '<a href="' . admin_url( 'plugins.php?page=so-widgets-plugins' ) . '">',
94
+ '</a>'
95
+ ) .
96
+ '</div>';
97
+ }
98
+ return $rendered_widget;
99
+ }
100
+ }
101
+
102
+ SiteOrigin_Widgets_Bundle_Widget_Block::single();
compat/compat.php CHANGED
@@ -1,59 +1,59 @@
1
- <?php
2
-
3
- class SiteOrigin_Widgets_Bundle_Compatibility {
4
-
5
- const BEAVER_BUILDER = 'Beaver Builder';
6
- const ELEMENTOR = 'Elementor';
7
- const VISUAL_COMPOSER = 'Visual Composer';
8
-
9
- /**
10
- * Get the singleton instance
11
- *
12
- * @return SiteOrigin_Widgets_Bundle_Compatibility
13
- */
14
- public static function single() {
15
- static $single;
16
- return empty( $single ) ? $single = new self() : $single;
17
- }
18
-
19
- function __construct() {
20
- $builder = $this->get_active_builder();
21
- if ( ! empty( $builder ) ) {
22
- require_once $builder['file_path'];
23
- }
24
-
25
- if ( function_exists( 'register_block_type' ) ) {
26
- require_once plugin_dir_path( __FILE__ ) . 'block-editor/widget-block.php';
27
- }
28
- }
29
-
30
- function get_active_builder() {
31
-
32
- $builders = include_once 'builders.php';
33
-
34
- foreach ( $builders as $builder ) {
35
- if ( $this->is_active( $builder ) ) {
36
- return $builder;
37
- }
38
- }
39
-
40
- return null;
41
- }
42
-
43
- function is_active( $builder ) {
44
- switch ( $builder[ 'name' ] ) {
45
- case self::BEAVER_BUILDER:
46
- return class_exists( 'FLBuilderModel', false );
47
- break;
48
- case self::ELEMENTOR:
49
- return class_exists( 'Elementor\\Plugin', false );
50
- break;
51
- case self::VISUAL_COMPOSER:
52
- return class_exists( 'Vc_Manager' );
53
- break;
54
- }
55
- }
56
-
57
- }
58
-
59
- SiteOrigin_Widgets_Bundle_Compatibility::single();
1
+ <?php
2
+
3
+ class SiteOrigin_Widgets_Bundle_Compatibility {
4
+
5
+ const BEAVER_BUILDER = 'Beaver Builder';
6
+ const ELEMENTOR = 'Elementor';
7
+ const VISUAL_COMPOSER = 'Visual Composer';
8
+
9
+ /**
10
+ * Get the singleton instance
11
+ *
12
+ * @return SiteOrigin_Widgets_Bundle_Compatibility
13
+ */
14
+ public static function single() {
15
+ static $single;
16
+ return empty( $single ) ? $single = new self() : $single;
17
+ }
18
+
19
+ function __construct() {
20
+ $builder = $this->get_active_builder();
21
+ if ( ! empty( $builder ) ) {
22
+ require_once $builder['file_path'];
23
+ }
24
+
25
+ if ( function_exists( 'register_block_type' ) ) {
26
+ require_once plugin_dir_path( __FILE__ ) . 'block-editor/widget-block.php';
27
+ }
28
+ }
29
+
30
+ function get_active_builder() {
31
+
32
+ $builders = include_once 'builders.php';
33
+
34
+ foreach ( $builders as $builder ) {
35
+ if ( $this->is_active( $builder ) ) {
36
+ return $builder;
37
+ }
38
+ }
39
+
40
+ return null;
41
+ }
42
+
43
+ function is_active( $builder ) {
44
+ switch ( $builder[ 'name' ] ) {
45
+ case self::BEAVER_BUILDER:
46
+ return class_exists( 'FLBuilderModel', false );
47
+ break;
48
+ case self::ELEMENTOR:
49
+ return class_exists( 'Elementor\\Plugin', false );
50
+ break;
51
+ case self::VISUAL_COMPOSER:
52
+ return class_exists( 'Vc_Manager' );
53
+ break;
54
+ }
55
+ }
56
+
57
+ }
58
+
59
+ SiteOrigin_Widgets_Bundle_Compatibility::single();
compat/elementor/elementor.php CHANGED
@@ -1,88 +1,88 @@
1
- <?php
2
-
3
- class SiteOrigin_Widgets_Bundle_Elementor {
4
-
5
- /**
6
- * Get the singleton instance
7
- *
8
- * @return SiteOrigin_Widgets_Bundle_Elementor
9
- */
10
- public static function single() {
11
- static $single;
12
-
13
- return empty( $single ) ? $single = new self() : $single;
14
- }
15
-
16
- private $plugin;
17
-
18
- function __construct() {
19
- add_action( 'admin_action_elementor', array( $this, 'init_editor' ) );
20
- add_action( 'template_redirect', array( $this, 'init_preview' ) );
21
-
22
- add_filter( 'siteorigin_widgets_is_preview', array( $this, 'is_elementor_preview' ) );
23
- add_action( 'wp_ajax_elementor_editor_get_wp_widget_form', array( $this, 'ajax_render_widget_form' ) );
24
- }
25
-
26
- function init_editor() {
27
- add_action( 'elementor/editor/before_enqueue_scripts', array( $this, 'enqueue_active_widgets_scripts' ) );
28
- }
29
-
30
- function init_preview() {
31
- $this->plugin = Elementor\Plugin::instance();
32
- if ( !empty( $this->plugin->preview ) && method_exists( $this->plugin->preview, 'is_preview_mode' ) && $this->plugin->preview->is_preview_mode() ) {
33
- add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_frontend_scripts' ) );
34
- add_action( 'elementor/preview/enqueue_styles', array( $this, 'enqueue_frontend_scripts' ) );
35
- }
36
- }
37
-
38
- function enqueue_frontend_scripts() {
39
- $so_widgets_bundle = SiteOrigin_Widgets_Bundle::single();
40
- $so_widgets_bundle->register_general_scripts();
41
- $so_widgets_bundle->enqueue_registered_widgets_scripts( true, false );
42
- }
43
-
44
- function enqueue_active_widgets_scripts() {
45
-
46
- add_action( 'wp_print_footer_scripts', array( $this, 'print_footer_templates' ) );
47
-
48
- $so_widgets_bundle = SiteOrigin_Widgets_Bundle::single();
49
- $so_widgets_bundle->register_general_scripts();
50
- $so_widgets_bundle->enqueue_registered_widgets_scripts( false, true );
51
-
52
- wp_enqueue_style( 'sowb-styles-for-elementor', plugin_dir_url( __FILE__ ) . 'styles.css' );
53
-
54
- wp_enqueue_script(
55
- 'sowb-js-for-elementor',
56
- plugin_dir_url( __FILE__ ) . 'sowb-elementor' . SOW_BUNDLE_JS_SUFFIX . '.js',
57
- array( 'jquery' )
58
- );
59
-
60
- }
61
-
62
- function print_footer_templates() {
63
- global $wp_widget_factory;
64
-
65
- // Elementor does it's editing in the front end so print required footer templates for active widgets.
66
- foreach ( $wp_widget_factory->widgets as $class => $widget_obj ) {
67
- if ( ! empty( $widget_obj ) && is_object( $widget_obj ) && is_subclass_of( $widget_obj, 'SiteOrigin_Widget' ) ) {
68
- /* @var $widget_obj SiteOrigin_Widget */
69
- $widget_obj->footer_admin_templates();
70
- }
71
- }
72
- }
73
-
74
- function is_elementor_preview( $is_preview ) {
75
- $this->plugin = Elementor\Plugin::instance();
76
- $is_elementor_preview = ! empty( $this->plugin->preview ) && method_exists( $this->plugin->preview, 'is_preview_mode' ) && $this->plugin->preview->is_preview_mode();
77
- $is_elementor_edit_mode = $this->plugin->editor->is_edit_mode();
78
- return $is_preview || $is_elementor_preview || $is_elementor_edit_mode ||
79
- ( !empty( $_REQUEST['action'] ) && $_REQUEST['action'] == 'elementor_ajax' );
80
- }
81
-
82
- function ajax_render_widget_form() {
83
- // Don't want to show the form preview button when using Elementor
84
- add_filter( 'siteorigin_widgets_form_show_preview_button', array( $this, '__return_false' ) );
85
- }
86
- }
87
-
88
- SiteOrigin_Widgets_Bundle_Elementor::single();
1
+ <?php
2
+
3
+ class SiteOrigin_Widgets_Bundle_Elementor {
4
+
5
+ /**
6
+ * Get the singleton instance
7
+ *
8
+ * @return SiteOrigin_Widgets_Bundle_Elementor
9
+ */
10
+ public static function single() {
11
+ static $single;
12
+
13
+ return empty( $single ) ? $single = new self() : $single;
14
+ }
15
+
16
+ private $plugin;
17
+
18
+ function __construct() {
19
+ add_action( 'admin_action_elementor', array( $this, 'init_editor' ) );
20
+ add_action( 'template_redirect', array( $this, 'init_preview' ) );
21
+
22
+ add_filter( 'siteorigin_widgets_is_preview', array( $this, 'is_elementor_preview' ) );
23
+ add_action( 'wp_ajax_elementor_editor_get_wp_widget_form', array( $this, 'ajax_render_widget_form' ) );
24
+ }
25
+
26
+ function init_editor() {
27
+ add_action( 'elementor/editor/before_enqueue_scripts', array( $this, 'enqueue_active_widgets_scripts' ) );
28
+ }
29
+
30
+ function init_preview() {
31
+ $this->plugin = Elementor\Plugin::instance();
32
+ if ( !empty( $this->plugin->preview ) && method_exists( $this->plugin->preview, 'is_preview_mode' ) && $this->plugin->preview->is_preview_mode() ) {
33
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_frontend_scripts' ) );
34
+ add_action( 'elementor/preview/enqueue_styles', array( $this, 'enqueue_frontend_scripts' ) );
35
+ }
36
+ }
37
+
38
+ function enqueue_frontend_scripts() {
39
+ $so_widgets_bundle = SiteOrigin_Widgets_Bundle::single();
40
+ $so_widgets_bundle->register_general_scripts();
41
+ $so_widgets_bundle->enqueue_registered_widgets_scripts( true, false );
42
+ }
43
+
44
+ function enqueue_active_widgets_scripts() {
45
+
46
+ add_action( 'wp_print_footer_scripts', array( $this, 'print_footer_templates' ) );
47
+
48
+ $so_widgets_bundle = SiteOrigin_Widgets_Bundle::single();
49
+ $so_widgets_bundle->register_general_scripts();
50
+ $so_widgets_bundle->enqueue_registered_widgets_scripts( false, true );
51
+
52
+ wp_enqueue_style( 'sowb-styles-for-elementor', plugin_dir_url( __FILE__ ) . 'styles.css' );
53
+
54
+ wp_enqueue_script(
55
+ 'sowb-js-for-elementor',
56
+ plugin_dir_url( __FILE__ ) . 'sowb-elementor' . SOW_BUNDLE_JS_SUFFIX . '.js',
57
+ array( 'jquery' )
58
+ );
59
+
60
+ }
61
+
62
+ function print_footer_templates() {
63
+ global $wp_widget_factory;
64
+
65
+ // Elementor does it's editing in the front end so print required footer templates for active widgets.
66
+ foreach ( $wp_widget_factory->widgets as $class => $widget_obj ) {
67
+ if ( ! empty( $widget_obj ) && is_object( $widget_obj ) && is_subclass_of( $widget_obj, 'SiteOrigin_Widget' ) ) {
68
+ /* @var $widget_obj SiteOrigin_Widget */
69
+ $widget_obj->footer_admin_templates();
70
+ }
71
+ }
72
+ }
73
+
74
+ function is_elementor_preview( $is_preview ) {
75
+ $this->plugin = Elementor\Plugin::instance();
76
+ $is_elementor_preview = ! empty( $this->plugin->preview ) && method_exists( $this->plugin->preview, 'is_preview_mode' ) && $this->plugin->preview->is_preview_mode();
77
+ $is_elementor_edit_mode = $this->plugin->editor->is_edit_mode();
78
+ return $is_preview || $is_elementor_preview || $is_elementor_edit_mode ||
79
+ ( !empty( $_REQUEST['action'] ) && $_REQUEST['action'] == 'elementor_ajax' );
80
+ }
81
+
82
+ function ajax_render_widget_form() {
83
+ // Don't want to show the form preview button when using Elementor
84
+ add_filter( 'siteorigin_widgets_form_show_preview_button', array( $this, '__return_false' ) );
85
+ }
86
+ }
87
+
88
+ SiteOrigin_Widgets_Bundle_Elementor::single();
compat/elementor/sowb-elementor.js CHANGED
@@ -1,25 +1,25 @@
1
- var sowb = window.sowb || {};
2
-
3
- ( function($){
4
-
5
- // To ensure necessary scripts are executed again when settings are changed
6
- $( window ).on( 'elementor:init', function() {
7
- elementor.on( 'preview:loaded', function () {
8
- var preview_window = elementor.$preview.get( 0 ).contentWindow;
9
- var $sowb = preview_window.jQuery( preview_window.sowb );
10
- var timeoutId;
11
- elementorFrontend.hooks.addAction( 'frontend/element_ready/widget', function(){
12
- // Debounce
13
- if ( timeoutId ) {
14
- clearTimeout( timeoutId );
15
- }
16
- timeoutId = setTimeout( function () {
17
- // Trigger Widgets Bundle widgets to setup
18
- $sowb.trigger( 'setup_widgets', { preview: true } );
19
- timeoutId = null;
20
- }, 300 );
21
- } );
22
- } );
23
- } );
24
-
25
- })(jQuery);
1
+ var sowb = window.sowb || {};
2
+
3
+ ( function($){
4
+
5
+ // To ensure necessary scripts are executed again when settings are changed
6
+ $( window ).on( 'elementor:init', function() {
7
+ elementor.on( 'preview:loaded', function () {
8
+ var preview_window = elementor.$preview.get( 0 ).contentWindow;
9
+ var $sowb = preview_window.jQuery( preview_window.sowb );
10
+ var timeoutId;
11
+ elementorFrontend.hooks.addAction( 'frontend/element_ready/widget', function(){
12
+ // Debounce
13
+ if ( timeoutId ) {
14
+ clearTimeout( timeoutId );
15
+ }
16
+ timeoutId = setTimeout( function () {
17
+ // Trigger Widgets Bundle widgets to setup
18
+ $sowb.trigger( 'setup_widgets', { preview: true } );
19
+ timeoutId = null;
20
+ }, 300 );
21
+ } );
22
+ } );
23
+ } );
24
+
25
+ })(jQuery);
compat/visual-composer/sowb-vc-widget.js CHANGED
@@ -1,80 +1,80 @@
1
- /* globals jQuery, sowbForms, confirm, soWidgetsVC */
2
- var sowbForms = window.sowbForms || {};
3
-
4
- sowbForms.setupVcWidgetForm = function () {
5
- var $ = jQuery;
6
- var $widgetDropdown = $( '[name="so_widget_class"]' );
7
- var $formContainer = $( '.siteorigin_widget_form_container' );
8
- var formDirty = false;
9
- $formContainer.on( 'change', '.siteorigin-widget-field', function () {
10
- formDirty = true;
11
- var widgetData = sowbForms.getWidgetFormValues( $formContainer );
12
- var widgetClass = $widgetDropdown.val();
13
-
14
- var jsonString = JSON.stringify( { widget_class: widgetClass, widget_data: widgetData } );
15
- jsonString = jsonString.replace( /\\/g, '\\\\' );
16
- $( '[name="so_widget_data"]' ).val( jsonString );
17
- } );
18
-
19
- var prevWidget;
20
- $widgetDropdown.mousedown( function () {
21
- prevWidget = $widgetDropdown.find( 'option:selected' );
22
- } );
23
-
24
- $widgetDropdown.on( 'change', function ( event ) {
25
- if ( formDirty && !confirm( soWidgetsVC.confirmChangeWidget ) ) {
26
- prevWidget.attr( 'selected', true );
27
- return;
28
- }
29
-
30
- formDirty = false;
31
-
32
- var widget = $widgetDropdown.val();
33
-
34
- var data = {
35
- 'action': 'sowb_vc_widget_render_form',
36
- 'widget': widget,
37
- };
38
-
39
- $.post(
40
- soWidgetsVC.ajaxUrl,
41
- data,
42
- function ( result ) {
43
- $formContainer.html( result );
44
- // To ensure data is updated.
45
- $formContainer.trigger( 'change' );
46
- },
47
- 'html'
48
- );
49
- } );
50
- vc.atts.sowb_json_escaped = {
51
- parse: function ( param ) {
52
- var $field = this.content().find( '.wpb_vc_param_value[name=' + param.param_name + ']' );
53
- // We double encode in the front end to prevent accidental decoding when the content is set on the
54
- // WP visual editor.
55
- return _.escape( _.escape( $field.val().toString() ).replace( /\[/g, '&#91;' ).replace( /\]/g, '&#93;' ) );
56
- },
57
- render: function ( param, value ) {
58
- return _.unescape( _.unescape( value ) ).replace( /&#91;/g, '[' ).replace( /&#93;/g, ']' );
59
- }
60
- };
61
- vc.events.on( "shortcodeView:updated:siteorigin_widget_vc", function () {
62
-
63
- if ( typeof vc.frame_window !== 'undefined' && typeof vc.frame_window.sowb !== 'undefined' ) {
64
-
65
- // Have to use jQuery from iframe window for triggered events to be detected there.
66
- var $ = vc.frame_window.jQuery;
67
- var sowb = vc.frame_window.sowb;
68
-
69
- // Trigger Widgets Bundle widgets to setup
70
- $( sowb ).trigger( 'setup_widgets', { preview: true } );
71
- }
72
- } );
73
-
74
- };
75
-
76
- jQuery( function ( $ ) {
77
- sowbForms.setupVcWidgetForm();
78
- } );
79
-
80
- window.sowbForms = sowbForms;
1
+ /* globals jQuery, sowbForms, confirm, soWidgetsVC */
2
+ var sowbForms = window.sowbForms || {};
3
+
4
+ sowbForms.setupVcWidgetForm = function () {
5
+ var $ = jQuery;
6
+ var $widgetDropdown = $( '[name="so_widget_class"]' );
7
+ var $formContainer = $( '.siteorigin_widget_form_container' );
8
+ var formDirty = false;
9
+ $formContainer.on( 'change', '.siteorigin-widget-field', function () {
10
+ formDirty = true;
11
+ var widgetData = sowbForms.getWidgetFormValues( $formContainer );
12
+ var widgetClass = $widgetDropdown.val();
13
+
14
+ var jsonString = JSON.stringify( { widget_class: widgetClass, widget_data: widgetData } );
15
+ jsonString = jsonString.replace( /\\/g, '\\\\' );
16
+ $( '[name="so_widget_data"]' ).val( jsonString );
17
+ } );
18
+
19
+ var prevWidget;
20
+ $widgetDropdown.mousedown( function () {
21
+ prevWidget = $widgetDropdown.find( 'option:selected' );
22
+ } );
23
+
24
+ $widgetDropdown.on( 'change', function ( event ) {
25
+ if ( formDirty && !confirm( soWidgetsVC.confirmChangeWidget ) ) {
26
+ prevWidget.attr( 'selected', true );
27
+ return;
28
+ }
29
+
30
+ formDirty = false;
31
+
32
+ var widget = $widgetDropdown.val();
33
+
34
+ var data = {
35
+ 'action': 'sowb_vc_widget_render_form',
36
+ 'widget': widget,
37
+ };
38
+
39
+ $.post(
40
+ soWidgetsVC.ajaxUrl,
41
+ data,
42
+ function ( result ) {
43
+ $formContainer.html( result );
44
+ // To ensure data is updated.
45
+ $formContainer.trigger( 'change' );
46
+ },
47
+ 'html'
48
+ );
49
+ } );
50
+ vc.atts.sowb_json_escaped = {
51
+ parse: function ( param ) {
52
+ var $field = this.content().find( '.wpb_vc_param_value[name=' + param.param_name + ']' );
53
+ // We double encode in the front end to prevent accidental decoding when the content is set on the
54
+ // WP visual editor.
55
+ return _.escape( _.escape( $field.val().toString() ).replace( /\[/g, '&#91;' ).replace( /\]/g, '&#93;' ) );
56
+ },
57
+ render: function ( param, value ) {
58
+ return _.unescape( _.unescape( value ) ).replace( /&#91;/g, '[' ).replace( /&#93;/g, ']' );
59
+ }
60
+ };
61
+ vc.events.on( "shortcodeView:updated:siteorigin_widget_vc", function () {
62
+
63
+ if ( typeof vc.frame_window !== 'undefined' && typeof vc.frame_window.sowb !== 'undefined' ) {
64
+
65
+ // Have to use jQuery from iframe window for triggered events to be detected there.
66
+ var $ = vc.frame_window.jQuery;
67
+ var sowb = vc.frame_window.sowb;
68
+
69
+ // Trigger Widgets Bundle widgets to setup
70
+ $( sowb ).trigger( 'setup_widgets', { preview: true } );
71
+ }
72
+ } );
73
+
74
+ };
75
+
76
+ jQuery( function ( $ ) {
77
+ sowbForms.setupVcWidgetForm();
78
+ } );
79
+
80
+ window.sowbForms = sowbForms;
compat/visual-composer/visual-composer.php CHANGED
@@ -1,296 +1,296 @@
1
- <?php
2
-
3
- class SiteOrigin_Widgets_Bundle_Visual_Composer {
4
-
5
- /**
6
- * Get the singleton instance
7
- *
8
- * @return SiteOrigin_Widgets_Bundle_Visual_Composer
9
- */
10
- public static function single() {
11
- static $single;
12
-
13
- return empty( $single ) ? $single = new self() : $single;
14
- }
15
-
16
- function __construct() {
17
- add_action( 'vc_after_init', array( $this, 'init' ) );
18
-
19
- add_action( 'admin_print_scripts-post-new.php', array( $this, 'enqueue_active_widgets_scripts' ) );
20
- add_action( 'admin_print_scripts-post.php', array( $this, 'enqueue_active_widgets_scripts' ) );
21
-
22
- add_action( 'wp_ajax_sowb_vc_widget_render_form', array( $this, 'sowb_vc_widget_render_form' ) );
23
-
24
- add_filter( 'siteorigin_widgets_form_show_preview_button', '__return_false' );
25
-
26
- add_filter( 'content_save_pre', array( $this, 'update_widget_data' ) );
27
- }
28
-
29
- function init() {
30
-
31
- vc_add_shortcode_param(
32
- 'sowb_json_escaped',
33
- array( $this, 'siteorigin_widget_form' ),
34
- plugin_dir_url( __FILE__ ) . 'sowb-vc-widget' . SOW_BUNDLE_JS_SUFFIX . '.js'
35
- );
36
-
37
- $settings = array(
38
- 'name' => __( 'SiteOrigin Widget', 'so-widgets-bundle' ),
39
- 'base' => 'siteorigin_widget_vc',
40
- 'category' => __( 'SiteOrigin Widgets', 'so-widgets-bundle' ),
41
- 'icon' => 'so-widget-icon',
42
- 'description' => __( 'Allows you to add any active SiteOrigin Widgets Bundle widgets.', 'so-widgets-bundle' ),
43
- // element description in add elements view
44
- 'show_settings_on_create' => true,
45
- 'weight' => - 5,
46
- // Depends on ordering in list, Higher weight first
47
- 'html_template' => dirname( __FILE__ ) . '/siteorigin_widget_vc_template.php',
48
- 'admin_enqueue_css' => preg_replace( '/\s/', '%20', plugins_url( 'styles.css', __FILE__ ) ),
49
- 'front_enqueue_css' => preg_replace( '/\s/', '%20', plugins_url( 'styles.css', __FILE__ ) ),
50
- 'front_enqueue_js' => preg_replace( '/\s/', '%20', plugins_url( 'front_enqueue_js.js', __FILE__ ) ),
51
- 'params' => array(
52
- array(
53
- 'type' => 'sowb_json_escaped',
54
- 'heading' => __( 'SiteOrigin Widget', 'so-widgets-bundle' ),
55
- 'param_name' => 'so_widget_data',
56
- ),
57
- )
58
- );
59
- vc_map( $settings );
60
- }
61
-
62
- function enqueue_active_widgets_scripts() {
63
-
64
- global $wp_widget_factory;
65
-
66
- foreach ( $wp_widget_factory->widgets as $class => $widget_obj ) {
67
- if ( ! empty( $widget_obj ) && is_object( $widget_obj ) && is_subclass_of( $widget_obj, 'SiteOrigin_Widget' ) ) {
68
- /* @var $widget_obj SiteOrigin_Widget */
69
- ob_start();
70
- $widget_obj->form( array() );
71
- ob_clean();
72
- }
73
- }
74
-
75
- wp_localize_script( 'siteorigin-widget-admin', 'soWidgetsVC', array(
76
- 'ajaxUrl' => wp_nonce_url( admin_url( 'admin-ajax.php' ), 'sowb_vc_widget_render_form', '_sowbnonce' ),
77
- 'confirmChangeWidget' => __( 'Selecting a different widget will revert any changes. Continue?', 'so-widgets-bundle' ),
78
- ) );
79
- }
80
-
81
- function siteorigin_widget_form( $settings, $value ) {
82
- $so_widget_names = array();
83
-
84
- global $wp_widget_factory;
85
- foreach ( $wp_widget_factory->widgets as $class => $widget_obj ) {
86
- if ( ! empty( $widget_obj ) && is_object( $widget_obj ) && is_subclass_of( $widget_obj, 'SiteOrigin_Widget' ) ) {
87
- $so_widget_names[ $class ] = preg_replace( '/^SiteOrigin /', '', $widget_obj->name );
88
- }
89
- }
90
- asort( $so_widget_names );
91
-
92
- /* @var $select SiteOrigin_Widget_Field_Select */
93
- $select = new SiteOrigin_Widget_Field_Select(
94
- 'so_widget_class',
95
- 'so_widget_class',
96
- 'so_widget_class',
97
- array(
98
- 'type' => 'select',
99
- 'options' => $so_widget_names,
100
- )
101
- );
102
-
103
- global $wp_widget_factory;
104
-
105
- $parsed_value = json_decode( html_entity_decode( stripslashes( $value ) ), true );
106
- if ( empty( $parsed_value ) ) {
107
- //Get the first value as the default.
108
- reset( $so_widget_names );
109
- $widget_class = key( $so_widget_names );
110
- } else {
111
- $widget_class = $parsed_value['widget_class'];
112
- }
113
-
114
- $widget = ! empty( $wp_widget_factory->widgets[ $widget_class ] ) ? $wp_widget_factory->widgets[ $widget_class ] : false;
115
-
116
- ob_start();
117
- $select->render( $widget_class ); ?>
118
- <input type="hidden" name="so_widget_data" class="wpb_vc_param_value" value="<?php echo esc_attr( $value ); ?>">
119
- <div class="siteorigin_widget_form_container">
120
- <?php
121
- if ( ! empty( $widget ) && is_object( $widget ) && is_subclass_of( $widget, 'SiteOrigin_Widget' ) ) {
122
- /* @var $widget SiteOrigin_Widget */
123
- $widget->form( $parsed_value['widget_data'] );
124
- }
125
- ?>
126
- </div>
127
- <?php
128
- return ob_get_clean();
129
- }
130
-
131
- function sowb_vc_widget_render_form() {
132
- if ( empty( $_REQUEST['widget'] ) ) {
133
- wp_die();
134
- }
135
- if ( empty( $_REQUEST['_sowbnonce'] ) || ! wp_verify_nonce( $_REQUEST['_sowbnonce'], 'sowb_vc_widget_render_form' ) ) {
136
- wp_die();
137
- }
138
-
139
- $request = array_map( 'stripslashes_deep', $_REQUEST );
140
- $widget_class = $request['widget'];
141
-
142
- global $wp_widget_factory;
143
-
144
- $widget = ! empty( $wp_widget_factory->widgets[ $widget_class ] ) ? $wp_widget_factory->widgets[ $widget_class ] : false;
145
-
146
- if ( ! empty( $widget ) && is_object( $widget ) && is_subclass_of( $widget, 'SiteOrigin_Widget' ) ) {
147
- /* @var $widget SiteOrigin_Widget */
148
- $widget->form( array() );
149
- }
150
-
151
- wp_die();
152
- }
153
-
154
- function update_widget_data( $content ) {
155
-
156
- $content = preg_replace_callback(
157
- '/\[siteorigin_widget_vc [^\]]*\]/',
158
- array( $this, 'update_shortcode' ),
159
- $content
160
- );
161
-
162
- return $content;
163
- }
164
-
165
- function update_shortcode( $shortcode ) {
166
-
167
- preg_match(
168
- '/so_widget_data="([^"]*)"/',
169
- stripslashes( stripslashes( $shortcode[0] ) ),
170
- $widget_json
171
- );
172
-
173
- // We double encode in the front end to prevent accidental decoding when the content is set on the
174
- // WP visual editor.
175
- $widget_json = html_entity_decode( html_entity_decode( $widget_json[1] ) );
176
-
177
- $widget_atts = json_decode( $widget_json, true );
178
-
179
- global $wp_widget_factory;
180
-
181
- $widget = ! empty( $wp_widget_factory->widgets[ $widget_atts['widget_class'] ] ) ? $wp_widget_factory->widgets[ $widget_atts['widget_class'] ] : false;
182
-
183
- if ( ! empty( $widget ) && is_object( $widget ) && is_subclass_of( $widget, 'SiteOrigin_Widget' ) ) {
184
- /* @var $widget SiteOrigin_Widget */
185
- $widget_atts['widget_data'] = $widget->update( $widget_atts['widget_data'], $widget_atts['widget_data'] );
186
- }
187
-
188
- $widget_json = json_encode( $widget_atts );
189
-
190
- $widget_json = htmlentities( htmlentities( $widget_json ) );
191
-
192
- $widget_json = str_replace(
193
- array( '[', ']' ),
194
- array( '&#91;', '&#93;' ),
195
- $widget_json
196
- );
197
-
198
- $slashed = addslashes( 'so_widget_data="' . addslashes( $widget_json ) . '"' );
199
-
200
- preg_replace( '/so_widget_data="([^"]*)"/', $slashed, $shortcode );
201
-
202
- return '[siteorigin_widget_vc ' . $slashed . ']';
203
- }
204
- }
205
-
206
- SiteOrigin_Widgets_Bundle_Visual_Composer::single();
207
-
208
- if ( class_exists( 'WPBakeryShortCode' ) ) {
209
- class WPBakeryShortCode_SiteOrigin_Widget_VC extends WPBakeryShortCode {
210
- public function __construct( $settings ) {
211
- parent::__construct( $settings );
212
- }
213
-
214
- public function contentInline( $atts, $content ) {
215
- if ( empty( $atts ) ) {
216
- return '';
217
- }
218
- $widget_settings = $this->get_widget_settings( $atts );
219
- ob_start();
220
- $instance = $this->update_widget( $widget_settings['widget_class'], $widget_settings['widget_data'] );
221
- $this->render_widget( $widget_settings['widget_class'], $instance );
222
-
223
- return ob_get_clean();
224
- }
225
-
226
- public function get_widget_settings( $atts ) {
227
- if ( empty( $atts ) || empty( $atts['so_widget_data'] ) ) {
228
- return array();
229
- }
230
- $unesc = $atts['so_widget_data'];
231
- return json_decode( $unesc, true );
232
- }
233
-
234
- private function get_so_widget( $widget_class ) {
235
- global $wp_widget_factory;
236
-
237
- $widget = ! empty( $wp_widget_factory->widgets[ $widget_class ] ) ? $wp_widget_factory->widgets[ $widget_class ] : false;
238
-
239
- if ( ! empty( $widget ) && is_object( $widget ) && is_subclass_of( $widget, 'SiteOrigin_Widget' ) ) {
240
- /* @var $widget SiteOrigin_Widget */
241
- return $widget;
242
- } else {
243
- return null;
244
- }
245
- }
246
-
247
- public function render_widget( $widget_class, $widget_instance ) {
248
-
249
- if ( empty( $widget_instance ) ) {
250
- return;
251
- }
252
-
253
- /* @var $widget SiteOrigin_Widget */
254
- $widget = $this->get_so_widget( $widget_class );
255
-
256
- if ( ! empty( $widget ) ) {
257
- $widget->widget( array(), $widget_instance );
258
- }
259
- }
260
-
261
- public function update_widget( $widget_class, $widget_instance ) {
262
-
263
- if ( empty( $widget_instance ) ) {
264
- return;
265
- }
266
-
267
- /* @var $widget SiteOrigin_Widget */
268
- $widget = $this->get_so_widget( $widget_class );
269
-
270
- if ( ! empty( $widget ) ) {
271
- return $widget->update( $widget_instance, $widget_instance );
272
- } else {
273
- return $widget_instance;
274
- }
275
- }
276
-
277
- /**
278
- * @param $atts
279
- *
280
- * @return array
281
- */
282
- protected function prepareAtts( $atts ) {
283
- $return = array();
284
- if ( is_array( $atts ) ) {
285
- foreach ( $atts as $key => $val ) {
286
- // We double encode in the front end to prevent accidental decoding when the content is set on the
287
- // WP visual editor.
288
- $return[ $key ] = html_entity_decode( html_entity_decode( $val ) );
289
- }
290
- }
291
-
292
- return $return;
293
- }
294
- }
295
- } // End Class
296
-
1
+ <?php
2
+
3
+ class SiteOrigin_Widgets_Bundle_Visual_Composer {
4
+
5
+ /**
6
+ * Get the singleton instance
7
+ *
8
+ * @return SiteOrigin_Widgets_Bundle_Visual_Composer
9
+ */
10
+ public static function single() {
11
+ static $single;
12
+
13
+ return empty( $single ) ? $single = new self() : $single;
14
+ }
15
+
16
+ function __construct() {
17
+ add_action( 'vc_after_init', array( $this, 'init' ) );
18
+
19
+ add_action( 'admin_print_scripts-post-new.php', array( $this, 'enqueue_active_widgets_scripts' ) );
20
+ add_action( 'admin_print_scripts-post.php', array( $this, 'enqueue_active_widgets_scripts' ) );
21
+
22
+ add_action( 'wp_ajax_sowb_vc_widget_render_form', array( $this, 'sowb_vc_widget_render_form' ) );
23
+
24
+ add_filter( 'siteorigin_widgets_form_show_preview_button', '__return_false' );
25
+
26
+ add_filter( 'content_save_pre', array( $this, 'update_widget_data' ) );
27
+ }
28
+
29
+ function init() {
30
+
31
+ vc_add_shortcode_param(
32
+ 'sowb_json_escaped',
33
+ array( $this, 'siteorigin_widget_form' ),
34
+ plugin_dir_url( __FILE__ ) . 'sowb-vc-widget' . SOW_BUNDLE_JS_SUFFIX . '.js'
35
+ );
36
+
37
+ $settings = array(
38
+ 'name' => __( 'SiteOrigin Widget', 'so-widgets-bundle' ),
39
+ 'base' => 'siteorigin_widget_vc',
40
+ 'category' => __( 'SiteOrigin Widgets', 'so-widgets-bundle' ),
41
+ 'icon' => 'so-widget-icon',
42
+ 'description' => __( 'Allows you to add any active SiteOrigin Widgets Bundle widgets.', 'so-widgets-bundle' ),
43
+ // element description in add elements view
44
+ 'show_settings_on_create' => true,
45
+ 'weight' => - 5,
46
+ // Depends on ordering in list, Higher weight first
47
+ 'html_template' => dirname( __FILE__ ) . '/siteorigin_widget_vc_template.php',
48
+ 'admin_enqueue_css' => preg_replace( '/\s/', '%20', plugins_url( 'styles.css', __FILE__ ) ),
49
+ 'front_enqueue_css' => preg_replace( '/\s/', '%20', plugins_url( 'styles.css', __FILE__ ) ),
50
+ 'front_enqueue_js' => preg_replace( '/\s/', '%20', plugins_url( 'front_enqueue_js.js', __FILE__ ) ),
51
+ 'params' => array(
52
+ array(
53
+ 'type' => 'sowb_json_escaped',
54
+ 'heading' => __( 'SiteOrigin Widget', 'so-widgets-bundle' ),
55
+ 'param_name' => 'so_widget_data',
56
+ ),
57
+ )
58
+ );
59
+ vc_map( $settings );
60
+ }
61
+
62
+ function enqueue_active_widgets_scripts() {
63
+
64
+ global $wp_widget_factory;
65
+
66
+ foreach ( $wp_widget_factory->widgets as $class => $widget_obj ) {
67
+ if ( ! empty( $widget_obj ) && is_object( $widget_obj ) && is_subclass_of( $widget_obj, 'SiteOrigin_Widget' ) ) {
68
+ /* @var $widget_obj SiteOrigin_Widget */
69
+ ob_start();
70
+ $widget_obj->form( array() );
71
+ ob_clean();
72
+ }
73
+ }
74
+
75
+ wp_localize_script( 'siteorigin-widget-admin', 'soWidgetsVC', array(
76
+ 'ajaxUrl' => wp_nonce_url( admin_url( 'admin-ajax.php' ), 'sowb_vc_widget_render_form', '_sowbnonce' ),
77
+ 'confirmChangeWidget' => __( 'Selecting a different widget will revert any changes. Continue?', 'so-widgets-bundle' ),
78
+ ) );
79
+ }
80
+
81
+ function siteorigin_widget_form( $settings, $value ) {
82
+ $so_widget_names = array();
83
+
84
+ global $wp_widget_factory;
85
+ foreach ( $wp_widget_factory->widgets as $class => $widget_obj ) {
86
+ if ( ! empty( $widget_obj ) && is_object( $widget_obj ) && is_subclass_of( $widget_obj, 'SiteOrigin_Widget' ) ) {
87
+ $so_widget_names[ $class ] = preg_replace( '/^SiteOrigin /', '', $widget_obj->name );
88
+ }
89
+ }
90
+ asort( $so_widget_names );
91
+
92
+ /* @var $select SiteOrigin_Widget_Field_Select */
93
+ $select = new SiteOrigin_Widget_Field_Select(
94
+ 'so_widget_class',
95
+ 'so_widget_class',
96
+ 'so_widget_class',
97
+ array(
98
+ 'type' => 'select',
99
+ 'options' => $so_widget_names,
100
+ )
101
+ );
102
+
103
+ global $wp_widget_factory;
104
+
105
+ $parsed_value = json_decode( html_entity_decode( stripslashes( $value ) ), true );
106
+ if ( empty( $parsed_value ) ) {
107
+ //Get the first value as the default.
108
+ reset( $so_widget_names );
109
+ $widget_class = key( $so_widget_names );
110
+ } else {
111
+ $widget_class = $parsed_value['widget_class'];
112
+ }
113
+
114
+ $widget = ! empty( $wp_widget_factory->widgets[ $widget_class ] ) ? $wp_widget_factory->widgets[ $widget_class ] : false;
115
+
116
+ ob_start();
117
+ $select->render( $widget_class ); ?>
118
+ <input type="hidden" name="so_widget_data" class="wpb_vc_param_value" value="<?php echo esc_attr( $value ); ?>">
119
+ <div class="siteorigin_widget_form_container">
120
+ <?php
121
+ if ( ! empty( $widget ) && is_object( $widget ) && is_subclass_of( $widget, 'SiteOrigin_Widget' ) ) {
122
+ /* @var $widget SiteOrigin_Widget */
123
+ $widget->form( $parsed_value['widget_data'] );
124
+ }
125
+ ?>
126
+ </div>
127
+ <?php
128
+ return ob_get_clean();
129
+ }
130
+
131
+ function sowb_vc_widget_render_form() {
132
+ if ( empty( $_REQUEST['widget'] ) ) {
133
+ wp_die();
134
+ }
135
+ if ( empty( $_REQUEST['_sowbnonce'] ) || ! wp_verify_nonce( $_REQUEST['_sowbnonce'], 'sowb_vc_widget_render_form' ) ) {
136
+ wp_die();
137
+ }
138
+
139
+ $request = array_map( 'stripslashes_deep', $_REQUEST );
140
+ $widget_class = $request['widget'];
141
+
142
+ global $wp_widget_factory;
143
+
144
+ $widget = ! empty( $wp_widget_factory->widgets[ $widget_class ] ) ? $wp_widget_factory->widgets[ $widget_class ] : false;
145
+
146
+ if ( ! empty( $widget ) && is_object( $widget ) && is_subclass_of( $widget, 'SiteOrigin_Widget' ) ) {
147
+ /* @var $widget SiteOrigin_Widget */
148
+ $widget->form( array() );
149
+ }
150
+
151
+ wp_die();
152
+ }
153
+
154
+ function update_widget_data( $content ) {
155
+
156
+ $content = preg_replace_callback(
157
+ '/\[siteorigin_widget_vc [^\]]*\]/',
158
+ array( $this, 'update_shortcode' ),
159
+ $content
160
+ );
161
+
162
+ return $content;
163
+ }
164
+
165
+ function update_shortcode( $shortcode ) {
166
+
167
+ preg_match(
168
+ '/so_widget_data="([^"]*)"/',
169
+ stripslashes( stripslashes( $shortcode[0] ) ),
170
+ $widget_json
171
+ );
172
+
173
+ // We double encode in the front end to prevent accidental decoding when the content is set on the
174
+ // WP visual editor.
175
+ $widget_json = html_entity_decode( html_entity_decode( $widget_json[1] ) );
176
+
177
+ $widget_atts = json_decode( $widget_json, true );
178
+
179
+ global $wp_widget_factory;
180
+
181
+ $widget = ! empty( $wp_widget_factory->widgets[ $widget_atts['widget_class'] ] ) ? $wp_widget_factory->widgets[ $widget_atts['widget_class'] ] : false;
182
+
183
+ if ( ! empty( $widget ) && is_object( $widget ) && is_subclass_of( $widget, 'SiteOrigin_Widget' ) ) {
184
+ /* @var $widget SiteOrigin_Widget */
185
+ $widget_atts['widget_data'] = $widget->update( $widget_atts['widget_data'], $widget_atts['widget_data'] );
186
+ }
187
+
188
+ $widget_json = json_encode( $widget_atts );
189
+
190
+ $widget_json = htmlentities( htmlentities( $widget_json ) );
191
+
192
+ $widget_json = str_replace(
193
+ array( '[', ']' ),
194
+ array( '&#91;', '&#93;' ),
195
+ $widget_json
196
+ );
197
+
198
+ $slashed = addslashes( 'so_widget_data="' . addslashes( $widget_json ) . '"' );
199
+
200
+ preg_replace( '/so_widget_data="([^"]*)"/', $slashed, $shortcode );
201
+
202
+ return '[siteorigin_widget_vc ' . $slashed . ']';
203
+ }
204
+ }
205
+
206
+ SiteOrigin_Widgets_Bundle_Visual_Composer::single();
207
+
208
+ if ( class_exists( 'WPBakeryShortCode' ) ) {
209
+ class WPBakeryShortCode_SiteOrigin_Widget_VC extends WPBakeryShortCode {
210
+ public function __construct( $settings ) {
211
+ parent::__construct( $settings );
212
+ }
213
+
214
+ public function contentInline( $atts, $content ) {
215
+ if ( empty( $atts ) ) {
216
+ return '';
217
+ }
218
+ $widget_settings = $this->get_widget_settings( $atts );
219
+ ob_start();
220
+ $instance = $this->update_widget( $widget_settings['widget_class'], $widget_settings['widget_data'] );
221
+ $this->render_widget( $widget_settings['widget_class'], $instance );
222
+
223
+ return ob_get_clean();
224
+ }
225
+
226
+ public function get_widget_settings( $atts ) {
227
+ if ( empty( $atts ) || empty( $atts['so_widget_data'] ) ) {
228
+ return array();
229
+ }
230
+ $unesc = $atts['so_widget_data'];
231
+ return json_decode( $unesc, true );
232
+ }
233
+
234
+ private function get_so_widget( $widget_class ) {
235
+ global $wp_widget_factory;
236
+
237
+ $widget = ! empty( $wp_widget_factory->widgets[ $widget_class ] ) ? $wp_widget_factory->widgets[ $widget_class ] : false;
238
+
239
+ if ( ! empty( $widget ) && is_object( $widget ) && is_subclass_of( $widget, 'SiteOrigin_Widget' ) ) {
240
+ /* @var $widget SiteOrigin_Widget */
241
+ return $widget;
242
+ } else {
243
+ return null;
244
+ }
245
+ }
246
+
247
+ public function render_widget( $widget_class, $widget_instance ) {
248
+
249
+ if ( empty( $widget_instance ) ) {
250
+ return;
251
+ }
252
+
253
+ /* @var $widget SiteOrigin_Widget */
254
+ $widget = $this->get_so_widget( $widget_class );
255
+
256
+ if ( ! empty( $widget ) ) {
257
+ $widget->widget( array(), $widget_instance );
258
+ }
259
+ }
260
+
261
+ public function update_widget( $widget_class, $widget_instance ) {
262
+
263
+ if ( empty( $widget_instance ) ) {
264
+ return;
265
+ }
266
+
267
+ /* @var $widget SiteOrigin_Widget */
268
+ $widget = $this->get_so_widget( $widget_class );
269
+
270
+ if ( ! empty( $widget ) ) {
271
+ return $widget->update( $widget_instance, $widget_instance );
272
+ } else {
273
+ return $widget_instance;
274
+ }
275
+ }
276
+
277
+ /**
278
+ * @param $atts
279
+ *
280
+ * @return array
281
+ */
282
+ protected function prepareAtts( $atts ) {
283
+ $return = array();
284
+ if ( is_array( $atts ) ) {
285
+ foreach ( $atts as $key => $val ) {
286
+ // We double encode in the front end to prevent accidental decoding when the content is set on the
287
+ // WP visual editor.
288
+ $return[ $key ] = html_entity_decode( html_entity_decode( $val ) );
289
+ }
290
+ }
291
+
292
+ return $return;
293
+ }
294
+ }
295
+ } // End Class
296
+
icons/fontawesome/filter.php CHANGED
@@ -1,1660 +1,1695 @@
1
- <?php
2
-
3
- function siteorigin_widgets_icons_fontawesome_filter( $icons ){
4
- return array_merge($icons, array(
5
- '500px' => array( 'unicode' => '&#xf26e;', 'styles' => array( 'sow-fab' ), ),
6
- 'accessible-icon' => array( 'unicode' => '&#xf368;', 'styles' => array( 'sow-fab' ), ),
7
- 'accusoft' => array( 'unicode' => '&#xf369;', 'styles' => array( 'sow-fab' ), ),
8
- 'acquisitions-incorporated' => array( 'unicode' => '&#xf6af;', 'styles' => array( 'sow-fab' ), ),
9
- 'ad' => array( 'unicode' => '&#xf641;', 'styles' => array( 'sow-fas' ), ),
10
- 'address-book' => array( 'unicode' => '&#xf2b9;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
11
- 'address-card' => array( 'unicode' => '&#xf2bb;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
12
- 'adjust' => array( 'unicode' => '&#xf042;', 'styles' => array( 'sow-fas' ), ),
13
- 'adn' => array( 'unicode' => '&#xf170;', 'styles' => array( 'sow-fab' ), ),
14
- 'adobe' => array( 'unicode' => '&#xf778;', 'styles' => array( 'sow-fab' ), ),
15
- 'adversal' => array( 'unicode' => '&#xf36a;', 'styles' => array( 'sow-fab' ), ),
16
- 'affiliatetheme' => array( 'unicode' => '&#xf36b;', 'styles' => array( 'sow-fab' ), ),
17
- 'air-freshener' => array( 'unicode' => '&#xf5d0;', 'styles' => array( 'sow-fas' ), ),
18
- 'algolia' => array( 'unicode' => '&#xf36c;', 'styles' => array( 'sow-fab' ), ),
19
- 'align-center' => array( 'unicode' => '&#xf037;', 'styles' => array( 'sow-fas' ), ),
20
- 'align-justify' => array( 'unicode' => '&#xf039;', 'styles' => array( 'sow-fas' ), ),
21
- 'align-left' => array( 'unicode' => '&#xf036;', 'styles' => array( 'sow-fas' ), ),
22
- 'align-right' => array( 'unicode' => '&#xf038;', 'styles' => array( 'sow-fas' ), ),
23
- 'alipay' => array( 'unicode' => '&#xf642;', 'styles' => array( 'sow-fab' ), ),
24
- 'allergies' => array( 'unicode' => '&#xf461;', 'styles' => array( 'sow-fas' ), ),
25
- 'amazon' => array( 'unicode' => '&#xf270;', 'styles' => array( 'sow-fab' ), ),
26
- 'amazon-pay' => array( 'unicode' => '&#xf42c;', 'styles' => array( 'sow-fab' ), ),
27
- 'ambulance' => array( 'unicode' => '&#xf0f9;', 'styles' => array( 'sow-fas' ), ),
28
- 'american-sign-language-interpreting' => array( 'unicode' => '&#xf2a3;', 'styles' => array( 'sow-fas' ), ),
29
- 'amilia' => array( 'unicode' => '&#xf36d;', 'styles' => array( 'sow-fab' ), ),
30
- 'anchor' => array( 'unicode' => '&#xf13d;', 'styles' => array( 'sow-fas' ), ),
31
- 'android' => array( 'unicode' => '&#xf17b;', 'styles' => array( 'sow-fab' ), ),
32
- 'angellist' => array( 'unicode' => '&#xf209;', 'styles' => array( 'sow-fab' ), ),
33
- 'angle-double-down' => array( 'unicode' => '&#xf103;', 'styles' => array( 'sow-fas' ), ),
34
- 'angle-double-left' => array( 'unicode' => '&#xf100;', 'styles' => array( 'sow-fas' ), ),
35
- 'angle-double-right' => array( 'unicode' => '&#xf101;', 'styles' => array( 'sow-fas' ), ),
36
- 'angle-double-up' => array( 'unicode' => '&#xf102;', 'styles' => array( 'sow-fas' ), ),
37
- 'angle-down' => array( 'unicode' => '&#xf107;', 'styles' => array( 'sow-fas' ), ),
38
- 'angle-left' => array( 'unicode' => '&#xf104;', 'styles' => array( 'sow-fas' ), ),
39
- 'angle-right' => array( 'unicode' => '&#xf105;', 'styles' => array( 'sow-fas' ), ),
40
- 'angle-up' => array( 'unicode' => '&#xf106;', 'styles' => array( 'sow-fas' ), ),
41
- 'angry' => array( 'unicode' => '&#xf556;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
42
- 'angrycreative' => array( 'unicode' => '&#xf36e;', 'styles' => array( 'sow-fab' ), ),
43
- 'angular' => array( 'unicode' => '&#xf420;', 'styles' => array( 'sow-fab' ), ),
44
- 'ankh' => array( 'unicode' => '&#xf644;', 'styles' => array( 'sow-fas' ), ),
45
- 'app-store' => array( 'unicode' => '&#xf36f;', 'styles' => array( 'sow-fab' ), ),
46
- 'app-store-ios' => array( 'unicode' => '&#xf370;', 'styles' => array( 'sow-fab' ), ),
47
- 'apper' => array( 'unicode' => '&#xf371;', 'styles' => array( 'sow-fab' ), ),
48
- 'apple' => array( 'unicode' => '&#xf179;', 'styles' => array( 'sow-fab' ), ),
49
- 'apple-alt' => array( 'unicode' => '&#xf5d1;', 'styles' => array( 'sow-fas' ), ),
50
- 'apple-pay' => array( 'unicode' => '&#xf415;', 'styles' => array( 'sow-fab' ), ),
51
- 'archive' => array( 'unicode' => '&#xf187;', 'styles' => array( 'sow-fas' ), ),
52
- 'archway' => array( 'unicode' => '&#xf557;', 'styles' => array( 'sow-fas' ), ),
53
- 'arrow-alt-circle-down' => array( 'unicode' => '&#xf358;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
54
- 'arrow-alt-circle-left' => array( 'unicode' => '&#xf359;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
55
- 'arrow-alt-circle-right' => array( 'unicode' => '&#xf35a;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
56
- 'arrow-alt-circle-up' => array( 'unicode' => '&#xf35b;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
57
- 'arrow-circle-down' => array( 'unicode' => '&#xf0ab;', 'styles' => array( 'sow-fas' ), ),
58
- 'arrow-circle-left' => array( 'unicode' => '&#xf0a8;', 'styles' => array( 'sow-fas' ), ),
59
- 'arrow-circle-right' => array( 'unicode' => '&#xf0a9;', 'styles' => array( 'sow-fas' ), ),
60
- 'arrow-circle-up' => array( 'unicode' => '&#xf0aa;', 'styles' => array( 'sow-fas' ), ),
61
- 'arrow-down' => array( 'unicode' => '&#xf063;', 'styles' => array( 'sow-fas' ), ),
62
- 'arrow-left' => array( 'unicode' => '&#xf060;', 'styles' => array( 'sow-fas' ), ),
63
- 'arrow-right' => array( 'unicode' => '&#xf061;', 'styles' => array( 'sow-fas' ), ),
64
- 'arrow-up' => array( 'unicode' => '&#xf062;', 'styles' => array( 'sow-fas' ), ),
65
- 'arrows-alt' => array( 'unicode' => '&#xf0b2;', 'styles' => array( 'sow-fas' ), ),
66
- 'arrows-alt-h' => array( 'unicode' => '&#xf337;', 'styles' => array( 'sow-fas' ), ),
67
- 'arrows-alt-v' => array( 'unicode' => '&#xf338;', 'styles' => array( 'sow-fas' ), ),
68
- 'artstation' => array( 'unicode' => '&#xf77a;', 'styles' => array( 'sow-fab' ), ),
69
- 'assistive-listening-systems' => array( 'unicode' => '&#xf2a2;', 'styles' => array( 'sow-fas' ), ),
70
- 'asterisk' => array( 'unicode' => '&#xf069;', 'styles' => array( 'sow-fas' ), ),
71
- 'asymmetrik' => array( 'unicode' => '&#xf372;', 'styles' => array( 'sow-fab' ), ),
72
- 'at' => array( 'unicode' => '&#xf1fa;', 'styles' => array( 'sow-fas' ), ),
73
- 'atlas' => array( 'unicode' => '&#xf558;', 'styles' => array( 'sow-fas' ), ),
74
- 'atlassian' => array( 'unicode' => '&#xf77b;', 'styles' => array( 'sow-fab' ), ),
75
- 'atom' => array( 'unicode' => '&#xf5d2;', 'styles' => array( 'sow-fas' ), ),
76
- 'audible' => array( 'unicode' => '&#xf373;', 'styles' => array( 'sow-fab' ), ),
77
- 'audio-description' => array( 'unicode' => '&#xf29e;', 'styles' => array( 'sow-fas' ), ),
78
- 'autoprefixer' => array( 'unicode' => '&#xf41c;', 'styles' => array( 'sow-fab' ), ),
79
- 'avianex' => array( 'unicode' => '&#xf374;', 'styles' => array( 'sow-fab' ), ),
80
- 'aviato' => array( 'unicode' => '&#xf421;', 'styles' => array( 'sow-fab' ), ),
81
- 'award' => array( 'unicode' => '&#xf559;', 'styles' => array( 'sow-fas' ), ),
82
- 'aws' => array( 'unicode' => '&#xf375;', 'styles' => array( 'sow-fab' ), ),
83
- 'baby' => array( 'unicode' => '&#xf77c;', 'styles' => array( 'sow-fas' ), ),
84
- 'baby-carriage' => array( 'unicode' => '&#xf77d;', 'styles' => array( 'sow-fas' ), ),
85
- 'backspace' => array( 'unicode' => '&#xf55a;', 'styles' => array( 'sow-fas' ), ),
86
- 'backward' => array( 'unicode' => '&#xf04a;', 'styles' => array( 'sow-fas' ), ),
87
- 'balance-scale' => array( 'unicode' => '&#xf24e;', 'styles' => array( 'sow-fas' ), ),
88
- 'ban' => array( 'unicode' => '&#xf05e;', 'styles' => array( 'sow-fas' ), ),
89
- 'band-aid' => array( 'unicode' => '&#xf462;', 'styles' => array( 'sow-fas' ), ),
90
- 'bandcamp' => array( 'unicode' => '&#xf2d5;', 'styles' => array( 'sow-fab' ), ),
91
- 'barcode' => array( 'unicode' => '&#xf02a;', 'styles' => array( 'sow-fas' ), ),
92
- 'bars' => array( 'unicode' => '&#xf0c9;', 'styles' => array( 'sow-fas' ), ),
93
- 'baseball-ball' => array( 'unicode' => '&#xf433;', 'styles' => array( 'sow-fas' ), ),
94
- 'basketball-ball' => array( 'unicode' => '&#xf434;', 'styles' => array( 'sow-fas' ), ),
95
- 'bath' => array( 'unicode' => '&#xf2cd;', 'styles' => array( 'sow-fas' ), ),
96
- 'battery-empty' => array( 'unicode' => '&#xf244;', 'styles' => array( 'sow-fas' ), ),
97
- 'battery-full' => array( 'unicode' => '&#xf240;', 'styles' => array( 'sow-fas' ), ),
98
- 'battery-half' => array( 'unicode' => '&#xf242;', 'styles' => array( 'sow-fas' ), ),
99
- 'battery-quarter' => array( 'unicode' => '&#xf243;', 'styles' => array( 'sow-fas' ), ),
100
- 'battery-three-quarters' => array( 'unicode' => '&#xf241;', 'styles' => array( 'sow-fas' ), ),
101
- 'bed' => array( 'unicode' => '&#xf236;', 'styles' => array( 'sow-fas' ), ),
102
- 'beer' => array( 'unicode' => '&#xf0fc;', 'styles' => array( 'sow-fas' ), ),
103
- 'behance' => array( 'unicode' => '&#xf1b4;', 'styles' => array( 'sow-fab' ), ),
104
- 'behance-square' => array( 'unicode' => '&#xf1b5;', 'styles' => array( 'sow-fab' ), ),
105
- 'bell' => array( 'unicode' => '&#xf0f3;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
106
- 'bell-slash' => array( 'unicode' => '&#xf1f6;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
107
- 'bezier-curve' => array( 'unicode' => '&#xf55b;', 'styles' => array( 'sow-fas' ), ),
108
- 'bible' => array( 'unicode' => '&#xf647;', 'styles' => array( 'sow-fas' ), ),
109
- 'bicycle' => array( 'unicode' => '&#xf206;', 'styles' => array( 'sow-fas' ), ),
110
- 'bimobject' => array( 'unicode' => '&#xf378;', 'styles' => array( 'sow-fab' ), ),
111
- 'binoculars' => array( 'unicode' => '&#xf1e5;', 'styles' => array( 'sow-fas' ), ),
112
- 'biohazard' => array( 'unicode' => '&#xf780;', 'styles' => array( 'sow-fas' ), ),
113
- 'birthday-cake' => array( 'unicode' => '&#xf1fd;', 'styles' => array( 'sow-fas' ), ),
114
- 'bitbucket' => array( 'unicode' => '&#xf171;', 'styles' => array( 'sow-fab' ), ),
115
- 'bitcoin' => array( 'unicode' => '&#xf379;', 'styles' => array( 'sow-fab' ), ),
116
- 'bity' => array( 'unicode' => '&#xf37a;', 'styles' => array( 'sow-fab' ), ),
117
- 'black-tie' => array( 'unicode' => '&#xf27e;', 'styles' => array( 'sow-fab' ), ),
118
- 'blackberry' => array( 'unicode' => '&#xf37b;', 'styles' => array( 'sow-fab' ), ),
119
- 'blender' => array( 'unicode' => '&#xf517;', 'styles' => array( 'sow-fas' ), ),
120
- 'blender-phone' => array( 'unicode' => '&#xf6b6;', 'styles' => array( 'sow-fas' ), ),
121
- 'blind' => array( 'unicode' => '&#xf29d;', 'styles' => array( 'sow-fas' ), ),
122
- 'blog' => array( 'unicode' => '&#xf781;', 'styles' => array( 'sow-fas' ), ),
123
- 'blogger' => array( 'unicode' => '&#xf37c;', 'styles' => array( 'sow-fab' ), ),
124
- 'blogger-b' => array( 'unicode' => '&#xf37d;', 'styles' => array( 'sow-fab' ), ),
125
- 'bluetooth' => array( 'unicode' => '&#xf293;', 'styles' => array( 'sow-fab' ), ),
126
- 'bluetooth-b' => array( 'unicode' => '&#xf294;', 'styles' => array( 'sow-fab' ), ),
127
- 'bold' => array( 'unicode' => '&#xf032;', 'styles' => array( 'sow-fas' ), ),
128
- 'bolt' => array( 'unicode' => '&#xf0e7;', 'styles' => array( 'sow-fas' ), ),
129
- 'bomb' => array( 'unicode' => '&#xf1e2;', 'styles' => array( 'sow-fas' ), ),
130
- 'bone' => array( 'unicode' => '&#xf5d7;', 'styles' => array( 'sow-fas' ), ),
131
- 'bong' => array( 'unicode' => '&#xf55c;', 'styles' => array( 'sow-fas' ), ),
132
- 'book' => array( 'unicode' => '&#xf02d;', 'styles' => array( 'sow-fas' ), ),
133
- 'book-dead' => array( 'unicode' => '&#xf6b7;', 'styles' => array( 'sow-fas' ), ),
134
- 'book-open' => array( 'unicode' => '&#xf518;', 'styles' => array( 'sow-fas' ), ),
135
- 'book-reader' => array( 'unicode' => '&#xf5da;', 'styles' => array( 'sow-fas' ), ),
136
- 'bookmark' => array( 'unicode' => '&#xf02e;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
137
- 'bowling-ball' => array( 'unicode' => '&#xf436;', 'styles' => array( 'sow-fas' ), ),
138
- 'box' => array( 'unicode' => '&#xf466;', 'styles' => array( 'sow-fas' ), ),
139
- 'box-open' => array( 'unicode' => '&#xf49e;', 'styles' => array( 'sow-fas' ), ),
140
- 'boxes' => array( 'unicode' => '&#xf468;', 'styles' => array( 'sow-fas' ), ),
141
- 'braille' => array( 'unicode' => '&#xf2a1;', 'styles' => array( 'sow-fas' ), ),
142
- 'brain' => array( 'unicode' => '&#xf5dc;', 'styles' => array( 'sow-fas' ), ),
143
- 'briefcase' => array( 'unicode' => '&#xf0b1;', 'styles' => array( 'sow-fas' ), ),
144
- 'briefcase-medical' => array( 'unicode' => '&#xf469;', 'styles' => array( 'sow-fas' ), ),
145
- 'broadcast-tower' => array( 'unicode' => '&#xf519;', 'styles' => array( 'sow-fas' ), ),
146
- 'broom' => array( 'unicode' => '&#xf51a;', 'styles' => array( 'sow-fas' ), ),
147
- 'brush' => array( 'unicode' => '&#xf55d;', 'styles' => array( 'sow-fas' ), ),
148
- 'btc' => array( 'unicode' => '&#xf15a;', 'styles' => array( 'sow-fab' ), ),
149
- 'bug' => array( 'unicode' => '&#xf188;', 'styles' => array( 'sow-fas' ), ),
150
- 'building' => array( 'unicode' => '&#xf1ad;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
151
- 'bullhorn' => array( 'unicode' => '&#xf0a1;', 'styles' => array( 'sow-fas' ), ),
152
- 'bullseye' => array( 'unicode' => '&#xf140;', 'styles' => array( 'sow-fas' ), ),
153
- 'burn' => array( 'unicode' => '&#xf46a;', 'styles' => array( 'sow-fas' ), ),
154
- 'buromobelexperte' => array( 'unicode' => '&#xf37f;', 'styles' => array( 'sow-fab' ), ),
155
- 'bus' => array( 'unicode' => '&#xf207;', 'styles' => array( 'sow-fas' ), ),
156
- 'bus-alt' => array( 'unicode' => '&#xf55e;', 'styles' => array( 'sow-fas' ), ),
157
- 'business-time' => array( 'unicode' => '&#xf64a;', 'styles' => array( 'sow-fas' ), ),
158
- 'buysellads' => array( 'unicode' => '&#xf20d;', 'styles' => array( 'sow-fab' ), ),
159
- 'calculator' => array( 'unicode' => '&#xf1ec;', 'styles' => array( 'sow-fas' ), ),
160
- 'calendar' => array( 'unicode' => '&#xf133;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
161
- 'calendar-alt' => array( 'unicode' => '&#xf073;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
162
- 'calendar-check' => array( 'unicode' => '&#xf274;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
163
- 'calendar-day' => array( 'unicode' => '&#xf783;', 'styles' => array( 'sow-fas' ), ),
164
- 'calendar-minus' => array( 'unicode' => '&#xf272;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
165
- 'calendar-plus' => array( 'unicode' => '&#xf271;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
166
- 'calendar-times' => array( 'unicode' => '&#xf273;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
167
- 'calendar-week' => array( 'unicode' => '&#xf784;', 'styles' => array( 'sow-fas' ), ),
168
- 'camera' => array( 'unicode' => '&#xf030;', 'styles' => array( 'sow-fas' ), ),
169
- 'camera-retro' => array( 'unicode' => '&#xf083;', 'styles' => array( 'sow-fas' ), ),
170
- 'campground' => array( 'unicode' => '&#xf6bb;', 'styles' => array( 'sow-fas' ), ),
171
- 'canadian-maple-leaf' => array( 'unicode' => '&#xf785;', 'styles' => array( 'sow-fab' ), ),
172
- 'candy-cane' => array( 'unicode' => '&#xf786;', 'styles' => array( 'sow-fas' ), ),
173
- 'cannabis' => array( 'unicode' => '&#xf55f;', 'styles' => array( 'sow-fas' ), ),
174
- 'capsules' => array( 'unicode' => '&#xf46b;', 'styles' => array( 'sow-fas' ), ),
175
- 'car' => array( 'unicode' => '&#xf1b9;', 'styles' => array( 'sow-fas' ), ),
176
- 'car-alt' => array( 'unicode' => '&#xf5de;', 'styles' => array( 'sow-fas' ), ),
177
- 'car-battery' => array( 'unicode' => '&#xf5df;', 'styles' => array( 'sow-fas' ), ),
178
- 'car-crash' => array( 'unicode' => '&#xf5e1;', 'styles' => array( 'sow-fas' ), ),
179
- 'car-side' => array( 'unicode' => '&#xf5e4;', 'styles' => array( 'sow-fas' ), ),
180
- 'caret-down' => array( 'unicode' => '&#xf0d7;', 'styles' => array( 'sow-fas' ), ),
181
- 'caret-left' => array( 'unicode' => '&#xf0d9;', 'styles' => array( 'sow-fas' ), ),
182
- 'caret-right' => array( 'unicode' => '&#xf0da;', 'styles' => array( 'sow-fas' ), ),
183
- 'caret-square-down' => array( 'unicode' => '&#xf150;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
184
- 'caret-square-left' => array( 'unicode' => '&#xf191;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
185
- 'caret-square-right' => array( 'unicode' => '&#xf152;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
186
- 'caret-square-up' => array( 'unicode' => '&#xf151;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
187
- 'caret-up' => array( 'unicode' => '&#xf0d8;', 'styles' => array( 'sow-fas' ), ),
188
- 'carrot' => array( 'unicode' => '&#xf787;', 'styles' => array( 'sow-fas' ), ),
189
- 'cart-arrow-down' => array( 'unicode' => '&#xf218;', 'styles' => array( 'sow-fas' ), ),
190
- 'cart-plus' => array( 'unicode' => '&#xf217;', 'styles' => array( 'sow-fas' ), ),
191
- 'cash-register' => array( 'unicode' => '&#xf788;', 'styles' => array( 'sow-fas' ), ),
192
- 'cat' => array( 'unicode' => '&#xf6be;', 'styles' => array( 'sow-fas' ), ),
193
- 'cc-amazon-pay' => array( 'unicode' => '&#xf42d;', 'styles' => array( 'sow-fab' ), ),
194
- 'cc-amex' => array( 'unicode' => '&#xf1f3;', 'styles' => array( 'sow-fab' ), ),
195
- 'cc-apple-pay' => array( 'unicode' => '&#xf416;', 'styles' => array( 'sow-fab' ), ),
196
- 'cc-diners-club' => array( 'unicode' => '&#xf24c;', 'styles' => array( 'sow-fab' ), ),
197
- 'cc-discover' => array( 'unicode' => '&#xf1f2;', 'styles' => array( 'sow-fab' ), ),
198
- 'cc-jcb' => array( 'unicode' => '&#xf24b;', 'styles' => array( 'sow-fab' ), ),
199
- 'cc-mastercard' => array( 'unicode' => '&#xf1f1;', 'styles' => array( 'sow-fab' ), ),
200
- 'cc-paypal' => array( 'unicode' => '&#xf1f4;', 'styles' => array( 'sow-fab' ), ),
201
- 'cc-stripe' => array( 'unicode' => '&#xf1f5;', 'styles' => array( 'sow-fab' ), ),
202
- 'cc-visa' => array( 'unicode' => '&#xf1f0;', 'styles' => array( 'sow-fab' ), ),
203
- 'centercode' => array( 'unicode' => '&#xf380;', 'styles' => array( 'sow-fab' ), ),
204
- 'centos' => array( 'unicode' => '&#xf789;', 'styles' => array( 'sow-fab' ), ),
205
- 'certificate' => array( 'unicode' => '&#xf0a3;', 'styles' => array( 'sow-fas' ), ),
206
- 'chair' => array( 'unicode' => '&#xf6c0;', 'styles' => array( 'sow-fas' ), ),
207
- 'chalkboard' => array( 'unicode' => '&#xf51b;', 'styles' => array( 'sow-fas' ), ),
208
- 'chalkboard-teacher' => array( 'unicode' => '&#xf51c;', 'styles' => array( 'sow-fas' ), ),
209
- 'charging-station' => array( 'unicode' => '&#xf5e7;', 'styles' => array( 'sow-fas' ), ),
210
- 'chart-area' => array( 'unicode' => '&#xf1fe;', 'styles' => array( 'sow-fas' ), ),
211
- 'chart-bar' => array( 'unicode' => '&#xf080;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
212
- 'chart-line' => array( 'unicode' => '&#xf201;', 'styles' => array( 'sow-fas' ), ),
213
- 'chart-pie' => array( 'unicode' => '&#xf200;', 'styles' => array( 'sow-fas' ), ),
214
- 'check' => array( 'unicode' => '&#xf00c;', 'styles' => array( 'sow-fas' ), ),
215
- 'check-circle' => array( 'unicode' => '&#xf058;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
216
- 'check-double' => array( 'unicode' => '&#xf560;', 'styles' => array( 'sow-fas' ), ),
217
- 'check-square' => array( 'unicode' => '&#xf14a;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
218
- 'chess' => array( 'unicode' => '&#xf439;', 'styles' => array( 'sow-fas' ), ),
219
- 'chess-bishop' => array( 'unicode' => '&#xf43a;', 'styles' => array( 'sow-fas' ), ),
220
- 'chess-board' => array( 'unicode' => '&#xf43c;', 'styles' => array( 'sow-fas' ), ),
221
- 'chess-king' => array( 'unicode' => '&#xf43f;', 'styles' => array( 'sow-fas' ), ),
222
- 'chess-knight' => array( 'unicode' => '&#xf441;', 'styles' => array( 'sow-fas' ), ),
223
- 'chess-pawn' => array( 'unicode' => '&#xf443;', 'styles' => array( 'sow-fas' ), ),
224
- 'chess-queen' => array( 'unicode' => '&#xf445;', 'styles' => array( 'sow-fas' ), ),
225
- 'chess-rook' => array( 'unicode' => '&#xf447;', 'styles' => array( 'sow-fas' ), ),
226
- 'chevron-circle-down' => array( 'unicode' => '&#xf13a;', 'styles' => array( 'sow-fas' ), ),
227
- 'chevron-circle-left' => array( 'unicode' => '&#xf137;', 'styles' => array( 'sow-fas' ), ),
228
- 'chevron-circle-right' => array( 'unicode' => '&#xf138;', 'styles' => array( 'sow-fas' ), ),
229
- 'chevron-circle-up' => array( 'unicode' => '&#xf139;', 'styles' => array( 'sow-fas' ), ),
230
- 'chevron-down' => array( 'unicode' => '&#xf078;', 'styles' => array( 'sow-fas' ), ),
231
- 'chevron-left' => array( 'unicode' => '&#xf053;', 'styles' => array( 'sow-fas' ), ),
232
- 'chevron-right' => array( 'unicode' => '&#xf054;', 'styles' => array( 'sow-fas' ), ),
233
- 'chevron-up' => array( 'unicode' => '&#xf077;', 'styles' => array( 'sow-fas' ), ),
234
- 'child' => array( 'unicode' => '&#xf1ae;', 'styles' => array( 'sow-fas' ), ),
235
- 'chrome' => array( 'unicode' => '&#xf268;', 'styles' => array( 'sow-fab' ), ),
236
- 'church' => array( 'unicode' => '&#xf51d;', 'styles' => array( 'sow-fas' ), ),
237
- 'circle' => array( 'unicode' => '&#xf111;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
238
- 'circle-notch' => array( 'unicode' => '&#xf1ce;', 'styles' => array( 'sow-fas' ), ),
239
- 'city' => array( 'unicode' => '&#xf64f;', 'styles' => array( 'sow-fas' ), ),
240
- 'clipboard' => array( 'unicode' => '&#xf328;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
241
- 'clipboard-check' => array( 'unicode' => '&#xf46c;', 'styles' => array( 'sow-fas' ), ),
242
- 'clipboard-list' => array( 'unicode' => '&#xf46d;', 'styles' => array( 'sow-fas' ), ),
243
- 'clock' => array( 'unicode' => '&#xf017;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
244
- 'clone' => array( 'unicode' => '&#xf24d;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
245
- 'closed-captioning' => array( 'unicode' => '&#xf20a;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
246
- 'cloud' => array( 'unicode' => '&#xf0c2;', 'styles' => array( 'sow-fas' ), ),
247
- 'cloud-download-alt' => array( 'unicode' => '&#xf381;', 'styles' => array( 'sow-fas' ), ),
248
- 'cloud-meatball' => array( 'unicode' => '&#xf73b;', 'styles' => array( 'sow-fas' ), ),
249
- 'cloud-moon' => array( 'unicode' => '&#xf6c3;', 'styles' => array( 'sow-fas' ), ),
250
- 'cloud-moon-rain' => array( 'unicode' => '&#xf73c;', 'styles' => array( 'sow-fas' ), ),
251
- 'cloud-rain' => array( 'unicode' => '&#xf73d;', 'styles' => array( 'sow-fas' ), ),
252
- 'cloud-showers-heavy' => array( 'unicode' => '&#xf740;', 'styles' => array( 'sow-fas' ), ),
253
- 'cloud-sun' => array( 'unicode' => '&#xf6c4;', 'styles' => array( 'sow-fas' ), ),
254
- 'cloud-sun-rain' => array( 'unicode' => '&#xf743;', 'styles' => array( 'sow-fas' ), ),
255
- 'cloud-upload-alt' => array( 'unicode' => '&#xf382;', 'styles' => array( 'sow-fas' ), ),
256
- 'cloudscale' => array( 'unicode' => '&#xf383;', 'styles' => array( 'sow-fab' ), ),
257
- 'cloudsmith' => array( 'unicode' => '&#xf384;', 'styles' => array( 'sow-fab' ), ),
258
- 'cloudversify' => array( 'unicode' => '&#xf385;', 'styles' => array( 'sow-fab' ), ),
259
- 'cocktail' => array( 'unicode' => '&#xf561;', 'styles' => array( 'sow-fas' ), ),
260
- 'code' => array( 'unicode' => '&#xf121;', 'styles' => array( 'sow-fas' ), ),
261
- 'code-branch' => array( 'unicode' => '&#xf126;', 'styles' => array( 'sow-fas' ), ),
262
- 'codepen' => array( 'unicode' => '&#xf1cb;', 'styles' => array( 'sow-fab' ), ),
263
- 'codiepie' => array( 'unicode' => '&#xf284;', 'styles' => array( 'sow-fab' ), ),
264
- 'coffee' => array( 'unicode' => '&#xf0f4;', 'styles' => array( 'sow-fas' ), ),
265
- 'cog' => array( 'unicode' => '&#xf013;', 'styles' => array( 'sow-fas' ), ),
266
- 'cogs' => array( 'unicode' => '&#xf085;', 'styles' => array( 'sow-fas' ), ),
267
- 'coins' => array( 'unicode' => '&#xf51e;', 'styles' => array( 'sow-fas' ), ),
268
- 'columns' => array( 'unicode' => '&#xf0db;', 'styles' => array( 'sow-fas' ), ),
269
- 'comment' => array( 'unicode' => '&#xf075;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
270
- 'comment-alt' => array( 'unicode' => '&#xf27a;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
271
- 'comment-dollar' => array( 'unicode' => '&#xf651;', 'styles' => array( 'sow-fas' ), ),
272
- 'comment-dots' => array( 'unicode' => '&#xf4ad;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
273
- 'comment-slash' => array( 'unicode' => '&#xf4b3;', 'styles' => array( 'sow-fas' ), ),
274
- 'comments' => array( 'unicode' => '&#xf086;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
275
- 'comments-dollar' => array( 'unicode' => '&#xf653;', 'styles' => array( 'sow-fas' ), ),
276
- 'compact-disc' => array( 'unicode' => '&#xf51f;', 'styles' => array( 'sow-fas' ), ),
277
- 'compass' => array( 'unicode' => '&#xf14e;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
278
- 'compress' => array( 'unicode' => '&#xf066;', 'styles' => array( 'sow-fas' ), ),
279
- 'compress-arrows-alt' => array( 'unicode' => '&#xf78c;', 'styles' => array( 'sow-fas' ), ),
280
- 'concierge-bell' => array( 'unicode' => '&#xf562;', 'styles' => array( 'sow-fas' ), ),
281
- 'confluence' => array( 'unicode' => '&#xf78d;', 'styles' => array( 'sow-fab' ), ),
282
- 'connectdevelop' => array( 'unicode' => '&#xf20e;', 'styles' => array( 'sow-fab' ), ),
283
- 'contao' => array( 'unicode' => '&#xf26d;', 'styles' => array( 'sow-fab' ), ),
284
- 'cookie' => array( 'unicode' => '&#xf563;', 'styles' => array( 'sow-fas' ), ),
285
- 'cookie-bite' => array( 'unicode' => '&#xf564;', 'styles' => array( 'sow-fas' ), ),
286
- 'copy' => array( 'unicode' => '&#xf0c5;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
287
- 'copyright' => array( 'unicode' => '&#xf1f9;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
288
- 'couch' => array( 'unicode' => '&#xf4b8;', 'styles' => array( 'sow-fas' ), ),
289
- 'cpanel' => array( 'unicode' => '&#xf388;', 'styles' => array( 'sow-fab' ), ),
290
- 'creative-commons' => array( 'unicode' => '&#xf25e;', 'styles' => array( 'sow-fab' ), ),
291
- 'creative-commons-by' => array( 'unicode' => '&#xf4e7;', 'styles' => array( 'sow-fab' ), ),
292
- 'creative-commons-nc' => array( 'unicode' => '&#xf4e8;', 'styles' => array( 'sow-fab' ), ),
293
- 'creative-commons-nc-eu' => array( 'unicode' => '&#xf4e9;', 'styles' => array( 'sow-fab' ), ),
294
- 'creative-commons-nc-jp' => array( 'unicode' => '&#xf4ea;', 'styles' => array( 'sow-fab' ), ),
295
- 'creative-commons-nd' => array( 'unicode' => '&#xf4eb;', 'styles' => array( 'sow-fab' ), ),
296
- 'creative-commons-pd' => array( 'unicode' => '&#xf4ec;', 'styles' => array( 'sow-fab' ), ),
297
- 'creative-commons-pd-alt' => array( 'unicode' => '&#xf4ed;', 'styles' => array( 'sow-fab' ), ),
298
- 'creative-commons-remix' => array( 'unicode' => '&#xf4ee;', 'styles' => array( 'sow-fab' ), ),
299
- 'creative-commons-sa' => array( 'unicode' => '&#xf4ef;', 'styles' => array( 'sow-fab' ), ),
300
- 'creative-commons-sampling' => array( 'unicode' => '&#xf4f0;', 'styles' => array( 'sow-fab' ), ),
301
- 'creative-commons-sampling-plus' => array( 'unicode' => '&#xf4f1;', 'styles' => array( 'sow-fab' ), ),
302
- 'creative-commons-share' => array( 'unicode' => '&#xf4f2;', 'styles' => array( 'sow-fab' ), ),
303
- 'creative-commons-zero' => array( 'unicode' => '&#xf4f3;', 'styles' => array( 'sow-fab' ), ),
304
- 'credit-card' => array( 'unicode' => '&#xf09d;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
305
- 'critical-role' => array( 'unicode' => '&#xf6c9;', 'styles' => array( 'sow-fab' ), ),
306
- 'crop' => array( 'unicode' => '&#xf125;', 'styles' => array( 'sow-fas' ), ),
307
- 'crop-alt' => array( 'unicode' => '&#xf565;', 'styles' => array( 'sow-fas' ), ),
308
- 'cross' => array( 'unicode' => '&#xf654;', 'styles' => array( 'sow-fas' ), ),
309
- 'crosshairs' => array( 'unicode' => '&#xf05b;', 'styles' => array( 'sow-fas' ), ),
310
- 'crow' => array( 'unicode' => '&#xf520;', 'styles' => array( 'sow-fas' ), ),
311
- 'crown' => array( 'unicode' => '&#xf521;', 'styles' => array( 'sow-fas' ), ),
312
- 'css3' => array( 'unicode' => '&#xf13c;', 'styles' => array( 'sow-fab' ), ),
313
- 'css3-alt' => array( 'unicode' => '&#xf38b;', 'styles' => array( 'sow-fab' ), ),
314
- 'cube' => array( 'unicode' => '&#xf1b2;', 'styles' => array( 'sow-fas' ), ),
315
- 'cubes' => array( 'unicode' => '&#xf1b3;', 'styles' => array( 'sow-fas' ), ),
316
- 'cut' => array( 'unicode' => '&#xf0c4;', 'styles' => array( 'sow-fas' ), ),
317
- 'cuttlefish' => array( 'unicode' => '&#xf38c;', 'styles' => array( 'sow-fab' ), ),
318
- 'd-and-d' => array( 'unicode' => '&#xf38d;', 'styles' => array( 'sow-fab' ), ),
319
- 'd-and-d-beyond' => array( 'unicode' => '&#xf6ca;', 'styles' => array( 'sow-fab' ), ),
320
- 'dashcube' => array( 'unicode' => '&#xf210;', 'styles' => array( 'sow-fab' ), ),
321
- 'database' => array( 'unicode' => '&#xf1c0;', 'styles' => array( 'sow-fas' ), ),
322
- 'deaf' => array( 'unicode' => '&#xf2a4;', 'styles' => array( 'sow-fas' ), ),
323
- 'delicious' => array( 'unicode' => '&#xf1a5;', 'styles' => array( 'sow-fab' ), ),
324
- 'democrat' => array( 'unicode' => '&#xf747;', 'styles' => array( 'sow-fas' ), ),
325
- 'deploydog' => array( 'unicode' => '&#xf38e;', 'styles' => array( 'sow-fab' ), ),
326
- 'deskpro' => array( 'unicode' => '&#xf38f;', 'styles' => array( 'sow-fab' ), ),
327
- 'desktop' => array( 'unicode' => '&#xf108;', 'styles' => array( 'sow-fas' ), ),
328
- 'dev' => array( 'unicode' => '&#xf6cc;', 'styles' => array( 'sow-fab' ), ),
329
- 'deviantart' => array( 'unicode' => '&#xf1bd;', 'styles' => array( 'sow-fab' ), ),
330
- 'dharmachakra' => array( 'unicode' => '&#xf655;', 'styles' => array( 'sow-fas' ), ),
331
- 'dhl' => array( 'unicode' => '&#xf790;', 'styles' => array( 'sow-fab' ), ),
332
- 'diagnoses' => array( 'unicode' => '&#xf470;', 'styles' => array( 'sow-fas' ), ),
333
- 'diaspora' => array( 'unicode' => '&#xf791;', 'styles' => array( 'sow-fab' ), ),
334
- 'dice' => array( 'unicode' => '&#xf522;', 'styles' => array( 'sow-fas' ), ),
335
- 'dice-d20' => array( 'unicode' => '&#xf6cf;', 'styles' => array( 'sow-fas' ), ),
336
- 'dice-d6' => array( 'unicode' => '&#xf6d1;', 'styles' => array( 'sow-fas' ), ),
337
- 'dice-five' => array( 'unicode' => '&#xf523;', 'styles' => array( 'sow-fas' ), ),
338
- 'dice-four' => array( 'unicode' => '&#xf524;', 'styles' => array( 'sow-fas' ), ),
339
- 'dice-one' => array( 'unicode' => '&#xf525;', 'styles' => array( 'sow-fas' ), ),
340
- 'dice-six' => array( 'unicode' => '&#xf526;', 'styles' => array( 'sow-fas' ), ),
341
- 'dice-three' => array( 'unicode' => '&#xf527;', 'styles' => array( 'sow-fas' ), ),
342
- 'dice-two' => array( 'unicode' => '&#xf528;', 'styles' => array( 'sow-fas' ), ),
343
- 'digg' => array( 'unicode' => '&#xf1a6;', 'styles' => array( 'sow-fab' ), ),
344
- 'digital-ocean' => array( 'unicode' => '&#xf391;', 'styles' => array( 'sow-fab' ), ),
345
- 'digital-tachograph' => array( 'unicode' => '&#xf566;', 'styles' => array( 'sow-fas' ), ),
346
- 'directions' => array( 'unicode' => '&#xf5eb;', 'styles' => array( 'sow-fas' ), ),
347
- 'discord' => array( 'unicode' => '&#xf392;', 'styles' => array( 'sow-fab' ), ),
348
- 'discourse' => array( 'unicode' => '&#xf393;', 'styles' => array( 'sow-fab' ), ),
349
- 'divide' => array( 'unicode' => '&#xf529;', 'styles' => array( 'sow-fas' ), ),
350
- 'dizzy' => array( 'unicode' => '&#xf567;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
351
- 'dna' => array( 'unicode' => '&#xf471;', 'styles' => array( 'sow-fas' ), ),
352
- 'dochub' => array( 'unicode' => '&#xf394;', 'styles' => array( 'sow-fab' ), ),
353
- 'docker' => array( 'unicode' => '&#xf395;', 'styles' => array( 'sow-fab' ), ),
354
- 'dog' => array( 'unicode' => '&#xf6d3;', 'styles' => array( 'sow-fas' ), ),
355
- 'dollar-sign' => array( 'unicode' => '&#xf155;', 'styles' => array( 'sow-fas' ), ),
356
- 'dolly' => array( 'unicode' => '&#xf472;', 'styles' => array( 'sow-fas' ), ),
357
- 'dolly-flatbed' => array( 'unicode' => '&#xf474;', 'styles' => array( 'sow-fas' ), ),
358
- 'donate' => array( 'unicode' => '&#xf4b9;', 'styles' => array( 'sow-fas' ), ),
359
- 'door-closed' => array( 'unicode' => '&#xf52a;', 'styles' => array( 'sow-fas' ), ),
360
- 'door-open' => array( 'unicode' => '&#xf52b;', 'styles' => array( 'sow-fas' ), ),
361
- 'dot-circle' => array( 'unicode' => '&#xf192;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
362
- 'dove' => array( 'unicode' => '&#xf4ba;', 'styles' => array( 'sow-fas' ), ),
363
- 'download' => array( 'unicode' => '&#xf019;', 'styles' => array( 'sow-fas' ), ),
364
- 'draft2digital' => array( 'unicode' => '&#xf396;', 'styles' => array( 'sow-fab' ), ),
365
- 'drafting-compass' => array( 'unicode' => '&#xf568;', 'styles' => array( 'sow-fas' ), ),
366
- 'dragon' => array( 'unicode' => '&#xf6d5;', 'styles' => array( 'sow-fas' ), ),
367
- 'draw-polygon' => array( 'unicode' => '&#xf5ee;', 'styles' => array( 'sow-fas' ), ),
368
- 'dribbble' => array( 'unicode' => '&#xf17d;', 'styles' => array( 'sow-fab' ), ),
369
- 'dribbble-square' => array( 'unicode' => '&#xf397;', 'styles' => array( 'sow-fab' ), ),
370
- 'dropbox' => array( 'unicode' => '&#xf16b;', 'styles' => array( 'sow-fab' ), ),
371
- 'drum' => array( 'unicode' => '&#xf569;', 'styles' => array( 'sow-fas' ), ),
372
- 'drum-steelpan' => array( 'unicode' => '&#xf56a;', 'styles' => array( 'sow-fas' ), ),
373
- 'drumstick-bite' => array( 'unicode' => '&#xf6d7;', 'styles' => array( 'sow-fas' ), ),
374
- 'drupal' => array( 'unicode' => '&#xf1a9;', 'styles' => array( 'sow-fab' ), ),
375
- 'dumbbell' => array( 'unicode' => '&#xf44b;', 'styles' => array( 'sow-fas' ), ),
376
- 'dumpster' => array( 'unicode' => '&#xf793;', 'styles' => array( 'sow-fas' ), ),
377
- 'dumpster-fire' => array( 'unicode' => '&#xf794;', 'styles' => array( 'sow-fas' ), ),
378
- 'dungeon' => array( 'unicode' => '&#xf6d9;', 'styles' => array( 'sow-fas' ), ),
379
- 'dyalog' => array( 'unicode' => '&#xf399;', 'styles' => array( 'sow-fab' ), ),
380
- 'earlybirds' => array( 'unicode' => '&#xf39a;', 'styles' => array( 'sow-fab' ), ),
381
- 'ebay' => array( 'unicode' => '&#xf4f4;', 'styles' => array( 'sow-fab' ), ),
382
- 'edge' => array( 'unicode' => '&#xf282;', 'styles' => array( 'sow-fab' ), ),
383
- 'edit' => array( 'unicode' => '&#xf044;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
384
- 'eject' => array( 'unicode' => '&#xf052;', 'styles' => array( 'sow-fas' ), ),
385
- 'elementor' => array( 'unicode' => '&#xf430;', 'styles' => array( 'sow-fab' ), ),
386
- 'ellipsis-h' => array( 'unicode' => '&#xf141;', 'styles' => array( 'sow-fas' ), ),
387
- 'ellipsis-v' => array( 'unicode' => '&#xf142;', 'styles' => array( 'sow-fas' ), ),
388
- 'ello' => array( 'unicode' => '&#xf5f1;', 'styles' => array( 'sow-fab' ), ),
389
- 'ember' => array( 'unicode' => '&#xf423;', 'styles' => array( 'sow-fab' ), ),
390
- 'empire' => array( 'unicode' => '&#xf1d1;', 'styles' => array( 'sow-fab' ), ),
391
- 'envelope' => array( 'unicode' => '&#xf0e0;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
392
- 'envelope-open' => array( 'unicode' => '&#xf2b6;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
393
- 'envelope-open-text' => array( 'unicode' => '&#xf658;', 'styles' => array( 'sow-fas' ), ),
394
- 'envelope-square' => array( 'unicode' => '&#xf199;', 'styles' => array( 'sow-fas' ), ),
395
- 'envira' => array( 'unicode' => '&#xf299;', 'styles' => array( 'sow-fab' ), ),
396
- 'equals' => array( 'unicode' => '&#xf52c;', 'styles' => array( 'sow-fas' ), ),
397
- 'eraser' => array( 'unicode' => '&#xf12d;', 'styles' => array( 'sow-fas' ), ),
398
- 'erlang' => array( 'unicode' => '&#xf39d;', 'styles' => array( 'sow-fab' ), ),
399
- 'ethereum' => array( 'unicode' => '&#xf42e;', 'styles' => array( 'sow-fab' ), ),
400
- 'ethernet' => array( 'unicode' => '&#xf796;', 'styles' => array( 'sow-fas' ), ),
401
- 'etsy' => array( 'unicode' => '&#xf2d7;', 'styles' => array( 'sow-fab' ), ),
402
- 'euro-sign' => array( 'unicode' => '&#xf153;', 'styles' => array( 'sow-fas' ), ),
403
- 'exchange-alt' => array( 'unicode' => '&#xf362;', 'styles' => array( 'sow-fas' ), ),
404
- 'exclamation' => array( 'unicode' => '&#xf12a;', 'styles' => array( 'sow-fas' ), ),
405
- 'exclamation-circle' => array( 'unicode' => '&#xf06a;', 'styles' => array( 'sow-fas' ), ),
406
- 'exclamation-triangle' => array( 'unicode' => '&#xf071;', 'styles' => array( 'sow-fas' ), ),
407
- 'expand' => array( 'unicode' => '&#xf065;', 'styles' => array( 'sow-fas' ), ),
408
- 'expand-arrows-alt' => array( 'unicode' => '&#xf31e;', 'styles' => array( 'sow-fas' ), ),
409
- 'expeditedssl' => array( 'unicode' => '&#xf23e;', 'styles' => array( 'sow-fab' ), ),
410
- 'external-link-alt' => array( 'unicode' => '&#xf35d;', 'styles' => array( 'sow-fas' ), ),
411
- 'external-link-square-alt' => array( 'unicode' => '&#xf360;', 'styles' => array( 'sow-fas' ), ),
412
- 'eye' => array( 'unicode' => '&#xf06e;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
413
- 'eye-dropper' => array( 'unicode' => '&#xf1fb;', 'styles' => array( 'sow-fas' ), ),
414
- 'eye-slash' => array( 'unicode' => '&#xf070;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
415
- 'facebook' => array( 'unicode' => '&#xf09a;', 'styles' => array( 'sow-fab' ), ),
416
- 'facebook-f' => array( 'unicode' => '&#xf39e;', 'styles' => array( 'sow-fab' ), ),
417
- 'facebook-messenger' => array( 'unicode' => '&#xf39f;', 'styles' => array( 'sow-fab' ), ),
418
- 'facebook-square' => array( 'unicode' => '&#xf082;', 'styles' => array( 'sow-fab' ), ),
419
- 'fantasy-flight-games' => array( 'unicode' => '&#xf6dc;', 'styles' => array( 'sow-fab' ), ),
420
- 'fast-backward' => array( 'unicode' => '&#xf049;', 'styles' => array( 'sow-fas' ), ),
421
- 'fast-forward' => array( 'unicode' => '&#xf050;', 'styles' => array( 'sow-fas' ), ),
422
- 'fax' => array( 'unicode' => '&#xf1ac;', 'styles' => array( 'sow-fas' ), ),
423
- 'feather' => array( 'unicode' => '&#xf52d;', 'styles' => array( 'sow-fas' ), ),
424
- 'feather-alt' => array( 'unicode' => '&#xf56b;', 'styles' => array( 'sow-fas' ), ),
425
- 'fedex' => array( 'unicode' => '&#xf797;', 'styles' => array( 'sow-fab' ), ),
426
- 'fedora' => array( 'unicode' => '&#xf798;', 'styles' => array( 'sow-fab' ), ),
427
- 'female' => array( 'unicode' => '&#xf182;', 'styles' => array( 'sow-fas' ), ),
428
- 'fighter-jet' => array( 'unicode' => '&#xf0fb;', 'styles' => array( 'sow-fas' ), ),
429
- 'figma' => array( 'unicode' => '&#xf799;', 'styles' => array( 'sow-fab' ), ),
430
- 'file' => array( 'unicode' => '&#xf15b;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
431
- 'file-alt' => array( 'unicode' => '&#xf15c;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
432
- 'file-archive' => array( 'unicode' => '&#xf1c6;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
433
- 'file-audio' => array( 'unicode' => '&#xf1c7;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
434
- 'file-code' => array( 'unicode' => '&#xf1c9;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
435
- 'file-contract' => array( 'unicode' => '&#xf56c;', 'styles' => array( 'sow-fas' ), ),
436
- 'file-csv' => array( 'unicode' => '&#xf6dd;', 'styles' => array( 'sow-fas' ), ),
437
- 'file-download' => array( 'unicode' => '&#xf56d;', 'styles' => array( 'sow-fas' ), ),
438
- 'file-excel' => array( 'unicode' => '&#xf1c3;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
439
- 'file-export' => array( 'unicode' => '&#xf56e;', 'styles' => array( 'sow-fas' ), ),
440
- 'file-image' => array( 'unicode' => '&#xf1c5;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
441
- 'file-import' => array( 'unicode' => '&#xf56f;', 'styles' => array( 'sow-fas' ), ),
442
- 'file-invoice' => array( 'unicode' => '&#xf570;', 'styles' => array( 'sow-fas' ), ),
443
- 'file-invoice-dollar' => array( 'unicode' => '&#xf571;', 'styles' => array( 'sow-fas' ), ),
444
- 'file-medical' => array( 'unicode' => '&#xf477;', 'styles' => array( 'sow-fas' ), ),
445
- 'file-medical-alt' => array( 'unicode' => '&#xf478;', 'styles' => array( 'sow-fas' ), ),
446
- 'file-pdf' => array( 'unicode' => '&#xf1c1;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
447
- 'file-powerpoint' => array( 'unicode' => '&#xf1c4;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
448
- 'file-prescription' => array( 'unicode' => '&#xf572;', 'styles' => array( 'sow-fas' ), ),
449
- 'file-signature' => array( 'unicode' => '&#xf573;', 'styles' => array( 'sow-fas' ), ),
450
- 'file-upload' => array( 'unicode' => '&#xf574;', 'styles' => array( 'sow-fas' ), ),
451
- 'file-video' => array( 'unicode' => '&#xf1c8;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
452
- 'file-word' => array( 'unicode' => '&#xf1c2;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
453
- 'fill' => array( 'unicode' => '&#xf575;', 'styles' => array( 'sow-fas' ), ),
454
- 'fill-drip' => array( 'unicode' => '&#xf576;', 'styles' => array( 'sow-fas' ), ),
455
- 'film' => array( 'unicode' => '&#xf008;', 'styles' => array( 'sow-fas' ), ),
456
- 'filter' => array( 'unicode' => '&#xf0b0;', 'styles' => array( 'sow-fas' ), ),
457
- 'fingerprint' => array( 'unicode' => '&#xf577;', 'styles' => array( 'sow-fas' ), ),
458
- 'fire' => array( 'unicode' => '&#xf06d;', 'styles' => array( 'sow-fas' ), ),
459
- 'fire-alt' => array( 'unicode' => '&#xf7e4;', 'styles' => array( 'sow-fas' ), ),
460
- 'fire-extinguisher' => array( 'unicode' => '&#xf134;', 'styles' => array( 'sow-fas' ), ),
461
- 'firefox' => array( 'unicode' => '&#xf269;', 'styles' => array( 'sow-fab' ), ),
462
- 'first-aid' => array( 'unicode' => '&#xf479;', 'styles' => array( 'sow-fas' ), ),
463
- 'first-order' => array( 'unicode' => '&#xf2b0;', 'styles' => array( 'sow-fab' ), ),
464
- 'first-order-alt' => array( 'unicode' => '&#xf50a;', 'styles' => array( 'sow-fab' ), ),
465
- 'firstdraft' => array( 'unicode' => '&#xf3a1;', 'styles' => array( 'sow-fab' ), ),
466
- 'fish' => array( 'unicode' => '&#xf578;', 'styles' => array( 'sow-fas' ), ),
467
- 'fist-raised' => array( 'unicode' => '&#xf6de;', 'styles' => array( 'sow-fas' ), ),
468
- 'flag' => array( 'unicode' => '&#xf024;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
469
- 'flag-checkered' => array( 'unicode' => '&#xf11e;', 'styles' => array( 'sow-fas' ), ),
470
- 'flag-usa' => array( 'unicode' => '&#xf74d;', 'styles' => array( 'sow-fas' ), ),
471
- 'flask' => array( 'unicode' => '&#xf0c3;', 'styles' => array( 'sow-fas' ), ),
472
- 'flickr' => array( 'unicode' => '&#xf16e;', 'styles' => array( 'sow-fab' ), ),
473
- 'flipboard' => array( 'unicode' => '&#xf44d;', 'styles' => array( 'sow-fab' ), ),
474
- 'flushed' => array( 'unicode' => '&#xf579;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
475
- 'fly' => array( 'unicode' => '&#xf417;', 'styles' => array( 'sow-fab' ), ),
476
- 'folder' => array( 'unicode' => '&#xf07b;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
477
- 'folder-minus' => array( 'unicode' => '&#xf65d;', 'styles' => array( 'sow-fas' ), ),
478
- 'folder-open' => array( 'unicode' => '&#xf07c;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
479
- 'folder-plus' => array( 'unicode' => '&#xf65e;', 'styles' => array( 'sow-fas' ), ),
480
- 'font' => array( 'unicode' => '&#xf031;', 'styles' => array( 'sow-fas' ), ),
481
- 'font-awesome' => array( 'unicode' => '&#xf2b4;', 'styles' => array( 'sow-fab' ), ),
482
- 'font-awesome-alt' => array( 'unicode' => '&#xf35c;', 'styles' => array( 'sow-fab' ), ),
483
- 'font-awesome-flag' => array( 'unicode' => '&#xf425;', 'styles' => array( 'sow-fab' ), ),
484
- 'font-awesome-logo-full' => array( 'unicode' => '&#xf4e6;', 'styles' => array( 'sow-fab', 'sow-fas', 'sow-far' ), ),
485
- 'fonticons' => array( 'unicode' => '&#xf280;', 'styles' => array( 'sow-fab' ), ),
486
- 'fonticons-fi' => array( 'unicode' => '&#xf3a2;', 'styles' => array( 'sow-fab' ), ),
487
- 'football-ball' => array( 'unicode' => '&#xf44e;', 'styles' => array( 'sow-fas' ), ),
488
- 'fort-awesome' => array( 'unicode' => '&#xf286;', 'styles' => array( 'sow-fab' ), ),
489
- 'fort-awesome-alt' => array( 'unicode' => '&#xf3a3;', 'styles' => array( 'sow-fab' ), ),
490
- 'forumbee' => array( 'unicode' => '&#xf211;', 'styles' => array( 'sow-fab' ), ),
491
- 'forward' => array( 'unicode' => '&#xf04e;', 'styles' => array( 'sow-fas' ), ),
492
- 'foursquare' => array( 'unicode' => '&#xf180;', 'styles' => array( 'sow-fab' ), ),
493
- 'free-code-camp' => array( 'unicode' => '&#xf2c5;', 'styles' => array( 'sow-fab' ), ),
494
- 'freebsd' => array( 'unicode' => '&#xf3a4;', 'styles' => array( 'sow-fab' ), ),
495
- 'frog' => array( 'unicode' => '&#xf52e;', 'styles' => array( 'sow-fas' ), ),
496
- 'frown' => array( 'unicode' => '&#xf119;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
497
- 'frown-open' => array( 'unicode' => '&#xf57a;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
498
- 'fulcrum' => array( 'unicode' => '&#xf50b;', 'styles' => array( 'sow-fab' ), ),
499
- 'funnel-dollar' => array( 'unicode' => '&#xf662;', 'styles' => array( 'sow-fas' ), ),
500
- 'futbol' => array( 'unicode' => '&#xf1e3;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
501
- 'galactic-republic' => array( 'unicode' => '&#xf50c;', 'styles' => array( 'sow-fab' ), ),
502
- 'galactic-senate' => array( 'unicode' => '&#xf50d;', 'styles' => array( 'sow-fab' ), ),
503
- 'gamepad' => array( 'unicode' => '&#xf11b;', 'styles' => array( 'sow-fas' ), ),
504
- 'gas-pump' => array( 'unicode' => '&#xf52f;', 'styles' => array( 'sow-fas' ), ),
505
- 'gavel' => array( 'unicode' => '&#xf0e3;', 'styles' => array( 'sow-fas' ), ),
506
- 'gem' => array( 'unicode' => '&#xf3a5;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
507
- 'genderless' => array( 'unicode' => '&#xf22d;', 'styles' => array( 'sow-fas' ), ),
508
- 'get-pocket' => array( 'unicode' => '&#xf265;', 'styles' => array( 'sow-fab' ), ),
509
- 'gg' => array( 'unicode' => '&#xf260;', 'styles' => array( 'sow-fab' ), ),
510
- 'gg-circle' => array( 'unicode' => '&#xf261;', 'styles' => array( 'sow-fab' ), ),
511
- 'ghost' => array( 'unicode' => '&#xf6e2;', 'styles' => array( 'sow-fas' ), ),
512
- 'gift' => array( 'unicode' => '&#xf06b;', 'styles' => array( 'sow-fas' ), ),
513
- 'gifts' => array( 'unicode' => '&#xf79c;', 'styles' => array( 'sow-fas' ), ),
514
- 'git' => array( 'unicode' => '&#xf1d3;', 'styles' => array( 'sow-fab' ), ),
515
- 'git-square' => array( 'unicode' => '&#xf1d2;', 'styles' => array( 'sow-fab' ), ),
516
- 'github' => array( 'unicode' => '&#xf09b;', 'styles' => array( 'sow-fab' ), ),
517
- 'github-alt' => array( 'unicode' => '&#xf113;', 'styles' => array( 'sow-fab' ), ),
518
- 'github-square' => array( 'unicode' => '&#xf092;', 'styles' => array( 'sow-fab' ), ),
519
- 'gitkraken' => array( 'unicode' => '&#xf3a6;', 'styles' => array( 'sow-fab' ), ),
520
- 'gitlab' => array( 'unicode' => '&#xf296;', 'styles' => array( 'sow-fab' ), ),
521
- 'gitter' => array( 'unicode' => '&#xf426;', 'styles' => array( 'sow-fab' ), ),
522
- 'glass-cheers' => array( 'unicode' => '&#xf79f;', 'styles' => array( 'sow-fas' ), ),
523
- 'glass-martini' => array( 'unicode' => '&#xf000;', 'styles' => array( 'sow-fas' ), ),
524
- 'glass-martini-alt' => array( 'unicode' => '&#xf57b;', 'styles' => array( 'sow-fas' ), ),
525
- 'glass-whiskey' => array( 'unicode' => '&#xf7a0;', 'styles' => array( 'sow-fas' ), ),
526
- 'glasses' => array( 'unicode' => '&#xf530;', 'styles' => array( 'sow-fas' ), ),
527
- 'glide' => array( 'unicode' => '&#xf2a5;', 'styles' => array( 'sow-fab' ), ),
528
- 'glide-g' => array( 'unicode' => '&#xf2a6;', 'styles' => array( 'sow-fab' ), ),
529
- 'globe' => array( 'unicode' => '&#xf0ac;', 'styles' => array( 'sow-fas' ), ),
530
- 'globe-africa' => array( 'unicode' => '&#xf57c;', 'styles' => array( 'sow-fas' ), ),
531
- 'globe-americas' => array( 'unicode' => '&#xf57d;', 'styles' => array( 'sow-fas' ), ),
532
- 'globe-asia' => array( 'unicode' => '&#xf57e;', 'styles' => array( 'sow-fas' ), ),
533
- 'globe-europe' => array( 'unicode' => '&#xf7a2;', 'styles' => array( 'sow-fas' ), ),
534
- 'gofore' => array( 'unicode' => '&#xf3a7;', 'styles' => array( 'sow-fab' ), ),
535
- 'golf-ball' => array( 'unicode' => '&#xf450;', 'styles' => array( 'sow-fas' ), ),
536
- 'goodreads' => array( 'unicode' => '&#xf3a8;', 'styles' => array( 'sow-fab' ), ),
537
- 'goodreads-g' => array( 'unicode' => '&#xf3a9;', 'styles' => array( 'sow-fab' ), ),
538
- 'google' => array( 'unicode' => '&#xf1a0;', 'styles' => array( 'sow-fab' ), ),
539
- 'google-drive' => array( 'unicode' => '&#xf3aa;', 'styles' => array( 'sow-fab' ), ),
540
- 'google-play' => array( 'unicode' => '&#xf3ab;', 'styles' => array( 'sow-fab' ), ),
541
- 'google-plus' => array( 'unicode' => '&#xf2b3;', 'styles' => array( 'sow-fab' ), ),
542
- 'google-plus-g' => array( 'unicode' => '&#xf0d5;', 'styles' => array( 'sow-fab' ), ),
543
- 'google-plus-square' => array( 'unicode' => '&#xf0d4;', 'styles' => array( 'sow-fab' ), ),
544
- 'google-wallet' => array( 'unicode' => '&#xf1ee;', 'styles' => array( 'sow-fab' ), ),
545
- 'gopuram' => array( 'unicode' => '&#xf664;', 'styles' => array( 'sow-fas' ), ),
546
- 'graduation-cap' => array( 'unicode' => '&#xf19d;', 'styles' => array( 'sow-fas' ), ),
547
- 'gratipay' => array( 'unicode' => '&#xf184;', 'styles' => array( 'sow-fab' ), ),
548
- 'grav' => array( 'unicode' => '&#xf2d6;', 'styles' => array( 'sow-fab' ), ),
549
- 'greater-than' => array( 'unicode' => '&#xf531;', 'styles' => array( 'sow-fas' ), ),
550
- 'greater-than-equal' => array( 'unicode' => '&#xf532;', 'styles' => array( 'sow-fas' ), ),
551
- 'grimace' => array( 'unicode' => '&#xf57f;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
552
- 'grin' => array( 'unicode' => '&#xf580;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
553
- 'grin-alt' => array( 'unicode' => '&#xf581;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
554
- 'grin-beam' => array( 'unicode' => '&#xf582;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
555
- 'grin-beam-sweat' => array( 'unicode' => '&#xf583;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
556
- 'grin-hearts' => array( 'unicode' => '&#xf584;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
557
- 'grin-squint' => array( 'unicode' => '&#xf585;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
558
- 'grin-squint-tears' => array( 'unicode' => '&#xf586;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
559
- 'grin-stars' => array( 'unicode' => '&#xf587;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
560
- 'grin-tears' => array( 'unicode' => '&#xf588;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
561
- 'grin-tongue' => array( 'unicode' => '&#xf589;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
562
- 'grin-tongue-squint' => array( 'unicode' => '&#xf58a;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
563
- 'grin-tongue-wink' => array( 'unicode' => '&#xf58b;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
564
- 'grin-wink' => array( 'unicode' => '&#xf58c;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
565
- 'grip-horizontal' => array( 'unicode' => '&#xf58d;', 'styles' => array( 'sow-fas' ), ),
566
- 'grip-lines' => array( 'unicode' => '&#xf7a4;', 'styles' => array( 'sow-fas' ), ),
567
- 'grip-lines-vertical' => array( 'unicode' => '&#xf7a5;', 'styles' => array( 'sow-fas' ), ),
568
- 'grip-vertical' => array( 'unicode' => '&#xf58e;', 'styles' => array( 'sow-fas' ), ),
569
- 'gripfire' => array( 'unicode' => '&#xf3ac;', 'styles' => array( 'sow-fab' ), ),
570
- 'grunt' => array( 'unicode' => '&#xf3ad;', 'styles' => array( 'sow-fab' ), ),
571
- 'guitar' => array( 'unicode' => '&#xf7a6;', 'styles' => array( 'sow-fas' ), ),
572
- 'gulp' => array( 'unicode' => '&#xf3ae;', 'styles' => array( 'sow-fab' ), ),
573
- 'h-square' => array( 'unicode' => '&#xf0fd;', 'styles' => array( 'sow-fas' ), ),
574
- 'hacker-news' => array( 'unicode' => '&#xf1d4;', 'styles' => array( 'sow-fab' ), ),
575
- 'hacker-news-square' => array( 'unicode' => '&#xf3af;', 'styles' => array( 'sow-fab' ), ),
576
- 'hackerrank' => array( 'unicode' => '&#xf5f7;', 'styles' => array( 'sow-fab' ), ),
577
- 'hammer' => array( 'unicode' => '&#xf6e3;', 'styles' => array( 'sow-fas' ), ),
578
- 'hamsa' => array( 'unicode' => '&#xf665;', 'styles' => array( 'sow-fas' ), ),
579
- 'hand-holding' => array( 'unicode' => '&#xf4bd;', 'styles' => array( 'sow-fas' ), ),
580
- 'hand-holding-heart' => array( 'unicode' => '&#xf4be;', 'styles' => array( 'sow-fas' ), ),
581
- 'hand-holding-usd' => array( 'unicode' => '&#xf4c0;', 'styles' => array( 'sow-fas' ), ),
582
- 'hand-lizard' => array( 'unicode' => '&#xf258;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
583
- 'hand-paper' => array( 'unicode' => '&#xf256;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
584
- 'hand-peace' => array( 'unicode' => '&#xf25b;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
585
- 'hand-point-down' => array( 'unicode' => '&#xf0a7;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
586
- 'hand-point-left' => array( 'unicode' => '&#xf0a5;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
587
- 'hand-point-right' => array( 'unicode' => '&#xf0a4;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
588
- 'hand-point-up' => array( 'unicode' => '&#xf0a6;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
589
- 'hand-pointer' => array( 'unicode' => '&#xf25a;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
590
- 'hand-rock' => array( 'unicode' => '&#xf255;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
591
- 'hand-scissors' => array( 'unicode' => '&#xf257;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
592
- 'hand-spock' => array( 'unicode' => '&#xf259;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
593
- 'hands' => array( 'unicode' => '&#xf4c2;', 'styles' => array( 'sow-fas' ), ),
594
- 'hands-helping' => array( 'unicode' => '&#xf4c4;', 'styles' => array( 'sow-fas' ), ),
595
- 'handshake' => array( 'unicode' => '&#xf2b5;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
596
- 'hanukiah' => array( 'unicode' => '&#xf6e6;', 'styles' => array( 'sow-fas' ), ),
597
- 'hashtag' => array( 'unicode' => '&#xf292;', 'styles' => array( 'sow-fas' ), ),
598
- 'hat-wizard' => array( 'unicode' => '&#xf6e8;', 'styles' => array( 'sow-fas' ), ),
599
- 'haykal' => array( 'unicode' => '&#xf666;', 'styles' => array( 'sow-fas' ), ),
600
- 'hdd' => array( 'unicode' => '&#xf0a0;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
601
- 'heading' => array( 'unicode' => '&#xf1dc;', 'styles' => array( 'sow-fas' ), ),
602
- 'headphones' => array( 'unicode' => '&#xf025;', 'styles' => array( 'sow-fas' ), ),
603
- 'headphones-alt' => array( 'unicode' => '&#xf58f;', 'styles' => array( 'sow-fas' ), ),
604
- 'headset' => array( 'unicode' => '&#xf590;', 'styles' => array( 'sow-fas' ), ),
605
- 'heart' => array( 'unicode' => '&#xf004;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
606
- 'heart-broken' => array( 'unicode' => '&#xf7a9;', 'styles' => array( 'sow-fas' ), ),
607
- 'heartbeat' => array( 'unicode' => '&#xf21e;', 'styles' => array( 'sow-fas' ), ),
608
- 'helicopter' => array( 'unicode' => '&#xf533;', 'styles' => array( 'sow-fas' ), ),
609
- 'highlighter' => array( 'unicode' => '&#xf591;', 'styles' => array( 'sow-fas' ), ),
610
- 'hiking' => array( 'unicode' => '&#xf6ec;', 'styles' => array( 'sow-fas' ), ),
611
- 'hippo' => array( 'unicode' => '&#xf6ed;', 'styles' => array( 'sow-fas' ), ),
612
- 'hips' => array( 'unicode' => '&#xf452;', 'styles' => array( 'sow-fab' ), ),
613
- 'hire-a-helper' => array( 'unicode' => '&#xf3b0;', 'styles' => array( 'sow-fab' ), ),
614
- 'history' => array( 'unicode' => '&#xf1da;', 'styles' => array( 'sow-fas' ), ),
615
- 'hockey-puck' => array( 'unicode' => '&#xf453;', 'styles' => array( 'sow-fas' ), ),
616
- 'holly-berry' => array( 'unicode' => '&#xf7aa;', 'styles' => array( 'sow-fas' ), ),
617
- 'home' => array( 'unicode' => '&#xf015;', 'styles' => array( 'sow-fas' ), ),
618
- 'hooli' => array( 'unicode' => '&#xf427;', 'styles' => array( 'sow-fab' ), ),
619
- 'hornbill' => array( 'unicode' => '&#xf592;', 'styles' => array( 'sow-fab' ), ),
620
- 'horse' => array( 'unicode' => '&#xf6f0;', 'styles' => array( 'sow-fas' ), ),
621
- 'horse-head' => array( 'unicode' => '&#xf7ab;', 'styles' => array( 'sow-fas' ), ),
622
- 'hospital' => array( 'unicode' => '&#xf0f8;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
623
- 'hospital-alt' => array( 'unicode' => '&#xf47d;', 'styles' => array( 'sow-fas' ), ),
624
- 'hospital-symbol' => array( 'unicode' => '&#xf47e;', 'styles' => array( 'sow-fas' ), ),
625
- 'hot-tub' => array( 'unicode' => '&#xf593;', 'styles' => array( 'sow-fas' ), ),
626
- 'hotel' => array( 'unicode' => '&#xf594;', 'styles' => array( 'sow-fas' ), ),
627
- 'hotjar' => array( 'unicode' => '&#xf3b1;', 'styles' => array( 'sow-fab' ), ),
628
- 'hourglass' => array( 'unicode' => '&#xf254;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
629
- 'hourglass-end' => array( 'unicode' => '&#xf253;', 'styles' => array( 'sow-fas' ), ),
630
- 'hourglass-half' => array( 'unicode' => '&#xf252;', 'styles' => array( 'sow-fas' ), ),
631
- 'hourglass-start' => array( 'unicode' => '&#xf251;', 'styles' => array( 'sow-fas' ), ),
632
- 'house-damage' => array( 'unicode' => '&#xf6f1;', 'styles' => array( 'sow-fas' ), ),
633
- 'houzz' => array( 'unicode' => '&#xf27c;', 'styles' => array( 'sow-fab' ), ),
634
- 'hryvnia' => array( 'unicode' => '&#xf6f2;', 'styles' => array( 'sow-fas' ), ),
635
- 'html5' => array( 'unicode' => '&#xf13b;', 'styles' => array( 'sow-fab' ), ),
636
- 'hubspot' => array( 'unicode' => '&#xf3b2;', 'styles' => array( 'sow-fab' ), ),
637
- 'i-cursor' => array( 'unicode' => '&#xf246;', 'styles' => array( 'sow-fas' ), ),
638
- 'icicles' => array( 'unicode' => '&#xf7ad;', 'styles' => array( 'sow-fas' ), ),
639
- 'id-badge' => array( 'unicode' => '&#xf2c1;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
640
- 'id-card' => array( 'unicode' => '&#xf2c2;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
641
- 'id-card-alt' => array( 'unicode' => '&#xf47f;', 'styles' => array( 'sow-fas' ), ),
642
- 'igloo' => array( 'unicode' => '&#xf7ae;', 'styles' => array( 'sow-fas' ), ),
643
- 'image' => array( 'unicode' => '&#xf03e;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
644
- 'images' => array( 'unicode' => '&#xf302;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
645
- 'imdb' => array( 'unicode' => '&#xf2d8;', 'styles' => array( 'sow-fab' ), ),
646
- 'inbox' => array( 'unicode' => '&#xf01c;', 'styles' => array( 'sow-fas' ), ),
647
- 'indent' => array( 'unicode' => '&#xf03c;', 'styles' => array( 'sow-fas' ), ),
648
- 'industry' => array( 'unicode' => '&#xf275;', 'styles' => array( 'sow-fas' ), ),
649
- 'infinity' => array( 'unicode' => '&#xf534;', 'styles' => array( 'sow-fas' ), ),
650
- 'info' => array( 'unicode' => '&#xf129;', 'styles' => array( 'sow-fas' ), ),
651
- 'info-circle' => array( 'unicode' => '&#xf05a;', 'styles' => array( 'sow-fas' ), ),
652
- 'instagram' => array( 'unicode' => '&#xf16d;', 'styles' => array( 'sow-fab' ), ),
653
- 'intercom' => array( 'unicode' => '&#xf7af;', 'styles' => array( 'sow-fab' ), ),
654
- 'internet-explorer' => array( 'unicode' => '&#xf26b;', 'styles' => array( 'sow-fab' ), ),
655
- 'invision' => array( 'unicode' => '&#xf7b0;', 'styles' => array( 'sow-fab' ), ),
656
- 'ioxhost' => array( 'unicode' => '&#xf208;', 'styles' => array( 'sow-fab' ), ),
657
- 'italic' => array( 'unicode' => '&#xf033;', 'styles' => array( 'sow-fas' ), ),
658
- 'itunes' => array( 'unicode' => '&#xf3b4;', 'styles' => array( 'sow-fab' ), ),
659
- 'itunes-note' => array( 'unicode' => '&#xf3b5;', 'styles' => array( 'sow-fab' ), ),
660
- 'java' => array( 'unicode' => '&#xf4e4;', 'styles' => array( 'sow-fab' ), ),
661
- 'jedi' => array( 'unicode' => '&#xf669;', 'styles' => array( 'sow-fas' ), ),
662
- 'jedi-order' => array( 'unicode' => '&#xf50e;', 'styles' => array( 'sow-fab' ), ),
663
- 'jenkins' => array( 'unicode' => '&#xf3b6;', 'styles' => array( 'sow-fab' ), ),
664
- 'jira' => array( 'unicode' => '&#xf7b1;', 'styles' => array( 'sow-fab' ), ),
665
- 'joget' => array( 'unicode' => '&#xf3b7;', 'styles' => array( 'sow-fab' ), ),
666
- 'joint' => array( 'unicode' => '&#xf595;', 'styles' => array( 'sow-fas' ), ),
667
- 'joomla' => array( 'unicode' => '&#xf1aa;', 'styles' => array( 'sow-fab' ), ),
668
- 'journal-whills' => array( 'unicode' => '&#xf66a;', 'styles' => array( 'sow-fas' ), ),
669
- 'js' => array( 'unicode' => '&#xf3b8;', 'styles' => array( 'sow-fab' ), ),
670
- 'js-square' => array( 'unicode' => '&#xf3b9;', 'styles' => array( 'sow-fab' ), ),
671
- 'jsfiddle' => array( 'unicode' => '&#xf1cc;', 'styles' => array( 'sow-fab' ), ),
672
- 'kaaba' => array( 'unicode' => '&#xf66b;', 'styles' => array( 'sow-fas' ), ),
673
- 'kaggle' => array( 'unicode' => '&#xf5fa;', 'styles' => array( 'sow-fab' ), ),
674
- 'key' => array( 'unicode' => '&#xf084;', 'styles' => array( 'sow-fas' ), ),
675
- 'keybase' => array( 'unicode' => '&#xf4f5;', 'styles' => array( 'sow-fab' ), ),
676
- 'keyboard' => array( 'unicode' => '&#xf11c;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
677
- 'keycdn' => array( 'unicode' => '&#xf3ba;', 'styles' => array( 'sow-fab' ), ),
678
- 'khanda' => array( 'unicode' => '&#xf66d;', 'styles' => array( 'sow-fas' ), ),
679
- 'kickstarter' => array( 'unicode' => '&#xf3bb;', 'styles' => array( 'sow-fab' ), ),
680
- 'kickstarter-k' => array( 'unicode' => '&#xf3bc;', 'styles' => array( 'sow-fab' ), ),
681
- 'kiss' => array( 'unicode' => '&#xf596;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
682
- 'kiss-beam' => array( 'unicode' => '&#xf597;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
683
- 'kiss-wink-heart' => array( 'unicode' => '&#xf598;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
684
- 'kiwi-bird' => array( 'unicode' => '&#xf535;', 'styles' => array( 'sow-fas' ), ),
685
- 'korvue' => array( 'unicode' => '&#xf42f;', 'styles' => array( 'sow-fab' ), ),
686
- 'landmark' => array( 'unicode' => '&#xf66f;', 'styles' => array( 'sow-fas' ), ),
687
- 'language' => array( 'unicode' => '&#xf1ab;', 'styles' => array( 'sow-fas' ), ),
688
- 'laptop' => array( 'unicode' => '&#xf109;', 'styles' => array( 'sow-fas' ), ),
689
- 'laptop-code' => array( 'unicode' => '&#xf5fc;', 'styles' => array( 'sow-fas' ), ),
690
- 'laravel' => array( 'unicode' => '&#xf3bd;', 'styles' => array( 'sow-fab' ), ),
691
- 'lastfm' => array( 'unicode' => '&#xf202;', 'styles' => array( 'sow-fab' ), ),
692
- 'lastfm-square' => array( 'unicode' => '&#xf203;', 'styles' => array( 'sow-fab' ), ),
693
- 'laugh' => array( 'unicode' => '&#xf599;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
694
- 'laugh-beam' => array( 'unicode' => '&#xf59a;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
695
- 'laugh-squint' => array( 'unicode' => '&#xf59b;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
696
- 'laugh-wink' => array( 'unicode' => '&#xf59c;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
697
- 'layer-group' => array( 'unicode' => '&#xf5fd;', 'styles' => array( 'sow-fas' ), ),
698
- 'leaf' => array( 'unicode' => '&#xf06c;', 'styles' => array( 'sow-fas' ), ),
699
- 'leanpub' => array( 'unicode' => '&#xf212;', 'styles' => array( 'sow-fab' ), ),
700
- 'lemon' => array( 'unicode' => '&#xf094;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
701
- 'less' => array( 'unicode' => '&#xf41d;', 'styles' => array( 'sow-fab' ), ),
702
- 'less-than' => array( 'unicode' => '&#xf536;', 'styles' => array( 'sow-fas' ), ),
703
- 'less-than-equal' => array( 'unicode' => '&#xf537;', 'styles' => array( 'sow-fas' ), ),
704
- 'level-down-alt' => array( 'unicode' => '&#xf3be;', 'styles' => array( 'sow-fas' ), ),
705
- 'level-up-alt' => array( 'unicode' => '&#xf3bf;', 'styles' => array( 'sow-fas' ), ),
706
- 'life-ring' => array( 'unicode' => '&#xf1cd;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
707
- 'lightbulb' => array( 'unicode' => '&#xf0eb;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
708
- 'line' => array( 'unicode' => '&#xf3c0;', 'styles' => array( 'sow-fab' ), ),
709
- 'link' => array( 'unicode' => '&#xf0c1;', 'styles' => array( 'sow-fas' ), ),
710
- 'linkedin' => array( 'unicode' => '&#xf08c;', 'styles' => array( 'sow-fab' ), ),
711
- 'linkedin-in' => array( 'unicode' => '&#xf0e1;', 'styles' => array( 'sow-fab' ), ),
712
- 'linode' => array( 'unicode' => '&#xf2b8;', 'styles' => array( 'sow-fab' ), ),
713
- 'linux' => array( 'unicode' => '&#xf17c;', 'styles' => array( 'sow-fab' ), ),
714
- 'lira-sign' => array( 'unicode' => '&#xf195;', 'styles' => array( 'sow-fas' ), ),
715
- 'list' => array( 'unicode' => '&#xf03a;', 'styles' => array( 'sow-fas' ), ),
716
- 'list-alt' => array( 'unicode' => '&#xf022;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
717
- 'list-ol' => array( 'unicode' => '&#xf0cb;', 'styles' => array( 'sow-fas' ), ),
718
- 'list-ul' => array( 'unicode' => '&#xf0ca;', 'styles' => array( 'sow-fas' ), ),
719
- 'location-arrow' => array( 'unicode' => '&#xf124;', 'styles' => array( 'sow-fas' ), ),
720
- 'lock' => array( 'unicode' => '&#xf023;', 'styles' => array( 'sow-fas' ), ),
721
- 'lock-open' => array( 'unicode' => '&#xf3c1;', 'styles' => array( 'sow-fas' ), ),
722
- 'long-arrow-alt-down' => array( 'unicode' => '&#xf309;', 'styles' => array( 'sow-fas' ), ),
723
- 'long-arrow-alt-left' => array( 'unicode' => '&#xf30a;', 'styles' => array( 'sow-fas' ), ),
724
- 'long-arrow-alt-right' => array( 'unicode' => '&#xf30b;', 'styles' => array( 'sow-fas' ), ),
725
- 'long-arrow-alt-up' => array( 'unicode' => '&#xf30c;', 'styles' => array( 'sow-fas' ), ),
726
- 'low-vision' => array( 'unicode' => '&#xf2a8;', 'styles' => array( 'sow-fas' ), ),
727
- 'luggage-cart' => array( 'unicode' => '&#xf59d;', 'styles' => array( 'sow-fas' ), ),
728
- 'lyft' => array( 'unicode' => '&#xf3c3;', 'styles' => array( 'sow-fab' ), ),
729
- 'magento' => array( 'unicode' => '&#xf3c4;', 'styles' => array( 'sow-fab' ), ),
730
- 'magic' => array( 'unicode' => '&#xf0d0;', 'styles' => array( 'sow-fas' ), ),
731
- 'magnet' => array( 'unicode' => '&#xf076;', 'styles' => array( 'sow-fas' ), ),
732
- 'mail-bulk' => array( 'unicode' => '&#xf674;', 'styles' => array( 'sow-fas' ), ),
733
- 'mailchimp' => array( 'unicode' => '&#xf59e;', 'styles' => array( 'sow-fab' ), ),
734
- 'male' => array( 'unicode' => '&#xf183;', 'styles' => array( 'sow-fas' ), ),
735
- 'mandalorian' => array( 'unicode' => '&#xf50f;', 'styles' => array( 'sow-fab' ), ),
736
- 'map' => array( 'unicode' => '&#xf279;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
737
- 'map-marked' => array( 'unicode' => '&#xf59f;', 'styles' => array( 'sow-fas' ), ),
738
- 'map-marked-alt' => array( 'unicode' => '&#xf5a0;', 'styles' => array( 'sow-fas' ), ),
739
- 'map-marker' => array( 'unicode' => '&#xf041;', 'styles' => array( 'sow-fas' ), ),
740
- 'map-marker-alt' => array( 'unicode' => '&#xf3c5;', 'styles' => array( 'sow-fas' ), ),
741
- 'map-pin' => array( 'unicode' => '&#xf276;', 'styles' => array( 'sow-fas' ), ),
742
- 'map-signs' => array( 'unicode' => '&#xf277;', 'styles' => array( 'sow-fas' ), ),
743
- 'markdown' => array( 'unicode' => '&#xf60f;', 'styles' => array( 'sow-fab' ), ),
744
- 'marker' => array( 'unicode' => '&#xf5a1;', 'styles' => array( 'sow-fas' ), ),
745
- 'mars' => array( 'unicode' => '&#xf222;', 'styles' => array( 'sow-fas' ), ),
746
- 'mars-double' => array( 'unicode' => '&#xf227;', 'styles' => array( 'sow-fas' ), ),
747
- 'mars-stroke' => array( 'unicode' => '&#xf229;', 'styles' => array( 'sow-fas' ), ),
748
- 'mars-stroke-h' => array( 'unicode' => '&#xf22b;', 'styles' => array( 'sow-fas' ), ),
749
- 'mars-stroke-v' => array( 'unicode' => '&#xf22a;', 'styles' => array( 'sow-fas' ), ),
750
- 'mask' => array( 'unicode' => '&#xf6fa;', 'styles' => array( 'sow-fas' ), ),
751
- 'mastodon' => array( 'unicode' => '&#xf4f6;', 'styles' => array( 'sow-fab' ), ),
752
- 'maxcdn' => array( 'unicode' => '&#xf136;', 'styles' => array( 'sow-fab' ), ),
753
- 'medal' => array( 'unicode' => '&#xf5a2;', 'styles' => array( 'sow-fas' ), ),
754
- 'medapps' => array( 'unicode' => '&#xf3c6;', 'styles' => array( 'sow-fab' ), ),
755
- 'medium' => array( 'unicode' => '&#xf23a;', 'styles' => array( 'sow-fab' ), ),
756
- 'medium-m' => array( 'unicode' => '&#xf3c7;', 'styles' => array( 'sow-fab' ), ),
757
- 'medkit' => array( 'unicode' => '&#xf0fa;', 'styles' => array( 'sow-fas' ), ),
758
- 'medrt' => array( 'unicode' => '&#xf3c8;', 'styles' => array( 'sow-fab' ), ),
759
- 'meetup' => array( 'unicode' => '&#xf2e0;', 'styles' => array( 'sow-fab' ), ),
760
- 'megaport' => array( 'unicode' => '&#xf5a3;', 'styles' => array( 'sow-fab' ), ),
761
- 'meh' => array( 'unicode' => '&#xf11a;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
762
- 'meh-blank' => array( 'unicode' => '&#xf5a4;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
763
- 'meh-rolling-eyes' => array( 'unicode' => '&#xf5a5;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
764
- 'memory' => array( 'unicode' => '&#xf538;', 'styles' => array( 'sow-fas' ), ),
765
- 'mendeley' => array( 'unicode' => '&#xf7b3;', 'styles' => array( 'sow-fab' ), ),
766
- 'menorah' => array( 'unicode' => '&#xf676;', 'styles' => array( 'sow-fas' ), ),
767
- 'mercury' => array( 'unicode' => '&#xf223;', 'styles' => array( 'sow-fas' ), ),
768
- 'meteor' => array( 'unicode' => '&#xf753;', 'styles' => array( 'sow-fas' ), ),
769
- 'microchip' => array( 'unicode' => '&#xf2db;', 'styles' => array( 'sow-fas' ), ),
770
- 'microphone' => array( 'unicode' => '&#xf130;', 'styles' => array( 'sow-fas' ), ),
771
- 'microphone-alt' => array( 'unicode' => '&#xf3c9;', 'styles' => array( 'sow-fas' ), ),
772
- 'microphone-alt-slash' => array( 'unicode' => '&#xf539;', 'styles' => array( 'sow-fas' ), ),
773
- 'microphone-slash' => array( 'unicode' => '&#xf131;', 'styles' => array( 'sow-fas' ), ),
774
- 'microscope' => array( 'unicode' => '&#xf610;', 'styles' => array( 'sow-fas' ), ),
775
- 'microsoft' => array( 'unicode' => '&#xf3ca;', 'styles' => array( 'sow-fab' ), ),
776
- 'minus' => array( 'unicode' => '&#xf068;', 'styles' => array( 'sow-fas' ), ),
777
- 'minus-circle' => array( 'unicode' => '&#xf056;', 'styles' => array( 'sow-fas' ), ),
778
- 'minus-square' => array( 'unicode' => '&#xf146;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
779
- 'mitten' => array( 'unicode' => '&#xf7b5;', 'styles' => array( 'sow-fas' ), ),
780
- 'mix' => array( 'unicode' => '&#xf3cb;', 'styles' => array( 'sow-fab' ), ),
781
- 'mixcloud' => array( 'unicode' => '&#xf289;', 'styles' => array( 'sow-fab' ), ),
782
- 'mizuni' => array( 'unicode' => '&#xf3cc;', 'styles' => array( 'sow-fab' ), ),
783
- 'mobile' => array( 'unicode' => '&#xf10b;', 'styles' => array( 'sow-fas' ), ),
784
- 'mobile-alt' => array( 'unicode' => '&#xf3cd;', 'styles' => array( 'sow-fas' ), ),
785
- 'modx' => array( 'unicode' => '&#xf285;', 'styles' => array( 'sow-fab' ), ),
786
- 'monero' => array( 'unicode' => '&#xf3d0;', 'styles' => array( 'sow-fab' ), ),
787
- 'money-bill' => array( 'unicode' => '&#xf0d6;', 'styles' => array( 'sow-fas' ), ),
788
- 'money-bill-alt' => array( 'unicode' => '&#xf3d1;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
789
- 'money-bill-wave' => array( 'unicode' => '&#xf53a;', 'styles' => array( 'sow-fas' ), ),
790
- 'money-bill-wave-alt' => array( 'unicode' => '&#xf53b;', 'styles' => array( 'sow-fas' ), ),
791
- 'money-check' => array( 'unicode' => '&#xf53c;', 'styles' => array( 'sow-fas' ), ),
792
- 'money-check-alt' => array( 'unicode' => '&#xf53d;', 'styles' => array( 'sow-fas' ), ),
793
- 'monument' => array( 'unicode' => '&#xf5a6;', 'styles' => array( 'sow-fas' ), ),
794
- 'moon' => array( 'unicode' => '&#xf186;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
795
- 'mortar-pestle' => array( 'unicode' => '&#xf5a7;', 'styles' => array( 'sow-fas' ), ),
796
- 'mosque' => array( 'unicode' => '&#xf678;', 'styles' => array( 'sow-fas' ), ),
797
- 'motorcycle' => array( 'unicode' => '&#xf21c;', 'styles' => array( 'sow-fas' ), ),
798
- 'mountain' => array( 'unicode' => '&#xf6fc;', 'styles' => array( 'sow-fas' ), ),
799
- 'mouse-pointer' => array( 'unicode' => '&#xf245;', 'styles' => array( 'sow-fas' ), ),
800
- 'mug-hot' => array( 'unicode' => '&#xf7b6;', 'styles' => array( 'sow-fas' ), ),
801
- 'music' => array( 'unicode' => '&#xf001;', 'styles' => array( 'sow-fas' ), ),
802
- 'napster' => array( 'unicode' => '&#xf3d2;', 'styles' => array( 'sow-fab' ), ),
803
- 'neos' => array( 'unicode' => '&#xf612;', 'styles' => array( 'sow-fab' ), ),
804
- 'network-wired' => array( 'unicode' => '&#xf6ff;', 'styles' => array( 'sow-fas' ), ),
805
- 'neuter' => array( 'unicode' => '&#xf22c;', 'styles' => array( 'sow-fas' ), ),
806
- 'newspaper' => array( 'unicode' => '&#xf1ea;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
807
- 'nimblr' => array( 'unicode' => '&#xf5a8;', 'styles' => array( 'sow-fab' ), ),
808
- 'nintendo-switch' => array( 'unicode' => '&#xf418;', 'styles' => array( 'sow-fab' ), ),
809
- 'node' => array( 'unicode' => '&#xf419;', 'styles' => array( 'sow-fab' ), ),
810
- 'node-js' => array( 'unicode' => '&#xf3d3;', 'styles' => array( 'sow-fab' ), ),
811
- 'not-equal' => array( 'unicode' => '&#xf53e;', 'styles' => array( 'sow-fas' ), ),
812
- 'notes-medical' => array( 'unicode' => '&#xf481;', 'styles' => array( 'sow-fas' ), ),
813
- 'npm' => array( 'unicode' => '&#xf3d4;', 'styles' => array( 'sow-fab' ), ),
814
- 'ns8' => array( 'unicode' => '&#xf3d5;', 'styles' => array( 'sow-fab' ), ),
815
- 'nutritionix' => array( 'unicode' => '&#xf3d6;', 'styles' => array( 'sow-fab' ), ),
816
- 'object-group' => array( 'unicode' => '&#xf247;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
817
- 'object-ungroup' => array( 'unicode' => '&#xf248;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
818
- 'odnoklassniki' => array( 'unicode' => '&#xf263;', 'styles' => array( 'sow-fab' ), ),
819
- 'odnoklassniki-square' => array( 'unicode' => '&#xf264;', 'styles' => array( 'sow-fab' ), ),
820
- 'oil-can' => array( 'unicode' => '&#xf613;', 'styles' => array( 'sow-fas' ), ),
821
- 'old-republic' => array( 'unicode' => '&#xf510;', 'styles' => array( 'sow-fab' ), ),
822
- 'om' => array( 'unicode' => '&#xf679;', 'styles' => array( 'sow-fas' ), ),
823
- 'opencart' => array( 'unicode' => '&#xf23d;', 'styles' => array( 'sow-fab' ), ),
824
- 'openid' => array( 'unicode' => '&#xf19b;', 'styles' => array( 'sow-fab' ), ),
825
- 'opera' => array( 'unicode' => '&#xf26a;', 'styles' => array( 'sow-fab' ), ),
826
- 'optin-monster' => array( 'unicode' => '&#xf23c;', 'styles' => array( 'sow-fab' ), ),
827
- 'osi' => array( 'unicode' => '&#xf41a;', 'styles' => array( 'sow-fab' ), ),
828
- 'otter' => array( 'unicode' => '&#xf700;', 'styles' => array( 'sow-fas' ), ),
829
- 'outdent' => array( 'unicode' => '&#xf03b;', 'styles' => array( 'sow-fas' ), ),
830
- 'page4' => array( 'unicode' => '&#xf3d7;', 'styles' => array( 'sow-fab' ), ),
831
- 'pagelines' => array( 'unicode' => '&#xf18c;', 'styles' => array( 'sow-fab' ), ),
832
- 'paint-brush' => array( 'unicode' => '&#xf1fc;', 'styles' => array( 'sow-fas' ), ),
833
- 'paint-roller' => array( 'unicode' => '&#xf5aa;', 'styles' => array( 'sow-fas' ), ),
834
- 'palette' => array( 'unicode' => '&#xf53f;', 'styles' => array( 'sow-fas' ), ),
835
- 'palfed' => array( 'unicode' => '&#xf3d8;', 'styles' => array( 'sow-fab' ), ),
836
- 'pallet' => array( 'unicode' => '&#xf482;', 'styles' => array( 'sow-fas' ), ),
837
- 'paper-plane' => array( 'unicode' => '&#xf1d8;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
838
- 'paperclip' => array( 'unicode' => '&#xf0c6;', 'styles' => array( 'sow-fas' ), ),
839
- 'parachute-box' => array( 'unicode' => '&#xf4cd;', 'styles' => array( 'sow-fas' ), ),
840
- 'paragraph' => array( 'unicode' => '&#xf1dd;', 'styles' => array( 'sow-fas' ), ),
841
- 'parking' => array( 'unicode' => '&#xf540;', 'styles' => array( 'sow-fas' ), ),
842
- 'passport' => array( 'unicode' => '&#xf5ab;', 'styles' => array( 'sow-fas' ), ),
843
- 'pastafarianism' => array( 'unicode' => '&#xf67b;', 'styles' => array( 'sow-fas' ), ),
844
- 'paste' => array( 'unicode' => '&#xf0ea;', 'styles' => array( 'sow-fas' ), ),
845
- 'patreon' => array( 'unicode' => '&#xf3d9;', 'styles' => array( 'sow-fab' ), ),
846
- 'pause' => array( 'unicode' => '&#xf04c;', 'styles' => array( 'sow-fas' ), ),
847
- 'pause-circle' => array( 'unicode' => '&#xf28b;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
848
- 'paw' => array( 'unicode' => '&#xf1b0;', 'styles' => array( 'sow-fas' ), ),
849
- 'paypal' => array( 'unicode' => '&#xf1ed;', 'styles' => array( 'sow-fab' ), ),
850
- 'peace' => array( 'unicode' => '&#xf67c;', 'styles' => array( 'sow-fas' ), ),
851
- 'pen' => array( 'unicode' => '&#xf304;', 'styles' => array( 'sow-fas' ), ),
852
- 'pen-alt' => array( 'unicode' => '&#xf305;', 'styles' => array( 'sow-fas' ), ),
853
- 'pen-fancy' => array( 'unicode' => '&#xf5ac;', 'styles' => array( 'sow-fas' ), ),
854
- 'pen-nib' => array( 'unicode' => '&#xf5ad;', 'styles' => array( 'sow-fas' ), ),
855
- 'pen-square' => array( 'unicode' => '&#xf14b;', 'styles' => array( 'sow-fas' ), ),
856
- 'pencil-alt' => array( 'unicode' => '&#xf303;', 'styles' => array( 'sow-fas' ), ),
857
- 'pencil-ruler' => array( 'unicode' => '&#xf5ae;', 'styles' => array( 'sow-fas' ), ),
858
- 'penny-arcade' => array( 'unicode' => '&#xf704;', 'styles' => array( 'sow-fab' ), ),
859
- 'people-carry' => array( 'unicode' => '&#xf4ce;', 'styles' => array( 'sow-fas' ), ),
860
- 'percent' => array( 'unicode' => '&#xf295;', 'styles' => array( 'sow-fas' ), ),
861
- 'percentage' => array( 'unicode' => '&#xf541;', 'styles' => array( 'sow-fas' ), ),
862
- 'periscope' => array( 'unicode' => '&#xf3da;', 'styles' => array( 'sow-fab' ), ),
863
- 'person-booth' => array( 'unicode' => '&#xf756;', 'styles' => array( 'sow-fas' ), ),
864
- 'phabricator' => array( 'unicode' => '&#xf3db;', 'styles' => array( 'sow-fab' ), ),
865
- 'phoenix-framework' => array( 'unicode' => '&#xf3dc;', 'styles' => array( 'sow-fab' ), ),
866
- 'phoenix-squadron' => array( 'unicode' => '&#xf511;', 'styles' => array( 'sow-fab' ), ),
867
- 'phone' => array( 'unicode' => '&#xf095;', 'styles' => array( 'sow-fas' ), ),
868
- 'phone-slash' => array( 'unicode' => '&#xf3dd;', 'styles' => array( 'sow-fas' ), ),
869
- 'phone-square' => array( 'unicode' => '&#xf098;', 'styles' => array( 'sow-fas' ), ),
870
- 'phone-volume' => array( 'unicode' => '&#xf2a0;', 'styles' => array( 'sow-fas' ), ),
871
- 'php' => array( 'unicode' => '&#xf457;', 'styles' => array( 'sow-fab' ), ),
872
- 'pied-piper' => array( 'unicode' => '&#xf2ae;', 'styles' => array( 'sow-fab' ), ),
873
- 'pied-piper-alt' => array( 'unicode' => '&#xf1a8;', 'styles' => array( 'sow-fab' ), ),
874
- 'pied-piper-hat' => array( 'unicode' => '&#xf4e5;', 'styles' => array( 'sow-fab' ), ),
875
- 'pied-piper-pp' => array( 'unicode' => '&#xf1a7;', 'styles' => array( 'sow-fab' ), ),
876
- 'piggy-bank' => array( 'unicode' => '&#xf4d3;', 'styles' => array( 'sow-fas' ), ),
877
- 'pills' => array( 'unicode' => '&#xf484;', 'styles' => array( 'sow-fas' ), ),
878
- 'pinterest' => array( 'unicode' => '&#xf0d2;', 'styles' => array( 'sow-fab' ), ),
879
- 'pinterest-p' => array( 'unicode' => '&#xf231;', 'styles' => array( 'sow-fab' ), ),
880
- 'pinterest-square' => array( 'unicode' => '&#xf0d3;', 'styles' => array( 'sow-fab' ), ),
881
- 'place-of-worship' => array( 'unicode' => '&#xf67f;', 'styles' => array( 'sow-fas' ), ),
882
- 'plane' => array( 'unicode' => '&#xf072;', 'styles' => array( 'sow-fas' ), ),
883
- 'plane-arrival' => array( 'unicode' => '&#xf5af;', 'styles' => array( 'sow-fas' ), ),
884
- 'plane-departure' => array( 'unicode' => '&#xf5b0;', 'styles' => array( 'sow-fas' ), ),
885
- 'play' => array( 'unicode' => '&#xf04b;', 'styles' => array( 'sow-fas' ), ),
886
- 'play-circle' => array( 'unicode' => '&#xf144;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
887
- 'playstation' => array( 'unicode' => '&#xf3df;', 'styles' => array( 'sow-fab' ), ),
888
- 'plug' => array( 'unicode' => '&#xf1e6;', 'styles' => array( 'sow-fas' ), ),
889
- 'plus' => array( 'unicode' => '&#xf067;', 'styles' => array( 'sow-fas' ), ),
890
- 'plus-circle' => array( 'unicode' => '&#xf055;', 'styles' => array( 'sow-fas' ), ),
891
- 'plus-square' => array( 'unicode' => '&#xf0fe;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
892
- 'podcast' => array( 'unicode' => '&#xf2ce;', 'styles' => array( 'sow-fas' ), ),
893
- 'poll' => array( 'unicode' => '&#xf681;', 'styles' => array( 'sow-fas' ), ),
894
- 'poll-h' => array( 'unicode' => '&#xf682;', 'styles' => array( 'sow-fas' ), ),
895
- 'poo' => array( 'unicode' => '&#xf2fe;', 'styles' => array( 'sow-fas' ), ),
896
- 'poo-storm' => array( 'unicode' => '&#xf75a;', 'styles' => array( 'sow-fas' ), ),
897
- 'poop' => array( 'unicode' => '&#xf619;', 'styles' => array( 'sow-fas' ), ),
898
- 'portrait' => array( 'unicode' => '&#xf3e0;', 'styles' => array( 'sow-fas' ), ),
899
- 'pound-sign' => array( 'unicode' => '&#xf154;', 'styles' => array( 'sow-fas' ), ),
900
- 'power-off' => array( 'unicode' => '&#xf011;', 'styles' => array( 'sow-fas' ), ),
901
- 'pray' => array( 'unicode' => '&#xf683;', 'styles' => array( 'sow-fas' ), ),
902
- 'praying-hands' => array( 'unicode' => '&#xf684;', 'styles' => array( 'sow-fas' ), ),
903
- 'prescription' => array( 'unicode' => '&#xf5b1;', 'styles' => array( 'sow-fas' ), ),
904
- 'prescription-bottle' => array( 'unicode' => '&#xf485;', 'styles' => array( 'sow-fas' ), ),
905
- 'prescription-bottle-alt' => array( 'unicode' => '&#xf486;', 'styles' => array( 'sow-fas' ), ),
906
- 'print' => array( 'unicode' => '&#xf02f;', 'styles' => array( 'sow-fas' ), ),
907
- 'procedures' => array( 'unicode' => '&#xf487;', 'styles' => array( 'sow-fas' ), ),
908
- 'product-hunt' => array( 'unicode' => '&#xf288;', 'styles' => array( 'sow-fab' ), ),
909
- 'project-diagram' => array( 'unicode' => '&#xf542;', 'styles' => array( 'sow-fas' ), ),
910
- 'pushed' => array( 'unicode' => '&#xf3e1;', 'styles' => array( 'sow-fab' ), ),
911
- 'puzzle-piece' => array( 'unicode' => '&#xf12e;', 'styles' => array( 'sow-fas' ), ),
912
- 'python' => array( 'unicode' => '&#xf3e2;', 'styles' => array( 'sow-fab' ), ),
913
- 'qq' => array( 'unicode' => '&#xf1d6;', 'styles' => array( 'sow-fab' ), ),
914
- 'qrcode' => array( 'unicode' => '&#xf029;', 'styles' => array( 'sow-fas' ), ),
915
- 'question' => array( 'unicode' => '&#xf128;', 'styles' => array( 'sow-fas' ), ),
916
- 'question-circle' => array( 'unicode' => '&#xf059;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
917
- 'quidditch' => array( 'unicode' => '&#xf458;', 'styles' => array( 'sow-fas' ), ),
918
- 'quinscape' => array( 'unicode' => '&#xf459;', 'styles' => array( 'sow-fab' ), ),
919
- 'quora' => array( 'unicode' => '&#xf2c4;', 'styles' => array( 'sow-fab' ), ),
920
- 'quote-left' => array( 'unicode' => '&#xf10d;', 'styles' => array( 'sow-fas' ), ),
921
- 'quote-right' => array( 'unicode' => '&#xf10e;', 'styles' => array( 'sow-fas' ), ),
922
- 'quran' => array( 'unicode' => '&#xf687;', 'styles' => array( 'sow-fas' ), ),
923
- 'r-project' => array( 'unicode' => '&#xf4f7;', 'styles' => array( 'sow-fab' ), ),
924
- 'radiation' => array( 'unicode' => '&#xf7b9;', 'styles' => array( 'sow-fas' ), ),
925
- 'radiation-alt' => array( 'unicode' => '&#xf7ba;', 'styles' => array( 'sow-fas' ), ),
926
- 'rainbow' => array( 'unicode' => '&#xf75b;', 'styles' => array( 'sow-fas' ), ),
927
- 'random' => array( 'unicode' => '&#xf074;', 'styles' => array( 'sow-fas' ), ),
928
- 'raspberry-pi' => array( 'unicode' => '&#xf7bb;', 'styles' => array( 'sow-fab' ), ),
929
- 'ravelry' => array( 'unicode' => '&#xf2d9;', 'styles' => array( 'sow-fab' ), ),
930
- 'react' => array( 'unicode' => '&#xf41b;', 'styles' => array( 'sow-fab' ), ),
931
- 'reacteurope' => array( 'unicode' => '&#xf75d;', 'styles' => array( 'sow-fab' ), ),
932
- 'readme' => array( 'unicode' => '&#xf4d5;', 'styles' => array( 'sow-fab' ), ),
933
- 'rebel' => array( 'unicode' => '&#xf1d0;', 'styles' => array( 'sow-fab' ), ),
934
- 'receipt' => array( 'unicode' => '&#xf543;', 'styles' => array( 'sow-fas' ), ),
935
- 'recycle' => array( 'unicode' => '&#xf1b8;', 'styles' => array( 'sow-fas' ), ),
936
- 'red-river' => array( 'unicode' => '&#xf3e3;', 'styles' => array( 'sow-fab' ), ),
937
- 'reddit' => array( 'unicode' => '&#xf1a1;', 'styles' => array( 'sow-fab' ), ),
938
- 'reddit-alien' => array( 'unicode' => '&#xf281;', 'styles' => array( 'sow-fab' ), ),
939
- 'reddit-square' => array( 'unicode' => '&#xf1a2;', 'styles' => array( 'sow-fab' ), ),
940
- 'redhat' => array( 'unicode' => '&#xf7bc;', 'styles' => array( 'sow-fab' ), ),
941
- 'redo' => array( 'unicode' => '&#xf01e;', 'styles' => array( 'sow-fas' ), ),
942
- 'redo-alt' => array( 'unicode' => '&#xf2f9;', 'styles' => array( 'sow-fas' ), ),
943
- 'registered' => array( 'unicode' => '&#xf25d;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
944
- 'renren' => array( 'unicode' => '&#xf18b;', 'styles' => array( 'sow-fab' ), ),
945
- 'reply' => array( 'unicode' => '&#xf3e5;', 'styles' => array( 'sow-fas' ), ),
946
- 'reply-all' => array( 'unicode' => '&#xf122;', 'styles' => array( 'sow-fas' ), ),
947
- 'replyd' => array( 'unicode' => '&#xf3e6;', 'styles' => array( 'sow-fab' ), ),
948
- 'republican' => array( 'unicode' => '&#xf75e;', 'styles' => array( 'sow-fas' ), ),
949
- 'researchgate' => array( 'unicode' => '&#xf4f8;', 'styles' => array( 'sow-fab' ), ),
950
- 'resolving' => array( 'unicode' => '&#xf3e7;', 'styles' => array( 'sow-fab' ), ),
951
- 'restroom' => array( 'unicode' => '&#xf7bd;', 'styles' => array( 'sow-fas' ), ),
952
- 'retweet' => array( 'unicode' => '&#xf079;', 'styles' => array( 'sow-fas' ), ),
953
- 'rev' => array( 'unicode' => '&#xf5b2;', 'styles' => array( 'sow-fab' ), ),
954
- 'ribbon' => array( 'unicode' => '&#xf4d6;', 'styles' => array( 'sow-fas' ), ),
955
- 'ring' => array( 'unicode' => '&#xf70b;', 'styles' => array( 'sow-fas' ), ),
956
- 'road' => array( 'unicode' => '&#xf018;', 'styles' => array( 'sow-fas' ), ),
957
- 'robot' => array( 'unicode' => '&#xf544;', 'styles' => array( 'sow-fas' ), ),
958
- 'rocket' => array( 'unicode' => '&#xf135;', 'styles' => array( 'sow-fas' ), ),
959
- 'rocketchat' => array( 'unicode' => '&#xf3e8;', 'styles' => array( 'sow-fab' ), ),
960
- 'rockrms' => array( 'unicode' => '&#xf3e9;', 'styles' => array( 'sow-fab' ), ),
961
- 'route' => array( 'unicode' => '&#xf4d7;', 'styles' => array( 'sow-fas' ), ),
962
- 'rss' => array( 'unicode' => '&#xf09e;', 'styles' => array( 'sow-fas' ), ),
963
- 'rss-square' => array( 'unicode' => '&#xf143;', 'styles' => array( 'sow-fas' ), ),
964
- 'ruble-sign' => array( 'unicode' => '&#xf158;', 'styles' => array( 'sow-fas' ), ),
965
- 'ruler' => array( 'unicode' => '&#xf545;', 'styles' => array( 'sow-fas' ), ),
966
- 'ruler-combined' => array( 'unicode' => '&#xf546;', 'styles' => array( 'sow-fas' ), ),
967
- 'ruler-horizontal' => array( 'unicode' => '&#xf547;', 'styles' => array( 'sow-fas' ), ),
968
- 'ruler-vertical' => array( 'unicode' => '&#xf548;', 'styles' => array( 'sow-fas' ), ),
969
- 'running' => array( 'unicode' => '&#xf70c;', 'styles' => array( 'sow-fas' ), ),
970
- 'rupee-sign' => array( 'unicode' => '&#xf156;', 'styles' => array( 'sow-fas' ), ),
971
- 'sad-cry' => array( 'unicode' => '&#xf5b3;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
972
- 'sad-tear' => array( 'unicode' => '&#xf5b4;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
973
- 'safari' => array( 'unicode' => '&#xf267;', 'styles' => array( 'sow-fab' ), ),
974
- 'sass' => array( 'unicode' => '&#xf41e;', 'styles' => array( 'sow-fab' ), ),
975
- 'satellite' => array( 'unicode' => '&#xf7bf;', 'styles' => array( 'sow-fas' ), ),
976
- 'satellite-dish' => array( 'unicode' => '&#xf7c0;', 'styles' => array( 'sow-fas' ), ),
977
- 'save' => array( 'unicode' => '&#xf0c7;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
978
- 'schlix' => array( 'unicode' => '&#xf3ea;', 'styles' => array( 'sow-fab' ), ),
979
- 'school' => array( 'unicode' => '&#xf549;', 'styles' => array( 'sow-fas' ), ),
980
- 'screwdriver' => array( 'unicode' => '&#xf54a;', 'styles' => array( 'sow-fas' ), ),
981
- 'scribd' => array( 'unicode' => '&#xf28a;', 'styles' => array( 'sow-fab' ), ),
982
- 'scroll' => array( 'unicode' => '&#xf70e;', 'styles' => array( 'sow-fas' ), ),
983
- 'sd-card' => array( 'unicode' => '&#xf7c2;', 'styles' => array( 'sow-fas' ), ),
984
- 'search' => array( 'unicode' => '&#xf002;', 'styles' => array( 'sow-fas' ), ),
985
- 'search-dollar' => array( 'unicode' => '&#xf688;', 'styles' => array( 'sow-fas' ), ),
986
- 'search-location' => array( 'unicode' => '&#xf689;', 'styles' => array( 'sow-fas' ), ),
987
- 'search-minus' => array( 'unicode' => '&#xf010;', 'styles' => array( 'sow-fas' ), ),
988
- 'search-plus' => array( 'unicode' => '&#xf00e;', 'styles' => array( 'sow-fas' ), ),
989
- 'searchengin' => array( 'unicode' => '&#xf3eb;', 'styles' => array( 'sow-fab' ), ),
990
- 'seedling' => array( 'unicode' => '&#xf4d8;', 'styles' => array( 'sow-fas' ), ),
991
- 'sellcast' => array( 'unicode' => '&#xf2da;', 'styles' => array( 'sow-fab' ), ),
992
- 'sellsy' => array( 'unicode' => '&#xf213;', 'styles' => array( 'sow-fab' ), ),
993
- 'server' => array( 'unicode' => '&#xf233;', 'styles' => array( 'sow-fas' ), ),
994
- 'servicestack' => array( 'unicode' => '&#xf3ec;', 'styles' => array( 'sow-fab' ), ),
995
- 'shapes' => array( 'unicode' => '&#xf61f;', 'styles' => array( 'sow-fas' ), ),
996
- 'share' => array( 'unicode' => '&#xf064;', 'styles' => array( 'sow-fas' ), ),
997
- 'share-alt' => array( 'unicode' => '&#xf1e0;', 'styles' => array( 'sow-fas' ), ),
998
- 'share-alt-square' => array( 'unicode' => '&#xf1e1;', 'styles' => array( 'sow-fas' ), ),
999
- 'share-square' => array( 'unicode' => '&#xf14d;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
1000
- 'shekel-sign' => array( 'unicode' => '&#xf20b;', 'styles' => array( 'sow-fas' ), ),
1001
- 'shield-alt' => array( 'unicode' => '&#xf3ed;', 'styles' => array( 'sow-fas' ), ),
1002
- 'ship' => array( 'unicode' => '&#xf21a;', 'styles' => array( 'sow-fas' ), ),
1003
- 'shipping-fast' => array( 'unicode' => '&#xf48b;', 'styles' => array( 'sow-fas' ), ),
1004
- 'shirtsinbulk' => array( 'unicode' => '&#xf214;', 'styles' => array( 'sow-fab' ), ),
1005
- 'shoe-prints' => array( 'unicode' => '&#xf54b;', 'styles' => array( 'sow-fas' ), ),
1006
- 'shopping-bag' => array( 'unicode' => '&#xf290;', 'styles' => array( 'sow-fas' ), ),
1007
- 'shopping-basket' => array( 'unicode' => '&#xf291;', 'styles' => array( 'sow-fas' ), ),
1008
- 'shopping-cart' => array( 'unicode' => '&#xf07a;', 'styles' => array( 'sow-fas' ), ),
1009
- 'shopware' => array( 'unicode' => '&#xf5b5;', 'styles' => array( 'sow-fab' ), ),
1010
- 'shower' => array( 'unicode' => '&#xf2cc;', 'styles' => array( 'sow-fas' ), ),
1011
- 'shuttle-van' => array( 'unicode' => '&#xf5b6;', 'styles' => array( 'sow-fas' ), ),
1012
- 'sign' => array( 'unicode' => '&#xf4d9;', 'styles' => array( 'sow-fas' ), ),
1013
- 'sign-in-alt' => array( 'unicode' => '&#xf2f6;', 'styles' => array( 'sow-fas' ), ),
1014
- 'sign-language' => array( 'unicode' => '&#xf2a7;', 'styles' => array( 'sow-fas' ), ),
1015
- 'sign-out-alt' => array( 'unicode' => '&#xf2f5;', 'styles' => array( 'sow-fas' ), ),
1016
- 'signal' => array( 'unicode' => '&#xf012;', 'styles' => array( 'sow-fas' ), ),
1017
- 'signature' => array( 'unicode' => '&#xf5b7;', 'styles' => array( 'sow-fas' ), ),
1018
- 'sim-card' => array( 'unicode' => '&#xf7c4;', 'styles' => array( 'sow-fas' ), ),
1019
- 'simplybuilt' => array( 'unicode' => '&#xf215;', 'styles' => array( 'sow-fab' ), ),
1020
- 'sistrix' => array( 'unicode' => '&#xf3ee;', 'styles' => array( 'sow-fab' ), ),
1021
- 'sitemap' => array( 'unicode' => '&#xf0e8;', 'styles' => array( 'sow-fas' ), ),
1022
- 'sith' => array( 'unicode' => '&#xf512;', 'styles' => array( 'sow-fab' ), ),
1023
- 'skating' => array( 'unicode' => '&#xf7c5;', 'styles' => array( 'sow-fas' ), ),
1024
- 'sketch' => array( 'unicode' => '&#xf7c6;', 'styles' => array( 'sow-fab' ), ),
1025
- 'skiing' => array( 'unicode' => '&#xf7c9;', 'styles' => array( 'sow-fas' ), ),
1026
- 'skiing-nordic' => array( 'unicode' => '&#xf7ca;', 'styles' => array( 'sow-fas' ), ),
1027
- 'skull' => array( 'unicode' => '&#xf54c;', 'styles' => array( 'sow-fas' ), ),
1028
- 'skull-crossbones' => array( 'unicode' => '&#xf714;', 'styles' => array( 'sow-fas' ), ),
1029
- 'skyatlas' => array( 'unicode' => '&#xf216;', 'styles' => array( 'sow-fab' ), ),
1030
- 'skype' => array( 'unicode' => '&#xf17e;', 'styles' => array( 'sow-fab' ), ),
1031
- 'slack' => array( 'unicode' => '&#xf198;', 'styles' => array( 'sow-fab' ), ),
1032
- 'slack-hash' => array( 'unicode' => '&#xf3ef;', 'styles' => array( 'sow-fab' ), ),
1033
- 'slash' => array( 'unicode' => '&#xf715;', 'styles' => array( 'sow-fas' ), ),
1034
- 'sleigh' => array( 'unicode' => '&#xf7cc;', 'styles' => array( 'sow-fas' ), ),
1035
- 'sliders-h' => array( 'unicode' => '&#xf1de;', 'styles' => array( 'sow-fas' ), ),
1036
- 'slideshare' => array( 'unicode' => '&#xf1e7;', 'styles' => array( 'sow-fab' ), ),
1037
- 'smile' => array( 'unicode' => '&#xf118;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
1038
- 'smile-beam' => array( 'unicode' => '&#xf5b8;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
1039
- 'smile-wink' => array( 'unicode' => '&#xf4da;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
1040
- 'smog' => array( 'unicode' => '&#xf75f;', 'styles' => array( 'sow-fas' ), ),
1041
- 'smoking' => array( 'unicode' => '&#xf48d;', 'styles' => array( 'sow-fas' ), ),
1042
- 'smoking-ban' => array( 'unicode' => '&#xf54d;', 'styles' => array( 'sow-fas' ), ),
1043
- 'sms' => array( 'unicode' => '&#xf7cd;', 'styles' => array( 'sow-fas' ), ),
1044
- 'snapchat' => array( 'unicode' => '&#xf2ab;', 'styles' => array( 'sow-fab' ), ),
1045
- 'snapchat-ghost' => array( 'unicode' => '&#xf2ac;', 'styles' => array( 'sow-fab' ), ),
1046
- 'snapchat-square' => array( 'unicode' => '&#xf2ad;', 'styles' => array( 'sow-fab' ), ),
1047
- 'snowboarding' => array( 'unicode' => '&#xf7ce;', 'styles' => array( 'sow-fas' ), ),
1048
- 'snowflake' => array( 'unicode' => '&#xf2dc;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
1049
- 'snowman' => array( 'unicode' => '&#xf7d0;', 'styles' => array( 'sow-fas' ), ),
1050
- 'snowplow' => array( 'unicode' => '&#xf7d2;', 'styles' => array( 'sow-fas' ), ),
1051
- 'socks' => array( 'unicode' => '&#xf696;', 'styles' => array( 'sow-fas' ), ),
1052
- 'solar-panel' => array( 'unicode' => '&#xf5ba;', 'styles' => array( 'sow-fas' ), ),
1053
- 'sort' => array( 'unicode' => '&#xf0dc;', 'styles' => array( 'sow-fas' ), ),
1054
- 'sort-alpha-down' => array( 'unicode' => '&#xf15d;', 'styles' => array( 'sow-fas' ), ),
1055
- 'sort-alpha-up' => array( 'unicode' => '&#xf15e;', 'styles' => array( 'sow-fas' ), ),
1056
- 'sort-amount-down' => array( 'unicode' => '&#xf160;', 'styles' => array( 'sow-fas' ), ),
1057
- 'sort-amount-up' => array( 'unicode' => '&#xf161;', 'styles' => array( 'sow-fas' ), ),
1058
- 'sort-down' => array( 'unicode' => '&#xf0dd;', 'styles' => array( 'sow-fas' ), ),
1059
- 'sort-numeric-down' => array( 'unicode' => '&#xf162;', 'styles' => array( 'sow-fas' ), ),
1060
- 'sort-numeric-up' => array( 'unicode' => '&#xf163;', 'styles' => array( 'sow-fas' ), ),
1061
- 'sort-up' => array( 'unicode' => '&#xf0de;', 'styles' => array( 'sow-fas' ), ),
1062
- 'soundcloud' => array( 'unicode' => '&#xf1be;', 'styles' => array( 'sow-fab' ), ),
1063
- 'sourcetree' => array( 'unicode' => '&#xf7d3;', 'styles' => array( 'sow-fab' ), ),
1064
- 'spa' => array( 'unicode' => '&#xf5bb;', 'styles' => array( 'sow-fas' ), ),
1065
- 'space-shuttle' => array( 'unicode' => '&#xf197;', 'styles' => array( 'sow-fas' ), ),
1066
- 'speakap' => array( 'unicode' => '&#xf3f3;', 'styles' => array( 'sow-fab' ), ),
1067
- 'spider' => array( 'unicode' => '&#xf717;', 'styles' => array( 'sow-fas' ), ),
1068
- 'spinner' => array( 'unicode' => '&#xf110;', 'styles' => array( 'sow-fas' ), ),
1069
- 'splotch' => array( 'unicode' => '&#xf5bc;', 'styles' => array( 'sow-fas' ), ),
1070
- 'spotify' => array( 'unicode' => '&#xf1bc;', 'styles' => array( 'sow-fab' ), ),
1071
- 'spray-can' => array( 'unicode' => '&#xf5bd;', 'styles' => array( 'sow-fas' ), ),
1072
- 'square' => array( 'unicode' => '&#xf0c8;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
1073
- 'square-full' => array( 'unicode' => '&#xf45c;', 'styles' => array( 'sow-fas' ), ),
1074
- 'square-root-alt' => array( 'unicode' => '&#xf698;', 'styles' => array( 'sow-fas' ), ),
1075
- 'squarespace' => array( 'unicode' => '&#xf5be;', 'styles' => array( 'sow-fab' ), ),
1076
- 'stack-exchange' => array( 'unicode' => '&#xf18d;', 'styles' => array( 'sow-fab' ), ),
1077
- 'stack-overflow' => array( 'unicode' => '&#xf16c;', 'styles' => array( 'sow-fab' ), ),
1078
- 'stamp' => array( 'unicode' => '&#xf5bf;', 'styles' => array( 'sow-fas' ), ),
1079
- 'star' => array( 'unicode' => '&#xf005;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
1080
- 'star-and-crescent' => array( 'unicode' => '&#xf699;', 'styles' => array( 'sow-fas' ), ),
1081
- 'star-half' => array( 'unicode' => '&#xf089;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
1082
- 'star-half-alt' => array( 'unicode' => '&#xf5c0;', 'styles' => array( 'sow-fas' ), ),
1083
- 'star-of-david' => array( 'unicode' => '&#xf69a;', 'styles' => array( 'sow-fas' ), ),
1084
- 'star-of-life' => array( 'unicode' => '&#xf621;', 'styles' => array( 'sow-fas' ), ),
1085
- 'staylinked' => array( 'unicode' => '&#xf3f5;', 'styles' => array( 'sow-fab' ), ),
1086
- 'steam' => array( 'unicode' => '&#xf1b6;', 'styles' => array( 'sow-fab' ), ),
1087
- 'steam-square' => array( 'unicode' => '&#xf1b7;', 'styles' => array( 'sow-fab' ), ),
1088
- 'steam-symbol' => array( 'unicode' => '&#xf3f6;', 'styles' => array( 'sow-fab' ), ),
1089
- 'step-backward' => array( 'unicode' => '&#xf048;', 'styles' => array( 'sow-fas' ), ),
1090
- 'step-forward' => array( 'unicode' => '&#xf051;', 'styles' => array( 'sow-fas' ), ),
1091
- 'stethoscope' => array( 'unicode' => '&#xf0f1;', 'styles' => array( 'sow-fas' ), ),
1092
- 'sticker-mule' => array( 'unicode' => '&#xf3f7;', 'styles' => array( 'sow-fab' ), ),
1093
- 'sticky-note' => array( 'unicode' => '&#xf249;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
1094
- 'stop' => array( 'unicode' => '&#xf04d;', 'styles' => array( 'sow-fas' ), ),
1095
- 'stop-circle' => array( 'unicode' => '&#xf28d;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
1096
- 'stopwatch' => array( 'unicode' => '&#xf2f2;', 'styles' => array( 'sow-fas' ), ),
1097
- 'store' => array( 'unicode' => '&#xf54e;', 'styles' => array( 'sow-fas' ), ),
1098
- 'store-alt' => array( 'unicode' => '&#xf54f;', 'styles' => array( 'sow-fas' ), ),
1099
- 'strava' => array( 'unicode' => '&#xf428;', 'styles' => array( 'sow-fab' ), ),
1100
- 'stream' => array( 'unicode' => '&#xf550;', 'styles' => array( 'sow-fas' ), ),
1101
- 'street-view' => array( 'unicode' => '&#xf21d;', 'styles' => array( 'sow-fas' ), ),
1102
- 'strikethrough' => array( 'unicode' => '&#xf0cc;', 'styles' => array( 'sow-fas' ), ),
1103
- 'stripe' => array( 'unicode' => '&#xf429;', 'styles' => array( 'sow-fab' ), ),
1104
- 'stripe-s' => array( 'unicode' => '&#xf42a;', 'styles' => array( 'sow-fab' ), ),
1105
- 'stroopwafel' => array( 'unicode' => '&#xf551;', 'styles' => array( 'sow-fas' ), ),
1106
- 'studiovinari' => array( 'unicode' => '&#xf3f8;', 'styles' => array( 'sow-fab' ), ),
1107
- 'stumbleupon' => array( 'unicode' => '&#xf1a4;', 'styles' => array( 'sow-fab' ), ),
1108
- 'stumbleupon-circle' => array( 'unicode' => '&#xf1a3;', 'styles' => array( 'sow-fab' ), ),
1109
- 'subscript' => array( 'unicode' => '&#xf12c;', 'styles' => array( 'sow-fas' ), ),
1110
- 'subway' => array( 'unicode' => '&#xf239;', 'styles' => array( 'sow-fas' ), ),
1111
- 'suitcase' => array( 'unicode' => '&#xf0f2;', 'styles' => array( 'sow-fas' ), ),
1112
- 'suitcase-rolling' => array( 'unicode' => '&#xf5c1;', 'styles' => array( 'sow-fas' ), ),
1113
- 'sun' => array( 'unicode' => '&#xf185;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
1114
- 'superpowers' => array( 'unicode' => '&#xf2dd;', 'styles' => array( 'sow-fab' ), ),
1115
- 'superscript' => array( 'unicode' => '&#xf12b;', 'styles' => array( 'sow-fas' ), ),
1116
- 'supple' => array( 'unicode' => '&#xf3f9;', 'styles' => array( 'sow-fab' ), ),
1117
- 'surprise' => array( 'unicode' => '&#xf5c2;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
1118
- 'suse' => array( 'unicode' => '&#xf7d6;', 'styles' => array( 'sow-fab' ), ),
1119
- 'swatchbook' => array( 'unicode' => '&#xf5c3;', 'styles' => array( 'sow-fas' ), ),
1120
- 'swimmer' => array( 'unicode' => '&#xf5c4;', 'styles' => array( 'sow-fas' ), ),
1121
- 'swimming-pool' => array( 'unicode' => '&#xf5c5;', 'styles' => array( 'sow-fas' ), ),
1122
- 'synagogue' => array( 'unicode' => '&#xf69b;', 'styles' => array( 'sow-fas' ), ),
1123
- 'sync' => array( 'unicode' => '&#xf021;', 'styles' => array( 'sow-fas' ), ),
1124
- 'sync-alt' => array( 'unicode' => '&#xf2f1;', 'styles' => array( 'sow-fas' ), ),
1125
- 'syringe' => array( 'unicode' => '&#xf48e;', 'styles' => array( 'sow-fas' ), ),
1126
- 'table' => array( 'unicode' => '&#xf0ce;', 'styles' => array( 'sow-fas' ), ),
1127
- 'table-tennis' => array( 'unicode' => '&#xf45d;', 'styles' => array( 'sow-fas' ), ),
1128
- 'tablet' => array( 'unicode' => '&#xf10a;', 'styles' => array( 'sow-fas' ), ),
1129
- 'tablet-alt' => array( 'unicode' => '&#xf3fa;', 'styles' => array( 'sow-fas' ), ),
1130
- 'tablets' => array( 'unicode' => '&#xf490;', 'styles' => array( 'sow-fas' ), ),
1131
- 'tachometer-alt' => array( 'unicode' => '&#xf3fd;', 'styles' => array( 'sow-fas' ), ),
1132
- 'tag' => array( 'unicode' => '&#xf02b;', 'styles' => array( 'sow-fas' ), ),
1133
- 'tags' => array( 'unicode' => '&#xf02c;', 'styles' => array( 'sow-fas' ), ),
1134
- 'tape' => array( 'unicode' => '&#xf4db;', 'styles' => array( 'sow-fas' ), ),
1135
- 'tasks' => array( 'unicode' => '&#xf0ae;', 'styles' => array( 'sow-fas' ), ),
1136
- 'taxi' => array( 'unicode' => '&#xf1ba;', 'styles' => array( 'sow-fas' ), ),
1137
- 'teamspeak' => array( 'unicode' => '&#xf4f9;', 'styles' => array( 'sow-fab' ), ),
1138
- 'teeth' => array( 'unicode' => '&#xf62e;', 'styles' => array( 'sow-fas' ), ),
1139
- 'teeth-open' => array( 'unicode' => '&#xf62f;', 'styles' => array( 'sow-fas' ), ),
1140
- 'telegram' => array( 'unicode' => '&#xf2c6;', 'styles' => array( 'sow-fab' ), ),
1141
- 'telegram-plane' => array( 'unicode' => '&#xf3fe;', 'styles' => array( 'sow-fab' ), ),
1142
- 'temperature-high' => array( 'unicode' => '&#xf769;', 'styles' => array( 'sow-fas' ), ),
1143
- 'temperature-low' => array( 'unicode' => '&#xf76b;', 'styles' => array( 'sow-fas' ), ),
1144
- 'tencent-weibo' => array( 'unicode' => '&#xf1d5;', 'styles' => array( 'sow-fab' ), ),
1145
- 'tenge' => array( 'unicode' => '&#xf7d7;', 'styles' => array( 'sow-fas' ), ),
1146
- 'terminal' => array( 'unicode' => '&#xf120;', 'styles' => array( 'sow-fas' ), ),
1147
- 'text-height' => array( 'unicode' => '&#xf034;', 'styles' => array( 'sow-fas' ), ),
1148
- 'text-width' => array( 'unicode' => '&#xf035;', 'styles' => array( 'sow-fas' ), ),
1149
- 'th' => array( 'unicode' => '&#xf00a;', 'styles' => array( 'sow-fas' ), ),
1150
- 'th-large' => array( 'unicode' => '&#xf009;', 'styles' => array( 'sow-fas' ), ),
1151
- 'th-list' => array( 'unicode' => '&#xf00b;', 'styles' => array( 'sow-fas' ), ),
1152
- 'the-red-yeti' => array( 'unicode' => '&#xf69d;', 'styles' => array( 'sow-fab' ), ),
1153
- 'theater-masks' => array( 'unicode' => '&#xf630;', 'styles' => array( 'sow-fas' ), ),
1154
- 'themeco' => array( 'unicode' => '&#xf5c6;', 'styles' => array( 'sow-fab' ), ),
1155
- 'themeisle' => array( 'unicode' => '&#xf2b2;', 'styles' => array( 'sow-fab' ), ),
1156
- 'thermometer' => array( 'unicode' => '&#xf491;', 'styles' => array( 'sow-fas' ), ),
1157
- 'thermometer-empty' => array( 'unicode' => '&#xf2cb;', 'styles' => array( 'sow-fas' ), ),
1158
- 'thermometer-full' => array( 'unicode' => '&#xf2c7;', 'styles' => array( 'sow-fas' ), ),
1159
- 'thermometer-half' => array( 'unicode' => '&#xf2c9;', 'styles' => array( 'sow-fas' ), ),
1160
- 'thermometer-quarter' => array( 'unicode' => '&#xf2ca;', 'styles' => array( 'sow-fas' ), ),
1161
- 'thermometer-three-quarters' => array( 'unicode' => '&#xf2c8;', 'styles' => array( 'sow-fas' ), ),
1162
- 'think-peaks' => array( 'unicode' => '&#xf731;', 'styles' => array( 'sow-fab' ), ),
1163
- 'thumbs-down' => array( 'unicode' => '&#xf165;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
1164
- 'thumbs-up' => array( 'unicode' => '&#xf164;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
1165
- 'thumbtack' => array( 'unicode' => '&#xf08d;', 'styles' => array( 'sow-fas' ), ),
1166
- 'ticket-alt' => array( 'unicode' => '&#xf3ff;', 'styles' => array( 'sow-fas' ), ),
1167
- 'times' => array( 'unicode' => '&#xf00d;', 'styles' => array( 'sow-fas' ), ),
1168
- 'times-circle' => array( 'unicode' => '&#xf057;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
1169
- 'tint' => array( 'unicode' => '&#xf043;', 'styles' => array( 'sow-fas' ), ),
1170
- 'tint-slash' => array( 'unicode' => '&#xf5c7;', 'styles' => array( 'sow-fas' ), ),
1171
- 'tired' => array( 'unicode' => '&#xf5c8;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
1172
- 'toggle-off' => array( 'unicode' => '&#xf204;', 'styles' => array( 'sow-fas' ), ),
1173
- 'toggle-on' => array( 'unicode' => '&#xf205;', 'styles' => array( 'sow-fas' ), ),
1174
- 'toilet' => array( 'unicode' => '&#xf7d8;', 'styles' => array( 'sow-fas' ), ),
1175
- 'toilet-paper' => array( 'unicode' => '&#xf71e;', 'styles' => array( 'sow-fas' ), ),
1176
- 'toolbox' => array( 'unicode' => '&#xf552;', 'styles' => array( 'sow-fas' ), ),
1177
- 'tools' => array( 'unicode' => '&#xf7d9;', 'styles' => array( 'sow-fas' ), ),
1178
- 'tooth' => array( 'unicode' => '&#xf5c9;', 'styles' => array( 'sow-fas' ), ),
1179
- 'torah' => array( 'unicode' => '&#xf6a0;', 'styles' => array( 'sow-fas' ), ),
1180
- 'torii-gate' => array( 'unicode' => '&#xf6a1;', 'styles' => array( 'sow-fas' ), ),
1181
- 'tractor' => array( 'unicode' => '&#xf722;', 'styles' => array( 'sow-fas' ), ),
1182
- 'trade-federation' => array( 'unicode' => '&#xf513;', 'styles' => array( 'sow-fab' ), ),
1183
- 'trademark' => array( 'unicode' => '&#xf25c;', 'styles' => array( 'sow-fas' ), ),
1184
- 'traffic-light' => array( 'unicode' => '&#xf637;', 'styles' => array( 'sow-fas' ), ),
1185
- 'train' => array( 'unicode' => '&#xf238;', 'styles' => array( 'sow-fas' ), ),
1186
- 'tram' => array( 'unicode' => '&#xf7da;', 'styles' => array( 'sow-fas' ), ),
1187
- 'transgender' => array( 'unicode' => '&#xf224;', 'styles' => array( 'sow-fas' ), ),
1188
- 'transgender-alt' => array( 'unicode' => '&#xf225;', 'styles' => array( 'sow-fas' ), ),
1189
- 'trash' => array( 'unicode' => '&#xf1f8;', 'styles' => array( 'sow-fas' ), ),
1190
- 'trash-alt' => array( 'unicode' => '&#xf2ed;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
1191
- 'tree' => array( 'unicode' => '&#xf1bb;', 'styles' => array( 'sow-fas' ), ),
1192
- 'trello' => array( 'unicode' => '&#xf181;', 'styles' => array( 'sow-fab' ), ),
1193
- 'tripadvisor' => array( 'unicode' => '&#xf262;', 'styles' => array( 'sow-fab' ), ),
1194
- 'trophy' => array( 'unicode' => '&#xf091;', 'styles' => array( 'sow-fas' ), ),
1195
- 'truck' => array( 'unicode' => '&#xf0d1;', 'styles' => array( 'sow-fas' ), ),
1196
- 'truck-loading' => array( 'unicode' => '&#xf4de;', 'styles' => array( 'sow-fas' ), ),
1197
- 'truck-monster' => array( 'unicode' => '&#xf63b;', 'styles' => array( 'sow-fas' ), ),
1198
- 'truck-moving' => array( 'unicode' => '&#xf4df;', 'styles' => array( 'sow-fas' ), ),
1199
- 'truck-pickup' => array( 'unicode' => '&#xf63c;', 'styles' => array( 'sow-fas' ), ),
1200
- 'tshirt' => array( 'unicode' => '&#xf553;', 'styles' => array( 'sow-fas' ), ),
1201
- 'tty' => array( 'unicode' => '&#xf1e4;', 'styles' => array( 'sow-fas' ), ),
1202
- 'tumblr' => array( 'unicode' => '&#xf173;', 'styles' => array( 'sow-fab' ), ),
1203
- 'tumblr-square' => array( 'unicode' => '&#xf174;', 'styles' => array( 'sow-fab' ), ),
1204
- 'tv' => array( 'unicode' => '&#xf26c;', 'styles' => array( 'sow-fas' ), ),
1205
- 'twitch' => array( 'unicode' => '&#xf1e8;', 'styles' => array( 'sow-fab' ), ),
1206
- 'twitter' => array( 'unicode' => '&#xf099;', 'styles' => array( 'sow-fab' ), ),
1207
- 'twitter-square' => array( 'unicode' => '&#xf081;', 'styles' => array( 'sow-fab' ), ),
1208
- 'typo3' => array( 'unicode' => '&#xf42b;', 'styles' => array( 'sow-fab' ), ),
1209
- 'uber' => array( 'unicode' => '&#xf402;', 'styles' => array( 'sow-fab' ), ),
1210
- 'ubuntu' => array( 'unicode' => '&#xf7df;', 'styles' => array( 'sow-fab' ), ),
1211
- 'uikit' => array( 'unicode' => '&#xf403;', 'styles' => array( 'sow-fab' ), ),
1212
- 'umbrella' => array( 'unicode' => '&#xf0e9;', 'styles' => array( 'sow-fas' ), ),
1213
- 'umbrella-beach' => array( 'unicode' => '&#xf5ca;', 'styles' => array( 'sow-fas' ), ),
1214
- 'underline' => array( 'unicode' => '&#xf0cd;', 'styles' => array( 'sow-fas' ), ),
1215
- 'undo' => array( 'unicode' => '&#xf0e2;', 'styles' => array( 'sow-fas' ), ),
1216
- 'undo-alt' => array( 'unicode' => '&#xf2ea;', 'styles' => array( 'sow-fas' ), ),
1217
- 'uniregistry' => array( 'unicode' => '&#xf404;', 'styles' => array( 'sow-fab' ), ),
1218
- 'universal-access' => array( 'unicode' => '&#xf29a;', 'styles' => array( 'sow-fas' ), ),
1219
- 'university' => array( 'unicode' => '&#xf19c;', 'styles' => array( 'sow-fas' ), ),
1220
- 'unlink' => array( 'unicode' => '&#xf127;', 'styles' => array( 'sow-fas' ), ),
1221
- 'unlock' => array( 'unicode' => '&#xf09c;', 'styles' => array( 'sow-fas' ), ),
1222
- 'unlock-alt' => array( 'unicode' => '&#xf13e;', 'styles' => array( 'sow-fas' ), ),
1223
- 'untappd' => array( 'unicode' => '&#xf405;', 'styles' => array( 'sow-fab' ), ),
1224
- 'upload' => array( 'unicode' => '&#xf093;', 'styles' => array( 'sow-fas' ), ),
1225
- 'ups' => array( 'unicode' => '&#xf7e0;', 'styles' => array( 'sow-fab' ), ),
1226
- 'usb' => array( 'unicode' => '&#xf287;', 'styles' => array( 'sow-fab' ), ),
1227
- 'user' => array( 'unicode' => '&#xf007;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
1228
- 'user-alt' => array( 'unicode' => '&#xf406;', 'styles' => array( 'sow-fas' ), ),
1229
- 'user-alt-slash' => array( 'unicode' => '&#xf4fa;', 'styles' => array( 'sow-fas' ), ),
1230
- 'user-astronaut' => array( 'unicode' => '&#xf4fb;', 'styles' => array( 'sow-fas' ), ),
1231
- 'user-check' => array( 'unicode' => '&#xf4fc;', 'styles' => array( 'sow-fas' ), ),
1232
- 'user-circle' => array( 'unicode' => '&#xf2bd;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
1233
- 'user-clock' => array( 'unicode' => '&#xf4fd;', 'styles' => array( 'sow-fas' ), ),
1234
- 'user-cog' => array( 'unicode' => '&#xf4fe;', 'styles' => array( 'sow-fas' ), ),
1235
- 'user-edit' => array( 'unicode' => '&#xf4ff;', 'styles' => array( 'sow-fas' ), ),
1236
- 'user-friends' => array( 'unicode' => '&#xf500;', 'styles' => array( 'sow-fas' ), ),
1237
- 'user-graduate' => array( 'unicode' => '&#xf501;', 'styles' => array( 'sow-fas' ), ),
1238
- 'user-injured' => array( 'unicode' => '&#xf728;', 'styles' => array( 'sow-fas' ), ),
1239
- 'user-lock' => array( 'unicode' => '&#xf502;', 'styles' => array( 'sow-fas' ), ),
1240
- 'user-md' => array( 'unicode' => '&#xf0f0;', 'styles' => array( 'sow-fas' ), ),
1241
- 'user-minus' => array( 'unicode' => '&#xf503;', 'styles' => array( 'sow-fas' ), ),
1242
- 'user-ninja' => array( 'unicode' => '&#xf504;', 'styles' => array( 'sow-fas' ), ),
1243
- 'user-plus' => array( 'unicode' => '&#xf234;', 'styles' => array( 'sow-fas' ), ),
1244
- 'user-secret' => array( 'unicode' => '&#xf21b;', 'styles' => array( 'sow-fas' ), ),
1245
- 'user-shield' => array( 'unicode' => '&#xf505;', 'styles' => array( 'sow-fas' ), ),
1246
- 'user-slash' => array( 'unicode' => '&#xf506;', 'styles' => array( 'sow-fas' ), ),
1247
- 'user-tag' => array( 'unicode' => '&#xf507;', 'styles' => array( 'sow-fas' ), ),
1248
- 'user-tie' => array( 'unicode' => '&#xf508;', 'styles' => array( 'sow-fas' ), ),
1249
- 'user-times' => array( 'unicode' => '&#xf235;', 'styles' => array( 'sow-fas' ), ),
1250
- 'users' => array( 'unicode' => '&#xf0c0;', 'styles' => array( 'sow-fas' ), ),
1251
- 'users-cog' => array( 'unicode' => '&#xf509;', 'styles' => array( 'sow-fas' ), ),
1252
- 'usps' => array( 'unicode' => '&#xf7e1;', 'styles' => array( 'sow-fab' ), ),
1253
- 'ussunnah' => array( 'unicode' => '&#xf407;', 'styles' => array( 'sow-fab' ), ),
1254
- 'utensil-spoon' => array( 'unicode' => '&#xf2e5;', 'styles' => array( 'sow-fas' ), ),
1255
- 'utensils' => array( 'unicode' => '&#xf2e7;', 'styles' => array( 'sow-fas' ), ),
1256
- 'vaadin' => array( 'unicode' => '&#xf408;', 'styles' => array( 'sow-fab' ), ),
1257
- 'vector-square' => array( 'unicode' => '&#xf5cb;', 'styles' => array( 'sow-fas' ), ),
1258
- 'venus' => array( 'unicode' => '&#xf221;', 'styles' => array( 'sow-fas' ), ),
1259
- 'venus-double' => array( 'unicode' => '&#xf226;', 'styles' => array( 'sow-fas' ), ),
1260
- 'venus-mars' => array( 'unicode' => '&#xf228;', 'styles' => array( 'sow-fas' ), ),
1261
- 'viacoin' => array( 'unicode' => '&#xf237;', 'styles' => array( 'sow-fab' ), ),
1262
- 'viadeo' => array( 'unicode' => '&#xf2a9;', 'styles' => array( 'sow-fab' ), ),
1263
- 'viadeo-square' => array( 'unicode' => '&#xf2aa;', 'styles' => array( 'sow-fab' ), ),
1264
- 'vial' => array( 'unicode' => '&#xf492;', 'styles' => array( 'sow-fas' ), ),
1265
- 'vials' => array( 'unicode' => '&#xf493;', 'styles' => array( 'sow-fas' ), ),
1266
- 'viber' => array( 'unicode' => '&#xf409;', 'styles' => array( 'sow-fab' ), ),
1267
- 'video' => array( 'unicode' => '&#xf03d;', 'styles' => array( 'sow-fas' ), ),
1268
- 'video-slash' => array( 'unicode' => '&#xf4e2;', 'styles' => array( 'sow-fas' ), ),
1269
- 'vihara' => array( 'unicode' => '&#xf6a7;', 'styles' => array( 'sow-fas' ), ),
1270
- 'vimeo' => array( 'unicode' => '&#xf40a;', 'styles' => array( 'sow-fab' ), ),
1271
- 'vimeo-square' => array( 'unicode' => '&#xf194;', 'styles' => array( 'sow-fab' ), ),
1272
- 'vimeo-v' => array( 'unicode' => '&#xf27d;', 'styles' => array( 'sow-fab' ), ),
1273
- 'vine' => array( 'unicode' => '&#xf1ca;', 'styles' => array( 'sow-fab' ), ),
1274
- 'vk' => array( 'unicode' => '&#xf189;', 'styles' => array( 'sow-fab' ), ),
1275
- 'vnv' => array( 'unicode' => '&#xf40b;', 'styles' => array( 'sow-fab' ), ),
1276
- 'volleyball-ball' => array( 'unicode' => '&#xf45f;', 'styles' => array( 'sow-fas' ), ),
1277
- 'volume-down' => array( 'unicode' => '&#xf027;', 'styles' => array( 'sow-fas' ), ),
1278
- 'volume-mute' => array( 'unicode' => '&#xf6a9;', 'styles' => array( 'sow-fas' ), ),
1279
- 'volume-off' => array( 'unicode' => '&#xf026;', 'styles' => array( 'sow-fas' ), ),
1280
- 'volume-up' => array( 'unicode' => '&#xf028;', 'styles' => array( 'sow-fas' ), ),
1281
- 'vote-yea' => array( 'unicode' => '&#xf772;', 'styles' => array( 'sow-fas' ), ),
1282
- 'vr-cardboard' => array( 'unicode' => '&#xf729;', 'styles' => array( 'sow-fas' ), ),
1283
- 'vuejs' => array( 'unicode' => '&#xf41f;', 'styles' => array( 'sow-fab' ), ),
1284
- 'walking' => array( 'unicode' => '&#xf554;', 'styles' => array( 'sow-fas' ), ),
1285
- 'wallet' => array( 'unicode' => '&#xf555;', 'styles' => array( 'sow-fas' ), ),
1286
- 'warehouse' => array( 'unicode' => '&#xf494;', 'styles' => array( 'sow-fas' ), ),
1287
- 'water' => array( 'unicode' => '&#xf773;', 'styles' => array( 'sow-fas' ), ),
1288
- 'weebly' => array( 'unicode' => '&#xf5cc;', 'styles' => array( 'sow-fab' ), ),
1289
- 'weibo' => array( 'unicode' => '&#xf18a;', 'styles' => array( 'sow-fab' ), ),
1290
- 'weight' => array( 'unicode' => '&#xf496;', 'styles' => array( 'sow-fas' ), ),
1291
- 'weight-hanging' => array( 'unicode' => '&#xf5cd;', 'styles' => array( 'sow-fas' ), ),
1292
- 'weixin' => array( 'unicode' => '&#xf1d7;', 'styles' => array( 'sow-fab' ), ),
1293
- 'whatsapp' => array( 'unicode' => '&#xf232;', 'styles' => array( 'sow-fab' ), ),
1294
- 'whatsapp-square' => array( 'unicode' => '&#xf40c;', 'styles' => array( 'sow-fab' ), ),
1295
- 'wheelchair' => array( 'unicode' => '&#xf193;', 'styles' => array( 'sow-fas' ), ),
1296
- 'whmcs' => array( 'unicode' => '&#xf40d;', 'styles' => array( 'sow-fab' ), ),
1297
- 'wifi' => array( 'unicode' => '&#xf1eb;', 'styles' => array( 'sow-fas' ), ),
1298
- 'wikipedia-w' => array( 'unicode' => '&#xf266;', 'styles' => array( 'sow-fab' ), ),
1299
- 'wind' => array( 'unicode' => '&#xf72e;', 'styles' => array( 'sow-fas' ), ),
1300
- 'window-close' => array( 'unicode' => '&#xf410;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
1301
- 'window-maximize' => array( 'unicode' => '&#xf2d0;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
1302
- 'window-minimize' => array( 'unicode' => '&#xf2d1;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
1303
- 'window-restore' => array( 'unicode' => '&#xf2d2;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
1304
- 'windows' => array( 'unicode' => '&#xf17a;', 'styles' => array( 'sow-fab' ), ),
1305
- 'wine-bottle' => array( 'unicode' => '&#xf72f;', 'styles' => array( 'sow-fas' ), ),
1306
- 'wine-glass' => array( 'unicode' => '&#xf4e3;', 'styles' => array( 'sow-fas' ), ),
1307
- 'wine-glass-alt' => array( 'unicode' => '&#xf5ce;', 'styles' => array( 'sow-fas' ), ),
1308
- 'wix' => array( 'unicode' => '&#xf5cf;', 'styles' => array( 'sow-fab' ), ),
1309
- 'wizards-of-the-coast' => array( 'unicode' => '&#xf730;', 'styles' => array( 'sow-fab' ), ),
1310
- 'wolf-pack-battalion' => array( 'unicode' => '&#xf514;', 'styles' => array( 'sow-fab' ), ),
1311
- 'won-sign' => array( 'unicode' => '&#xf159;', 'styles' => array( 'sow-fas' ), ),
1312
- 'wordpress' => array( 'unicode' => '&#xf19a;', 'styles' => array( 'sow-fab' ), ),
1313
- 'wordpress-simple' => array( 'unicode' => '&#xf411;', 'styles' => array( 'sow-fab' ), ),
1314
- 'wpbeginner' => array( 'unicode' => '&#xf297;', 'styles' => array( 'sow-fab' ), ),
1315
- 'wpexplorer' => array( 'unicode' => '&#xf2de;', 'styles' => array( 'sow-fab' ), ),
1316
- 'wpforms' => array( 'unicode' => '&#xf298;', 'styles' => array( 'sow-fab' ), ),
1317
- 'wpressr' => array( 'unicode' => '&#xf3e4;', 'styles' => array( 'sow-fab' ), ),
1318
- 'wrench' => array( 'unicode' => '&#xf0ad;', 'styles' => array( 'sow-fas' ), ),
1319
- 'x-ray' => array( 'unicode' => '&#xf497;', 'styles' => array( 'sow-fas' ), ),
1320
- 'xbox' => array( 'unicode' => '&#xf412;', 'styles' => array( 'sow-fab' ), ),
1321
- 'xing' => array( 'unicode' => '&#xf168;', 'styles' => array( 'sow-fab' ), ),
1322
- 'xing-square' => array( 'unicode' => '&#xf169;', 'styles' => array( 'sow-fab' ), ),
1323
- 'y-combinator' => array( 'unicode' => '&#xf23b;', 'styles' => array( 'sow-fab' ), ),
1324
- 'yahoo' => array( 'unicode' => '&#xf19e;', 'styles' => array( 'sow-fab' ), ),
1325
- 'yandex' => array( 'unicode' => '&#xf413;', 'styles' => array( 'sow-fab' ), ),
1326
- 'yandex-international' => array( 'unicode' => '&#xf414;', 'styles' => array( 'sow-fab' ), ),
1327
- 'yarn' => array( 'unicode' => '&#xf7e3;', 'styles' => array( 'sow-fab' ), ),
1328
- 'yelp' => array( 'unicode' => '&#xf1e9;', 'styles' => array( 'sow-fab' ), ),
1329
- 'yen-sign' => array( 'unicode' => '&#xf157;', 'styles' => array( 'sow-fas' ), ),
1330
- 'yin-yang' => array( 'unicode' => '&#xf6ad;', 'styles' => array( 'sow-fas' ), ),
1331
- 'yoast' => array( 'unicode' => '&#xf2b1;', 'styles' => array( 'sow-fab' ), ),
1332
- 'youtube' => array( 'unicode' => '&#xf167;', 'styles' => array( 'sow-fab' ), ),
1333
- 'youtube-square' => array( 'unicode' => '&#xf431;', 'styles' => array( 'sow-fab' ), ),
1334
- 'zhihu' => array( 'unicode' => '&#xf63f;', 'styles' => array( 'sow-fab' ), ),
1335
- ));
1336
- }
1337
- add_filter('siteorigin_widgets_icons_fontawesome', 'siteorigin_widgets_icons_fontawesome_filter');
1338
-
1339
- function siteorigin_widgets_icon_styles_fontawesome_filter( $styles ) {
1340
- return array_merge( $styles, array(
1341
- 'sow-fab' => __( 'Brands', 'so-widgets-bundle' ),
1342
- 'sow-far' => __( 'Regular', 'so-widgets-bundle' ),
1343
- 'sow-fas' => __( 'Solid', 'so-widgets-bundle' ),
1344
- ) );
1345
- }
1346
-
1347
- add_filter('siteorigin_widgets_icon_styles_fontawesome', 'siteorigin_widgets_icon_styles_fontawesome_filter');
1348
-
1349
- function siteorigin_widgets_icon_migrate_fontawesome( $icon_data ) {
1350
-
1351
- // Previous versions of FontAwesome didn't use 'style'.
1352
- if ( ! empty( $icon_data ) && ! isset( $icon_data['style'] ) ) {
1353
-
1354
- $name_map = siteorigin_widgets_icon_migrate_fontawesome_name_map();
1355
-
1356
- if ( isset( $name_map[ $icon_data['icon'] ] ) ) {
1357
- if ( preg_match( '/\-o\b/', $icon_data['icon'] ) ) {
1358
- $icon_data['style'] = 'sow-far';
1359
- }
1360
- $icon_data['icon'] = $name_map[ $icon_data['icon'] ];
1361
- }
1362
- if ( empty( $icon_data['style'] ) ) {
1363
- $icons = apply_filters( 'siteorigin_widgets_icons_fontawesome', array() );
1364
- if ( ! empty( $icons[ $icon_data['icon'] ] ) && ! empty( $icons[ $icon_data['icon'] ]['styles'] ) ) {
1365
- $icon_data['style'] = $icons[ $icon_data['icon'] ]['styles'][0];
1366
- } else {
1367
- $icon_data['style'] = 'sow-fas';
1368
- }
1369
- }
1370
- }
1371
- return $icon_data;
1372
- }
1373
-
1374
- add_filter( 'siteorigin_widgets_icon_migrate_fontawesome', 'siteorigin_widgets_icon_migrate_fontawesome' );
1375
-
1376
- function siteorigin_widgets_icon_migrate_fontawesome_name_map() {
1377
- return array(
1378
- 'address-book-o' => 'address-book',
1379
- 'address-card-o' => 'address-card',
1380
- 'area-chart' => 'chart-area',
1381
- 'arrow-circle-o-down' => 'arrow-alt-circle-down',
1382
- 'arrow-circle-o-left' => 'arrow-alt-circle-left',
1383
- 'arrow-circle-o-right' => 'arrow-alt-circle-right',
1384
- 'arrow-circle-o-up' => 'arrow-alt-circle-up',
1385
- 'arrows' => 'arrows-alt',
1386
- 'arrows-alt' => 'expand-arrows-alt',
1387
- 'arrows-h' => 'arrows-alt-h',
1388
- 'arrows-v' => 'arrows-alt-v',
1389
- 'asl-interpreting' => 'american-sign-language-interpreting',
1390
- 'automobile' => 'car',
1391
- 'bank' => 'university',
1392
- 'bar-chart' => 'chart-bar',
1393
- 'bar-chart-o' => 'chart-bar',
1394
- 'bathtub' => 'bath',
1395
- 'battery' => 'battery-full',
1396
- 'battery-0' => 'battery-empty',
1397
- 'battery-1' => 'battery-quarter',
1398
- 'battery-2' => 'battery-half',
1399
- 'battery-3' => 'battery-three-quarters',
1400
- 'battery-4' => 'battery-full',
1401
- 'bell-o' => 'bell',
1402
- 'bell-slash-o' => 'bell-slash',
1403
- 'bitbucket-square' => 'bitbucket',
1404
- 'bitcoin' => 'btc',
1405
- 'bookmark-o' => 'bookmark',
1406
- 'building-o' => 'building',
1407
- 'cab' => 'taxi',
1408
- 'calendar' => 'calendar-alt',
1409
- 'calendar-check-o' => 'calendar-check',
1410
- 'calendar-minus-o' => 'calendar-minus',
1411
- 'calendar-o' => 'calendar',
1412
- 'calendar-plus-o' => 'calendar-plus',
1413
- 'calendar-times-o' => 'calendar-times',
1414
- 'caret-square-o-down' => 'caret-square-down',
1415
- 'caret-square-o-left' => 'caret-square-left',
1416
- 'caret-square-o-right' => 'caret-square-right',
1417
- 'caret-square-o-up' => 'caret-square-up',
1418
- 'cc' => 'closed-captioning',
1419
- 'chain' => 'link',
1420
- 'chain-broken' => 'unlink',
1421
- 'check-circle-o' => 'check-circle',
1422
- 'check-square-o' => 'check-square',
1423
- 'circle-o' => 'circle',
1424
- 'circle-o-notch' => 'circle-notch',
1425
- 'circle-thin' => 'circle',
1426
- 'clock-o' => 'clock',
1427
- 'close' => 'times',
1428
- 'cloud-download' => 'cloud-download-alt',
1429
- 'cloud-upload' => 'cloud-upload-alt',
1430
- 'cny' => 'yen-sign',
1431
- 'code-fork' => 'code-branch',
1432
- 'comment-o' => 'comment',
1433
- 'commenting' => 'comment-dots',
1434
- 'commenting-o' => 'comment-dots',
1435
- 'comments-o' => 'comments',
1436
- 'credit-card-alt' => 'credit-card',
1437
- 'cutlery' => 'utensils',
1438
- 'dashboard' => 'tachometer-alt',
1439
- 'deafness' => 'deaf',
1440
- 'dedent' => 'outdent',
1441
- 'diamond' => 'gem',
1442
- 'dollar' => 'dollar-sign',
1443
- 'dot-circle-o' => 'dot-circle',
1444
- 'drivers-license' => 'id-card',
1445
- 'drivers-license-o' => 'id-card',
1446
- 'eercast' => 'sellcast',
1447
- 'envelope-o' => 'envelope',
1448
- 'envelope-open-o' => 'envelope-open',
1449
- 'eur' => 'euro-sign',
1450
- 'euro' => 'euro-sign',
1451
- 'exchange' => 'exchange-alt',
1452
- 'external-link' => 'external-link-alt',
1453
- 'external-link-square' => 'external-link-square-alt',
1454
- 'eyedropper' => 'eye-dropper',
1455
- 'fa' => 'font-awesome',
1456
- 'facebook' => 'facebook-f',
1457
- 'facebook-official' => 'facebook',
1458
- 'feed' => 'rss',
1459
- 'file-archive-o' => 'file-archive',
1460
- 'file-audio-o' => 'file-audio',
1461
- 'file-code-o' => 'file-code',
1462
- 'file-excel-o' => 'file-excel',
1463
- 'file-image-o' => 'file-image',
1464
- 'file-movie-o' => 'file-video',
1465
- 'file-o' => 'file',
1466
- 'file-pdf-o' => 'file-pdf',
1467
- 'file-photo-o' => 'file-image',
1468
- 'file-picture-o' => 'file-image',
1469
- 'file-powerpoint-o' => 'file-powerpoint',
1470
- 'file-sound-o' => 'file-audio',
1471
- 'file-text' => 'file-alt',
1472
- 'file-text-o' => 'file-alt',
1473
- 'file-video-o' => 'file-video',
1474
- 'file-word-o' => 'file-word',
1475
- 'file-zip-o' => 'file-archive',
1476
- 'files-o' => 'copy',
1477
- 'flag-o' => 'flag',
1478
- 'flash' => 'bolt',
1479
- 'floppy-o' => 'save',
1480
- 'folder-o' => 'folder',
1481
- 'folder-open-o' => 'folder-open',
1482
- 'frown-o' => 'frown',
1483
- 'futbol-o' => 'futbol',
1484
- 'gbp' => 'pound-sign',
1485
- 'ge' => 'empire',
1486
- 'gear' => 'cog',
1487
- 'gears' => 'cogs',
1488
- 'gittip' => 'gratipay',
1489
- 'glass' => 'glass-martini',
1490
- 'google-plus' => 'google-plus-g',
1491
- 'google-plus-circle' => 'google-plus',
1492
- 'google-plus-official' => 'google-plus',
1493
- 'google-plus-square' => 'google-plus-square',
1494
- 'group' => 'users',
1495
- 'hand-grab-o' => 'hand-rock',
1496
- 'hand-lizard-o' => 'hand-lizard',
1497
- 'hand-o-down' => 'hand-point-down',
1498
- 'hand-o-left' => 'hand-point-left',
1499
- 'hand-o-right' => 'hand-point-right',
1500
- 'hand-o-up' => 'hand-point-up',
1501
- 'hand-paper-o' => 'hand-paper',
1502
- 'hand-peace-o' => 'hand-peace',
1503
- 'hand-pointer-o' => 'hand-pointer',
1504
- 'hand-rock-o' => 'hand-rock',
1505
- 'hand-scissors-o' => 'hand-scissors',
1506
- 'hand-spock-o' => 'hand-spock',
1507
- 'hand-stop-o' => 'hand-paper',
1508
- 'handshake-o' => 'handshake',
1509
- 'hard-of-hearing' => 'deaf',
1510
- 'hdd-o' => 'hdd',
1511
- 'header' => 'heading',
1512
- 'heart-o' => 'heart',
1513
- 'hospital-o' => 'hospital',
1514
- 'hotel' => 'bed',
1515
- 'hourglass-1' => 'hourglass-start',
1516
- 'hourglass-2' => 'hourglass-half',
1517
- 'hourglass-3' => 'hourglass-end',
1518
- 'hourglass-o' => 'hourglass',
1519
- 'id-card-o' => 'id-card',
1520
- 'ils' => 'shekel-sign',
1521
- 'inr' => 'rupee-sign',
1522
- 'institution' => 'university',
1523
- 'intersex' => 'transgender',
1524
- 'jpy' => 'yen-sign',
1525
- 'keyboard-o' => 'keyboard',
1526
- 'krw' => 'won-sign',
1527
- 'legal' => 'gavel',
1528
- 'lemon-o' => 'lemon',
1529
- 'level-down' => 'level-down-alt',
1530
- 'level-up' => 'level-up-alt',
1531
- 'life-bouy' => 'life-ring',
1532
- 'life-buoy' => 'life-ring',
1533
- 'life-saver' => 'life-ring',
1534
- 'lightbulb-o' => 'lightbulb',
1535
- 'line-chart' => 'chart-line',
1536
- 'linkedin' => 'linkedin-in',
1537
- 'linkedin-square' => 'linkedin',
1538
- 'long-arrow-down' => 'long-arrow-alt-down',
1539
- 'long-arrow-left' => 'long-arrow-alt-left',
1540
- 'long-arrow-right' => 'long-arrow-alt-right',
1541
- 'long-arrow-up' => 'long-arrow-alt-up',
1542
- 'mail-forward' => 'share',
1543
- 'mail-reply' => 'reply',
1544
- 'mail-reply-all' => 'reply-all',
1545
- 'map-marker' => 'map-marker-alt',
1546
- 'map-o' => 'map',
1547
- 'meanpath' => 'font-awesome',
1548
- 'meh-o' => 'meh',
1549
- 'minus-square-o' => 'minus-square',
1550
- 'mobile' => 'mobile-alt',
1551
- 'mobile-phone' => 'mobile-alt',
1552
- 'money' => 'money-bill-alt',
1553
- 'moon-o' => 'moon',
1554
- 'mortar-board' => 'graduation-cap',
1555
- 'navicon' => 'bars',
1556
- 'newspaper-o' => 'newspaper',
1557
- 'paper-plane-o' => 'paper-plane',
1558
- 'paste' => 'clipboard',
1559
- 'pause-circle-o' => 'pause-circle',
1560
- 'pencil' => 'pencil-alt',
1561
- 'pencil-square' => 'pen-square',
1562
- 'pencil-square-o' => 'edit',
1563
- 'photo' => 'image',
1564
- 'picture-o' => 'image',
1565
- 'pie-chart' => 'chart-pie',
1566
- 'play-circle-o' => 'play-circle',
1567
- 'plus-square-o' => 'plus-square',
1568
- 'question-circle-o' => 'question-circle',
1569
- 'ra' => 'rebel',
1570
- 'refresh' => 'sync',
1571
- 'remove' => 'times',
1572
- 'reorder' => 'bars',
1573
- 'repeat' => 'redo',
1574
- 'resistance' => 'rebel',
1575
- 'rmb' => 'yen-sign',
1576
- 'rotate-left' => 'undo',
1577
- 'rotate-right' => 'redo',
1578
- 'rouble' => 'ruble-sign',
1579
- 'rub' => 'ruble-sign',
1580
- 'ruble' => 'ruble-sign',
1581
- 'rupee' => 'rupee-sign',
1582
- 's15' => 'bath',
1583
- 'scissors' => 'cut',
1584
- 'send' => 'paper-plane',
1585
- 'send-o' => 'paper-plane',
1586
- 'share-square-o' => 'share-square',
1587
- 'shekel' => 'shekel-sign',
1588
- 'sheqel' => 'shekel-sign',
1589
- 'shield' => 'shield-alt',
1590
- 'sign-in' => 'sign-in-alt',
1591
- 'sign-out' => 'sign-out-alt',
1592
- 'signing' => 'sign-language',
1593
- 'sliders' => 'sliders-h',
1594
- 'smile-o' => 'smile',
1595
- 'snowflake-o' => 'snowflake',
1596
- 'soccer-ball-o' => 'futbol',
1597
- 'sort-alpha-asc' => 'sort-alpha-down',
1598
- 'sort-alpha-desc' => 'sort-alpha-up',
1599
- 'sort-amount-asc' => 'sort-amount-down',
1600
- 'sort-amount-desc' => 'sort-amount-up',
1601
- 'sort-asc' => 'sort-up',
1602
- 'sort-desc' => 'sort-down',
1603
- 'sort-numeric-asc' => 'sort-numeric-down',
1604
- 'sort-numeric-desc' => 'sort-numeric-up',
1605
- 'spoon' => 'utensil-spoon',
1606
- 'square-o' => 'square',
1607
- 'star-half-empty' => 'star-half',
1608
- 'star-half-full' => 'star-half',
1609
- 'star-half-o' => 'star-half',
1610
- 'star-o' => 'star',
1611
- 'sticky-note-o' => 'sticky-note',
1612
- 'stop-circle-o' => 'stop-circle',
1613
- 'sun-o' => 'sun',
1614
- 'support' => 'life-ring',
1615
- 'tablet' => 'tablet-alt',
1616
- 'tachometer' => 'tachometer-alt',
1617
- 'television' => 'tv',
1618
- 'thermometer' => 'thermometer-full',
1619
- 'thermometer-0' => 'thermometer-empty',
1620
- 'thermometer-1' => 'thermometer-quarter',
1621
- 'thermometer-2' => 'thermometer-half',
1622
- 'thermometer-3' => 'thermometer-three-quarters',
1623
- 'thermometer-4' => 'thermometer-full',
1624
- 'thumb-tack' => 'thumbtack',
1625
- 'thumbs-o-down' => 'thumbs-down',
1626
- 'thumbs-o-up' => 'thumbs-up',
1627
- 'ticket' => 'ticket-alt',
1628
- 'times-circle-o' => 'times-circle',
1629
- 'times-rectangle' => 'window-close',
1630
- 'times-rectangle-o' => 'window-close',
1631
- 'toggle-down' => 'caret-square-down',
1632
- 'toggle-left' => 'caret-square-left',
1633
- 'toggle-right' => 'caret-square-right',
1634
- 'toggle-up' => 'caret-square-up',
1635
- 'trash' => 'trash-alt',
1636
- 'trash-o' => 'trash-alt',
1637
- 'try' => 'lira-sign',
1638
- 'turkish-lira' => 'lira-sign',
1639
- 'unsorted' => 'sort',
1640
- 'usd' => 'dollar-sign',
1641
- 'user-circle-o' => 'user-circle',
1642
- 'user-o' => 'user',
1643
- 'vcard' => 'address-card',
1644
- 'vcard-o' => 'address-card',
1645
- 'video-camera' => 'video',
1646
- 'vimeo' => 'vimeo-v',
1647
- 'volume-control-phone' => 'phone-volume',
1648
- 'warning' => 'exclamation-triangle',
1649
- 'wechat' => 'weixin',
1650
- 'wheelchair-alt' => 'accessible-icon',
1651
- 'window-close-o' => 'window-close',
1652
- 'won' => 'won-sign',
1653
- 'y-combinator-square' => 'hacker-news',
1654
- 'yc' => 'y-combinator',
1655
- 'yc-square' => 'hacker-news',
1656
- 'yen' => 'yen-sign',
1657
- 'youtube-play' => 'youtube',
1658
- 'youtube-square' => 'youtube-square',
1659
- );
1660
- }
1
+ <?php
2
+
3
+ function siteorigin_widgets_icons_fontawesome_filter( $icons ){
4
+ return array_merge($icons, array(
5
+ '500px' => array( 'unicode' => '&#xf26e;', 'styles' => array( 'sow-fab' ), ),
6
+ 'accessible-icon' => array( 'unicode' => '&#xf368;', 'styles' => array( 'sow-fab' ), ),
7
+ 'accusoft' => array( 'unicode' => '&#xf369;', 'styles' => array( 'sow-fab' ), ),
8
+ 'acquisitions-incorporated' => array( 'unicode' => '&#xf6af;', 'styles' => array( 'sow-fab' ), ),
9
+ 'ad' => array( 'unicode' => '&#xf641;', 'styles' => array( 'sow-fas' ), ),
10
+ 'address-book' => array( 'unicode' => '&#xf2b9;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
11
+ 'address-card' => array( 'unicode' => '&#xf2bb;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
12
+ 'adjust' => array( 'unicode' => '&#xf042;', 'styles' => array( 'sow-fas' ), ),
13
+ 'adn' => array( 'unicode' => '&#xf170;', 'styles' => array( 'sow-fab' ), ),
14
+ 'adobe' => array( 'unicode' => '&#xf778;', 'styles' => array( 'sow-fab' ), ),
15
+ 'adversal' => array( 'unicode' => '&#xf36a;', 'styles' => array( 'sow-fab' ), ),
16
+ 'affiliatetheme' => array( 'unicode' => '&#xf36b;', 'styles' => array( 'sow-fab' ), ),
17
+ 'air-freshener' => array( 'unicode' => '&#xf5d0;', 'styles' => array( 'sow-fas' ), ),
18
+ 'airbnb' => array( 'unicode' => '&#xf834;', 'styles' => array( 'sow-fab' ), ),
19
+ 'algolia' => array( 'unicode' => '&#xf36c;', 'styles' => array( 'sow-fab' ), ),
20
+ 'align-center' => array( 'unicode' => '&#xf037;', 'styles' => array( 'sow-fas' ), ),
21
+ 'align-justify' => array( 'unicode' => '&#xf039;', 'styles' => array( 'sow-fas' ), ),
22
+ 'align-left' => array( 'unicode' => '&#xf036;', 'styles' => array( 'sow-fas' ), ),
23
+ 'align-right' => array( 'unicode' => '&#xf038;', 'styles' => array( 'sow-fas' ), ),
24
+ 'alipay' => array( 'unicode' => '&#xf642;', 'styles' => array( 'sow-fab' ), ),
25
+ 'allergies' => array( 'unicode' => '&#xf461;', 'styles' => array( 'sow-fas' ), ),
26
+ 'amazon' => array( 'unicode' => '&#xf270;', 'styles' => array( 'sow-fab' ), ),
27
+ 'amazon-pay' => array( 'unicode' => '&#xf42c;', 'styles' => array( 'sow-fab' ), ),
28
+ 'ambulance' => array( 'unicode' => '&#xf0f9;', 'styles' => array( 'sow-fas' ), ),
29
+ 'american-sign-language-interpreting' => array( 'unicode' => '&#xf2a3;', 'styles' => array( 'sow-fas' ), ),
30
+ 'amilia' => array( 'unicode' => '&#xf36d;', 'styles' => array( 'sow-fab' ), ),
31
+ 'anchor' => array( 'unicode' => '&#xf13d;', 'styles' => array( 'sow-fas' ), ),
32
+ 'android' => array( 'unicode' => '&#xf17b;', 'styles' => array( 'sow-fab' ), ),
33
+ 'angellist' => array( 'unicode' => '&#xf209;', 'styles' => array( 'sow-fab' ), ),
34
+ 'angle-double-down' => array( 'unicode' => '&#xf103;', 'styles' => array( 'sow-fas' ), ),
35
+ 'angle-double-left' => array( 'unicode' => '&#xf100;', 'styles' => array( 'sow-fas' ), ),
36
+ 'angle-double-right' => array( 'unicode' => '&#xf101;', 'styles' => array( 'sow-fas' ), ),
37
+ 'angle-double-up' => array( 'unicode' => '&#xf102;', 'styles' => array( 'sow-fas' ), ),
38
+ 'angle-down' => array( 'unicode' => '&#xf107;', 'styles' => array( 'sow-fas' ), ),
39
+ 'angle-left' => array( 'unicode' => '&#xf104;', 'styles' => array( 'sow-fas' ), ),
40
+ 'angle-right' => array( 'unicode' => '&#xf105;', 'styles' => array( 'sow-fas' ), ),
41
+ 'angle-up' => array( 'unicode' => '&#xf106;', 'styles' => array( 'sow-fas' ), ),
42
+ 'angry' => array( 'unicode' => '&#xf556;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
43
+ 'angrycreative' => array( 'unicode' => '&#xf36e;', 'styles' => array( 'sow-fab' ), ),
44
+ 'angular' => array( 'unicode' => '&#xf420;', 'styles' => array( 'sow-fab' ), ),
45
+ 'ankh' => array( 'unicode' => '&#xf644;', 'styles' => array( 'sow-fas' ), ),
46
+ 'app-store' => array( 'unicode' => '&#xf36f;', 'styles' => array( 'sow-fab' ), ),
47
+ 'app-store-ios' => array( 'unicode' => '&#xf370;', 'styles' => array( 'sow-fab' ), ),
48
+ 'apper' => array( 'unicode' => '&#xf371;', 'styles' => array( 'sow-fab' ), ),
49
+ 'apple' => array( 'unicode' => '&#xf179;', 'styles' => array( 'sow-fab' ), ),
50
+ 'apple-alt' => array( 'unicode' => '&#xf5d1;', 'styles' => array( 'sow-fas' ), ),
51
+ 'apple-pay' => array( 'unicode' => '&#xf415;', 'styles' => array( 'sow-fab' ), ),
52
+ 'archive' => array( 'unicode' => '&#xf187;', 'styles' => array( 'sow-fas' ), ),
53
+ 'archway' => array( 'unicode' => '&#xf557;', 'styles' => array( 'sow-fas' ), ),
54
+ 'arrow-alt-circle-down' => array( 'unicode' => '&#xf358;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
55
+ 'arrow-alt-circle-left' => array( 'unicode' => '&#xf359;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
56
+ 'arrow-alt-circle-right' => array( 'unicode' => '&#xf35a;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
57
+ 'arrow-alt-circle-up' => array( 'unicode' => '&#xf35b;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
58
+ 'arrow-circle-down' => array( 'unicode' => '&#xf0ab;', 'styles' => array( 'sow-fas' ), ),
59
+ 'arrow-circle-left' => array( 'unicode' => '&#xf0a8;', 'styles' => array( 'sow-fas' ), ),
60
+ 'arrow-circle-right' => array( 'unicode' => '&#xf0a9;', 'styles' => array( 'sow-fas' ), ),
61
+ 'arrow-circle-up' => array( 'unicode' => '&#xf0aa;', 'styles' => array( 'sow-fas' ), ),
62
+ 'arrow-down' => array( 'unicode' => '&#xf063;', 'styles' => array( 'sow-fas' ), ),
63
+ 'arrow-left' => array( 'unicode' => '&#xf060;', 'styles' => array( 'sow-fas' ), ),
64
+ 'arrow-right' => array( 'unicode' => '&#xf061;', 'styles' => array( 'sow-fas' ), ),
65
+ 'arrow-up' => array( 'unicode' => '&#xf062;', 'styles' => array( 'sow-fas' ), ),
66
+ 'arrows-alt' => array( 'unicode' => '&#xf0b2;', 'styles' => array( 'sow-fas' ), ),
67
+ 'arrows-alt-h' => array( 'unicode' => '&#xf337;', 'styles' => array( 'sow-fas' ), ),
68
+ 'arrows-alt-v' => array( 'unicode' => '&#xf338;', 'styles' => array( 'sow-fas' ), ),
69
+ 'artstation' => array( 'unicode' => '&#xf77a;', 'styles' => array( 'sow-fab' ), ),
70
+ 'assistive-listening-systems' => array( 'unicode' => '&#xf2a2;', 'styles' => array( 'sow-fas' ), ),
71
+ 'asterisk' => array( 'unicode' => '&#xf069;', 'styles' => array( 'sow-fas' ), ),
72
+ 'asymmetrik' => array( 'unicode' => '&#xf372;', 'styles' => array( 'sow-fab' ), ),
73
+ 'at' => array( 'unicode' => '&#xf1fa;', 'styles' => array( 'sow-fas' ), ),
74
+ 'atlas' => array( 'unicode' => '&#xf558;', 'styles' => array( 'sow-fas' ), ),
75
+ 'atlassian' => array( 'unicode' => '&#xf77b;', 'styles' => array( 'sow-fab' ), ),
76
+ 'atom' => array( 'unicode' => '&#xf5d2;', 'styles' => array( 'sow-fas' ), ),
77
+ 'audible' => array( 'unicode' => '&#xf373;', 'styles' => array( 'sow-fab' ), ),
78
+ 'audio-description' => array( 'unicode' => '&#xf29e;', 'styles' => array( 'sow-fas' ), ),
79
+ 'autoprefixer' => array( 'unicode' => '&#xf41c;', 'styles' => array( 'sow-fab' ), ),
80
+ 'avianex' => array( 'unicode' => '&#xf374;', 'styles' => array( 'sow-fab' ), ),
81
+ 'aviato' => array( 'unicode' => '&#xf421;', 'styles' => array( 'sow-fab' ), ),
82
+ 'award' => array( 'unicode' => '&#xf559;', 'styles' => array( 'sow-fas' ), ),
83
+ 'aws' => array( 'unicode' => '&#xf375;', 'styles' => array( 'sow-fab' ), ),
84
+ 'baby' => array( 'unicode' => '&#xf77c;', 'styles' => array( 'sow-fas' ), ),
85
+ 'baby-carriage' => array( 'unicode' => '&#xf77d;', 'styles' => array( 'sow-fas' ), ),
86
+ 'backspace' => array( 'unicode' => '&#xf55a;', 'styles' => array( 'sow-fas' ), ),
87
+ 'backward' => array( 'unicode' => '&#xf04a;', 'styles' => array( 'sow-fas' ), ),
88
+ 'bacon' => array( 'unicode' => '&#xf7e5;', 'styles' => array( 'sow-fas' ), ),
89
+ 'balance-scale' => array( 'unicode' => '&#xf24e;', 'styles' => array( 'sow-fas' ), ),
90
+ 'ban' => array( 'unicode' => '&#xf05e;', 'styles' => array( 'sow-fas' ), ),
91
+ 'band-aid' => array( 'unicode' => '&#xf462;', 'styles' => array( 'sow-fas' ), ),
92
+ 'bandcamp' => array( 'unicode' => '&#xf2d5;', 'styles' => array( 'sow-fab' ), ),
93
+ 'barcode' => array( 'unicode' => '&#xf02a;', 'styles' => array( 'sow-fas' ), ),
94
+ 'bars' => array( 'unicode' => '&#xf0c9;', 'styles' => array( 'sow-fas' ), ),
95
+ 'baseball-ball' => array( 'unicode' => '&#xf433;', 'styles' => array( 'sow-fas' ), ),
96
+ 'basketball-ball' => array( 'unicode' => '&#xf434;', 'styles' => array( 'sow-fas' ), ),
97
+ 'bath' => array( 'unicode' => '&#xf2cd;', 'styles' => array( 'sow-fas' ), ),
98
+ 'battery-empty' => array( 'unicode' => '&#xf244;', 'styles' => array( 'sow-fas' ), ),
99
+ 'battery-full' => array( 'unicode' => '&#xf240;', 'styles' => array( 'sow-fas' ), ),
100
+ 'battery-half' => array( 'unicode' => '&#xf242;', 'styles' => array( 'sow-fas' ), ),
101
+ 'battery-quarter' => array( 'unicode' => '&#xf243;', 'styles' => array( 'sow-fas' ), ),
102
+ 'battery-three-quarters' => array( 'unicode' => '&#xf241;', 'styles' => array( 'sow-fas' ), ),
103
+ 'battle-net' => array( 'unicode' => '&#xf835;', 'styles' => array( 'sow-fab' ), ),
104
+ 'bed' => array( 'unicode' => '&#xf236;', 'styles' => array( 'sow-fas' ), ),
105
+ 'beer' => array( 'unicode' => '&#xf0fc;', 'styles' => array( 'sow-fas' ), ),
106
+ 'behance' => array( 'unicode' => '&#xf1b4;', 'styles' => array( 'sow-fab' ), ),
107
+ 'behance-square' => array( 'unicode' => '&#xf1b5;', 'styles' => array( 'sow-fab' ), ),
108
+ 'bell' => array( 'unicode' => '&#xf0f3;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
109
+ 'bell-slash' => array( 'unicode' => '&#xf1f6;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
110
+ 'bezier-curve' => array( 'unicode' => '&#xf55b;', 'styles' => array( 'sow-fas' ), ),
111
+ 'bible' => array( 'unicode' => '&#xf647;', 'styles' => array( 'sow-fas' ), ),
112
+ 'bicycle' => array( 'unicode' => '&#xf206;', 'styles' => array( 'sow-fas' ), ),
113
+ 'bimobject' => array( 'unicode' => '&#xf378;', 'styles' => array( 'sow-fab' ), ),
114
+ 'binoculars' => array( 'unicode' => '&#xf1e5;', 'styles' => array( 'sow-fas' ), ),
115
+ 'biohazard' => array( 'unicode' => '&#xf780;', 'styles' => array( 'sow-fas' ), ),
116
+ 'birthday-cake' => array( 'unicode' => '&#xf1fd;', 'styles' => array( 'sow-fas' ), ),
117
+ 'bitbucket' => array( 'unicode' => '&#xf171;', 'styles' => array( 'sow-fab' ), ),
118
+ 'bitcoin' => array( 'unicode' => '&#xf379;', 'styles' => array( 'sow-fab' ), ),
119
+ 'bity' => array( 'unicode' => '&#xf37a;', 'styles' => array( 'sow-fab' ), ),
120
+ 'black-tie' => array( 'unicode' => '&#xf27e;', 'styles' => array( 'sow-fab' ), ),
121
+ 'blackberry' => array( 'unicode' => '&#xf37b;', 'styles' => array( 'sow-fab' ), ),
122
+ 'blender' => array( 'unicode' => '&#xf517;', 'styles' => array( 'sow-fas' ), ),
123
+ 'blender-phone' => array( 'unicode' => '&#xf6b6;', 'styles' => array( 'sow-fas' ), ),
124
+ 'blind' => array( 'unicode' => '&#xf29d;', 'styles' => array( 'sow-fas' ), ),
125
+ 'blog' => array( 'unicode' => '&#xf781;', 'styles' => array( 'sow-fas' ), ),
126
+ 'blogger' => array( 'unicode' => '&#xf37c;', 'styles' => array( 'sow-fab' ), ),
127
+ 'blogger-b' => array( 'unicode' => '&#xf37d;', 'styles' => array( 'sow-fab' ), ),
128
+ 'bluetooth' => array( 'unicode' => '&#xf293;', 'styles' => array( 'sow-fab' ), ),
129
+ 'bluetooth-b' => array( 'unicode' => '&#xf294;', 'styles' => array( 'sow-fab' ), ),
130
+ 'bold' => array( 'unicode' => '&#xf032;', 'styles' => array( 'sow-fas' ), ),
131
+ 'bolt' => array( 'unicode' => '&#xf0e7;', 'styles' => array( 'sow-fas' ), ),
132
+ 'bomb' => array( 'unicode' => '&#xf1e2;', 'styles' => array( 'sow-fas' ), ),
133
+ 'bone' => array( 'unicode' => '&#xf5d7;', 'styles' => array( 'sow-fas' ), ),
134
+ 'bong' => array( 'unicode' => '&#xf55c;', 'styles' => array( 'sow-fas' ), ),
135
+ 'book' => array( 'unicode' => '&#xf02d;', 'styles' => array( 'sow-fas' ), ),
136
+ 'book-dead' => array( 'unicode' => '&#xf6b7;', 'styles' => array( 'sow-fas' ), ),
137
+ 'book-medical' => array( 'unicode' => '&#xf7e6;', 'styles' => array( 'sow-fas' ), ),
138
+ 'book-open' => array( 'unicode' => '&#xf518;', 'styles' => array( 'sow-fas' ), ),
139
+ 'book-reader' => array( 'unicode' => '&#xf5da;', 'styles' => array( 'sow-fas' ), ),
140
+ 'bookmark' => array( 'unicode' => '&#xf02e;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
141
+ 'bootstrap' => array( 'unicode' => '&#xf836;', 'styles' => array( 'sow-fab' ), ),
142
+ 'bowling-ball' => array( 'unicode' => '&#xf436;', 'styles' => array( 'sow-fas' ), ),
143
+ 'box' => array( 'unicode' => '&#xf466;', 'styles' => array( 'sow-fas' ), ),
144
+ 'box-open' => array( 'unicode' => '&#xf49e;', 'styles' => array( 'sow-fas' ), ),
145
+ 'boxes' => array( 'unicode' => '&#xf468;', 'styles' => array( 'sow-fas' ), ),
146
+ 'braille' => array( 'unicode' => '&#xf2a1;', 'styles' => array( 'sow-fas' ), ),
147
+ 'brain' => array( 'unicode' => '&#xf5dc;', 'styles' => array( 'sow-fas' ), ),
148
+ 'bread-slice' => array( 'unicode' => '&#xf7ec;', 'styles' => array( 'sow-fas' ), ),
149
+ 'briefcase' => array( 'unicode' => '&#xf0b1;', 'styles' => array( 'sow-fas' ), ),
150
+ 'briefcase-medical' => array( 'unicode' => '&#xf469;', 'styles' => array( 'sow-fas' ), ),
151
+ 'broadcast-tower' => array( 'unicode' => '&#xf519;', 'styles' => array( 'sow-fas' ), ),
152
+ 'broom' => array( 'unicode' => '&#xf51a;', 'styles' => array( 'sow-fas' ), ),
153
+ 'brush' => array( 'unicode' => '&#xf55d;', 'styles' => array( 'sow-fas' ), ),
154
+ 'btc' => array( 'unicode' => '&#xf15a;', 'styles' => array( 'sow-fab' ), ),
155
+ 'buffer' => array( 'unicode' => '&#xf837;', 'styles' => array( 'sow-fab' ), ),
156
+ 'bug' => array( 'unicode' => '&#xf188;', 'styles' => array( 'sow-fas' ), ),
157
+ 'building' => array( 'unicode' => '&#xf1ad;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
158
+ 'bullhorn' => array( 'unicode' => '&#xf0a1;', 'styles' => array( 'sow-fas' ), ),
159
+ 'bullseye' => array( 'unicode' => '&#xf140;', 'styles' => array( 'sow-fas' ), ),
160
+ 'burn' => array( 'unicode' => '&#xf46a;', 'styles' => array( 'sow-fas' ), ),
161
+ 'buromobelexperte' => array( 'unicode' => '&#xf37f;', 'styles' => array( 'sow-fab' ), ),
162
+ 'bus' => array( 'unicode' => '&#xf207;', 'styles' => array( 'sow-fas' ), ),
163
+ 'bus-alt' => array( 'unicode' => '&#xf55e;', 'styles' => array( 'sow-fas' ), ),
164
+ 'business-time' => array( 'unicode' => '&#xf64a;', 'styles' => array( 'sow-fas' ), ),
165
+ 'buysellads' => array( 'unicode' => '&#xf20d;', 'styles' => array( 'sow-fab' ), ),
166
+ 'calculator' => array( 'unicode' => '&#xf1ec;', 'styles' => array( 'sow-fas' ), ),
167
+ 'calendar' => array( 'unicode' => '&#xf133;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
168
+ 'calendar-alt' => array( 'unicode' => '&#xf073;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
169
+ 'calendar-check' => array( 'unicode' => '&#xf274;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
170
+ 'calendar-day' => array( 'unicode' => '&#xf783;', 'styles' => array( 'sow-fas' ), ),
171
+ 'calendar-minus' => array( 'unicode' => '&#xf272;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
172
+ 'calendar-plus' => array( 'unicode' => '&#xf271;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
173
+ 'calendar-times' => array( 'unicode' => '&#xf273;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
174
+ 'calendar-week' => array( 'unicode' => '&#xf784;', 'styles' => array( 'sow-fas' ), ),
175
+ 'camera' => array( 'unicode' => '&#xf030;', 'styles' => array( 'sow-fas' ), ),
176
+ 'camera-retro' => array( 'unicode' => '&#xf083;', 'styles' => array( 'sow-fas' ), ),
177
+ 'campground' => array( 'unicode' => '&#xf6bb;', 'styles' => array( 'sow-fas' ), ),
178
+ 'canadian-maple-leaf' => array( 'unicode' => '&#xf785;', 'styles' => array( 'sow-fab' ), ),
179
+ 'candy-cane' => array( 'unicode' => '&#xf786;', 'styles' => array( 'sow-fas' ), ),
180
+ 'cannabis' => array( 'unicode' => '&#xf55f;', 'styles' => array( 'sow-fas' ), ),
181
+ 'capsules' => array( 'unicode' => '&#xf46b;', 'styles' => array( 'sow-fas' ), ),
182
+ 'car' => array( 'unicode' => '&#xf1b9;', 'styles' => array( 'sow-fas' ), ),
183
+ 'car-alt' => array( 'unicode' => '&#xf5de;', 'styles' => array( 'sow-fas' ), ),
184
+ 'car-battery' => array( 'unicode' => '&#xf5df;', 'styles' => array( 'sow-fas' ), ),
185
+ 'car-crash' => array( 'unicode' => '&#xf5e1;', 'styles' => array( 'sow-fas' ), ),
186
+ 'car-side' => array( 'unicode' => '&#xf5e4;', 'styles' => array( 'sow-fas' ), ),
187
+ 'caret-down' => array( 'unicode' => '&#xf0d7;', 'styles' => array( 'sow-fas' ), ),
188
+ 'caret-left' => array( 'unicode' => '&#xf0d9;', 'styles' => array( 'sow-fas' ), ),
189
+ 'caret-right' => array( 'unicode' => '&#xf0da;', 'styles' => array( 'sow-fas' ), ),
190
+ 'caret-square-down' => array( 'unicode' => '&#xf150;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
191
+ 'caret-square-left' => array( 'unicode' => '&#xf191;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
192
+ 'caret-square-right' => array( 'unicode' => '&#xf152;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
193
+ 'caret-square-up' => array( 'unicode' => '&#xf151;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
194
+ 'caret-up' => array( 'unicode' => '&#xf0d8;', 'styles' => array( 'sow-fas' ), ),
195
+ 'carrot' => array( 'unicode' => '&#xf787;', 'styles' => array( 'sow-fas' ), ),
196
+ 'cart-arrow-down' => array( 'unicode' => '&#xf218;', 'styles' => array( 'sow-fas' ), ),
197
+ 'cart-plus' => array( 'unicode' => '&#xf217;', 'styles' => array( 'sow-fas' ), ),
198
+ 'cash-register' => array( 'unicode' => '&#xf788;', 'styles' => array( 'sow-fas' ), ),
199
+ 'cat' => array( 'unicode' => '&#xf6be;', 'styles' => array( 'sow-fas' ), ),
200
+ 'cc-amazon-pay' => array( 'unicode' => '&#xf42d;', 'styles' => array( 'sow-fab' ), ),
201
+ 'cc-amex' => array( 'unicode' => '&#xf1f3;', 'styles' => array( 'sow-fab' ), ),
202
+ 'cc-apple-pay' => array( 'unicode' => '&#xf416;', 'styles' => array( 'sow-fab' ), ),
203
+ 'cc-diners-club' => array( 'unicode' => '&#xf24c;', 'styles' => array( 'sow-fab' ), ),
204
+ 'cc-discover' => array( 'unicode' => '&#xf1f2;', 'styles' => array( 'sow-fab' ), ),
205
+ 'cc-jcb' => array( 'unicode' => '&#xf24b;', 'styles' => array( 'sow-fab' ), ),
206
+ 'cc-mastercard' => array( 'unicode' => '&#xf1f1;', 'styles' => array( 'sow-fab' ), ),
207
+ 'cc-paypal' => array( 'unicode' => '&#xf1f4;', 'styles' => array( 'sow-fab' ), ),
208
+ 'cc-stripe' => array( 'unicode' => '&#xf1f5;', 'styles' => array( 'sow-fab' ), ),
209
+ 'cc-visa' => array( 'unicode' => '&#xf1f0;', 'styles' => array( 'sow-fab' ), ),
210
+ 'centercode' => array( 'unicode' => '&#xf380;', 'styles' => array( 'sow-fab' ), ),
211
+ 'centos' => array( 'unicode' => '&#xf789;', 'styles' => array( 'sow-fab' ), ),
212
+ 'certificate' => array( 'unicode' => '&#xf0a3;', 'styles' => array( 'sow-fas' ), ),
213
+ 'chair' => array( 'unicode' => '&#xf6c0;', 'styles' => array( 'sow-fas' ), ),
214
+ 'chalkboard' => array( 'unicode' => '&#xf51b;', 'styles' => array( 'sow-fas' ), ),
215
+ 'chalkboard-teacher' => array( 'unicode' => '&#xf51c;', 'styles' => array( 'sow-fas' ), ),
216
+ 'charging-station' => array( 'unicode' => '&#xf5e7;', 'styles' => array( 'sow-fas' ), ),
217
+ 'chart-area' => array( 'unicode' => '&#xf1fe;', 'styles' => array( 'sow-fas' ), ),
218
+ 'chart-bar' => array( 'unicode' => '&#xf080;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
219
+ 'chart-line' => array( 'unicode' => '&#xf201;', 'styles' => array( 'sow-fas' ), ),
220
+ 'chart-pie' => array( 'unicode' => '&#xf200;', 'styles' => array( 'sow-fas' ), ),
221
+ 'check' => array( 'unicode' => '&#xf00c;', 'styles' => array( 'sow-fas' ), ),
222
+ 'check-circle' => array( 'unicode' => '&#xf058;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
223
+ 'check-double' => array( 'unicode' => '&#xf560;', 'styles' => array( 'sow-fas' ), ),
224
+ 'check-square' => array( 'unicode' => '&#xf14a;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
225
+ 'cheese' => array( 'unicode' => '&#xf7ef;', 'styles' => array( 'sow-fas' ), ),
226
+ 'chess' => array( 'unicode' => '&#xf439;', 'styles' => array( 'sow-fas' ), ),
227
+ 'chess-bishop' => array( 'unicode' => '&#xf43a;', 'styles' => array( 'sow-fas' ), ),
228
+ 'chess-board' => array( 'unicode' => '&#xf43c;', 'styles' => array( 'sow-fas' ), ),
229
+ 'chess-king' => array( 'unicode' => '&#xf43f;', 'styles' => array( 'sow-fas' ), ),
230
+ 'chess-knight' => array( 'unicode' => '&#xf441;', 'styles' => array( 'sow-fas' ), ),
231
+ 'chess-pawn' => array( 'unicode' => '&#xf443;', 'styles' => array( 'sow-fas' ), ),
232
+ 'chess-queen' => array( 'unicode' => '&#xf445;', 'styles' => array( 'sow-fas' ), ),
233
+ 'chess-rook' => array( 'unicode' => '&#xf447;', 'styles' => array( 'sow-fas' ), ),
234
+ 'chevron-circle-down' => array( 'unicode' => '&#xf13a;', 'styles' => array( 'sow-fas' ), ),
235
+ 'chevron-circle-left' => array( 'unicode' => '&#xf137;', 'styles' => array( 'sow-fas' ), ),
236
+ 'chevron-circle-right' => array( 'unicode' => '&#xf138;', 'styles' => array( 'sow-fas' ), ),
237
+ 'chevron-circle-up' => array( 'unicode' => '&#xf139;', 'styles' => array( 'sow-fas' ), ),
238
+ 'chevron-down' => array( 'unicode' => '&#xf078;', 'styles' => array( 'sow-fas' ), ),
239
+ 'chevron-left' => array( 'unicode' => '&#xf053;', 'styles' => array( 'sow-fas' ), ),
240
+ 'chevron-right' => array( 'unicode' => '&#xf054;', 'styles' => array( 'sow-fas' ), ),
241
+ 'chevron-up' => array( 'unicode' => '&#xf077;', 'styles' => array( 'sow-fas' ), ),
242
+ 'child' => array( 'unicode' => '&#xf1ae;', 'styles' => array( 'sow-fas' ), ),
243
+ 'chrome' => array( 'unicode' => '&#xf268;', 'styles' => array( 'sow-fab' ), ),
244
+ 'chromecast' => array( 'unicode' => '&#xf838;', 'styles' => array( 'sow-fab' ), ),
245
+ 'church' => array( 'unicode' => '&#xf51d;', 'styles' => array( 'sow-fas' ), ),
246
+ 'circle' => array( 'unicode' => '&#xf111;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
247
+ 'circle-notch' => array( 'unicode' => '&#xf1ce;', 'styles' => array( 'sow-fas' ), ),
248
+ 'city' => array( 'unicode' => '&#xf64f;', 'styles' => array( 'sow-fas' ), ),
249
+ 'clinic-medical' => array( 'unicode' => '&#xf7f2;', 'styles' => array( 'sow-fas' ), ),
250
+ 'clipboard' => array( 'unicode' => '&#xf328;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
251
+ 'clipboard-check' => array( 'unicode' => '&#xf46c;', 'styles' => array( 'sow-fas' ), ),
252
+ 'clipboard-list' => array( 'unicode' => '&#xf46d;', 'styles' => array( 'sow-fas' ), ),
253
+ 'clock' => array( 'unicode' => '&#xf017;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
254
+ 'clone' => array( 'unicode' => '&#xf24d;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
255
+ 'closed-captioning' => array( 'unicode' => '&#xf20a;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
256
+ 'cloud' => array( 'unicode' => '&#xf0c2;', 'styles' => array( 'sow-fas' ), ),
257
+ 'cloud-download-alt' => array( 'unicode' => '&#xf381;', 'styles' => array( 'sow-fas' ), ),
258
+ 'cloud-meatball' => array( 'unicode' => '&#xf73b;', 'styles' => array( 'sow-fas' ), ),
259
+ 'cloud-moon' => array( 'unicode' => '&#xf6c3;', 'styles' => array( 'sow-fas' ), ),
260
+ 'cloud-moon-rain' => array( 'unicode' => '&#xf73c;', 'styles' => array( 'sow-fas' ), ),
261
+ 'cloud-rain' => array( 'unicode' => '&#xf73d;', 'styles' => array( 'sow-fas' ), ),
262
+ 'cloud-showers-heavy' => array( 'unicode' => '&#xf740;', 'styles' => array( 'sow-fas' ), ),
263
+ 'cloud-sun' => array( 'unicode' => '&#xf6c4;', 'styles' => array( 'sow-fas' ), ),
264
+ 'cloud-sun-rain' => array( 'unicode' => '&#xf743;', 'styles' => array( 'sow-fas' ), ),
265
+ 'cloud-upload-alt' => array( 'unicode' => '&#xf382;', 'styles' => array( 'sow-fas' ), ),
266
+ 'cloudscale' => array( 'unicode' => '&#xf383;', 'styles' => array( 'sow-fab' ), ),
267
+ 'cloudsmith' => array( 'unicode' => '&#xf384;', 'styles' => array( 'sow-fab' ), ),
268
+ 'cloudversify' => array( 'unicode' => '&#xf385;', 'styles' => array( 'sow-fab' ), ),
269
+ 'cocktail' => array( 'unicode' => '&#xf561;', 'styles' => array( 'sow-fas' ), ),
270
+ 'code' => array( 'unicode' => '&#xf121;', 'styles' => array( 'sow-fas' ), ),
271
+ 'code-branch' => array( 'unicode' => '&#xf126;', 'styles' => array( 'sow-fas' ), ),
272
+ 'codepen' => array( 'unicode' => '&#xf1cb;', 'styles' => array( 'sow-fab' ), ),
273
+ 'codiepie' => array( 'unicode' => '&#xf284;', 'styles' => array( 'sow-fab' ), ),
274
+ 'coffee' => array( 'unicode' => '&#xf0f4;', 'styles' => array( 'sow-fas' ), ),
275
+ 'cog' => array( 'unicode' => '&#xf013;', 'styles' => array( 'sow-fas' ), ),
276
+ 'cogs' => array( 'unicode' => '&#xf085;', 'styles' => array( 'sow-fas' ), ),
277
+ 'coins' => array( 'unicode' => '&#xf51e;', 'styles' => array( 'sow-fas' ), ),
278
+ 'columns' => array( 'unicode' => '&#xf0db;', 'styles' => array( 'sow-fas' ), ),
279
+ 'comment' => array( 'unicode' => '&#xf075;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
280
+ 'comment-alt' => array( 'unicode' => '&#xf27a;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
281
+ 'comment-dollar' => array( 'unicode' => '&#xf651;', 'styles' => array( 'sow-fas' ), ),
282
+ 'comment-dots' => array( 'unicode' => '&#xf4ad;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
283
+ 'comment-medical' => array( 'unicode' => '&#xf7f5;', 'styles' => array( 'sow-fas' ), ),
284
+ 'comment-slash' => array( 'unicode' => '&#xf4b3;', 'styles' => array( 'sow-fas' ), ),
285
+ 'comments' => array( 'unicode' => '&#xf086;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
286
+ 'comments-dollar' => array( 'unicode' => '&#xf653;', 'styles' => array( 'sow-fas' ), ),
287
+ 'compact-disc' => array( 'unicode' => '&#xf51f;', 'styles' => array( 'sow-fas' ), ),
288
+ 'compass' => array( 'unicode' => '&#xf14e;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
289
+ 'compress' => array( 'unicode' => '&#xf066;', 'styles' => array( 'sow-fas' ), ),
290
+ 'compress-arrows-alt' => array( 'unicode' => '&#xf78c;', 'styles' => array( 'sow-fas' ), ),
291
+ 'concierge-bell' => array( 'unicode' => '&#xf562;', 'styles' => array( 'sow-fas' ), ),
292
+ 'confluence' => array( 'unicode' => '&#xf78d;', 'styles' => array( 'sow-fab' ), ),
293
+ 'connectdevelop' => array( 'unicode' => '&#xf20e;', 'styles' => array( 'sow-fab' ), ),
294
+ 'contao' => array( 'unicode' => '&#xf26d;', 'styles' => array( 'sow-fab' ), ),
295
+ 'cookie' => array( 'unicode' => '&#xf563;', 'styles' => array( 'sow-fas' ), ),
296
+ 'cookie-bite' => array( 'unicode' => '&#xf564;', 'styles' => array( 'sow-fas' ), ),
297
+ 'copy' => array( 'unicode' => '&#xf0c5;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
298
+ 'copyright' => array( 'unicode' => '&#xf1f9;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
299
+ 'couch' => array( 'unicode' => '&#xf4b8;', 'styles' => array( 'sow-fas' ), ),
300
+ 'cpanel' => array( 'unicode' => '&#xf388;', 'styles' => array( 'sow-fab' ), ),
301
+ 'creative-commons' => array( 'unicode' => '&#xf25e;', 'styles' => array( 'sow-fab' ), ),
302
+ 'creative-commons-by' => array( 'unicode' => '&#xf4e7;', 'styles' => array( 'sow-fab' ), ),
303
+ 'creative-commons-nc' => array( 'unicode' => '&#xf4e8;', 'styles' => array( 'sow-fab' ), ),
304
+ 'creative-commons-nc-eu' => array( 'unicode' => '&#xf4e9;', 'styles' => array( 'sow-fab' ), ),
305
+ 'creative-commons-nc-jp' => array( 'unicode' => '&#xf4ea;', 'styles' => array( 'sow-fab' ), ),
306
+ 'creative-commons-nd' => array( 'unicode' => '&#xf4eb;', 'styles' => array( 'sow-fab' ), ),
307
+ 'creative-commons-pd' => array( 'unicode' => '&#xf4ec;', 'styles' => array( 'sow-fab' ), ),
308
+ 'creative-commons-pd-alt' => array( 'unicode' => '&#xf4ed;', 'styles' => array( 'sow-fab' ), ),
309
+ 'creative-commons-remix' => array( 'unicode' => '&#xf4ee;', 'styles' => array( 'sow-fab' ), ),
310
+ 'creative-commons-sa' => array( 'unicode' => '&#xf4ef;', 'styles' => array( 'sow-fab' ), ),
311
+ 'creative-commons-sampling' => array( 'unicode' => '&#xf4f0;', 'styles' => array( 'sow-fab' ), ),
312
+ 'creative-commons-sampling-plus' => array( 'unicode' => '&#xf4f1;', 'styles' => array( 'sow-fab' ), ),
313
+ 'creative-commons-share' => array( 'unicode' => '&#xf4f2;', 'styles' => array( 'sow-fab' ), ),
314
+ 'creative-commons-zero' => array( 'unicode' => '&#xf4f3;', 'styles' => array( 'sow-fab' ), ),
315
+ 'credit-card' => array( 'unicode' => '&#xf09d;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
316
+ 'critical-role' => array( 'unicode' => '&#xf6c9;', 'styles' => array( 'sow-fab' ), ),
317
+ 'crop' => array( 'unicode' => '&#xf125;', 'styles' => array( 'sow-fas' ), ),
318
+ 'crop-alt' => array( 'unicode' => '&#xf565;', 'styles' => array( 'sow-fas' ), ),
319
+ 'cross' => array( 'unicode' => '&#xf654;', 'styles' => array( 'sow-fas' ), ),
320
+ 'crosshairs' => array( 'unicode' => '&#xf05b;', 'styles' => array( 'sow-fas' ), ),
321
+ 'crow' => array( 'unicode' => '&#xf520;', 'styles' => array( 'sow-fas' ), ),
322
+ 'crown' => array( 'unicode' => '&#xf521;', 'styles' => array( 'sow-fas' ), ),
323
+ 'crutch' => array( 'unicode' => '&#xf7f7;', 'styles' => array( 'sow-fas' ), ),
324
+ 'css3' => array( 'unicode' => '&#xf13c;', 'styles' => array( 'sow-fab' ), ),
325
+ 'css3-alt' => array( 'unicode' => '&#xf38b;', 'styles' => array( 'sow-fab' ), ),
326
+ 'cube' => array( 'unicode' => '&#xf1b2;', 'styles' => array( 'sow-fas' ), ),
327
+ 'cubes' => array( 'unicode' => '&#xf1b3;', 'styles' => array( 'sow-fas' ), ),
328
+ 'cut' => array( 'unicode' => '&#xf0c4;', 'styles' => array( 'sow-fas' ), ),
329
+ 'cuttlefish' => array( 'unicode' => '&#xf38c;', 'styles' => array( 'sow-fab' ), ),
330
+ 'd-and-d' => array( 'unicode' => '&#xf38d;', 'styles' => array( 'sow-fab' ), ),
331
+ 'd-and-d-beyond' => array( 'unicode' => '&#xf6ca;', 'styles' => array( 'sow-fab' ), ),
332
+ 'dashcube' => array( 'unicode' => '&#xf210;', 'styles' => array( 'sow-fab' ), ),
333
+ 'database' => array( 'unicode' => '&#xf1c0;', 'styles' => array( 'sow-fas' ), ),
334
+ 'deaf' => array( 'unicode' => '&#xf2a4;', 'styles' => array( 'sow-fas' ), ),
335
+ 'delicious' => array( 'unicode' => '&#xf1a5;', 'styles' => array( 'sow-fab' ), ),
336
+ 'democrat' => array( 'unicode' => '&#xf747;', 'styles' => array( 'sow-fas' ), ),
337
+ 'deploydog' => array( 'unicode' => '&#xf38e;', 'styles' => array( 'sow-fab' ), ),
338
+ 'deskpro' => array( 'unicode' => '&#xf38f;', 'styles' => array( 'sow-fab' ), ),
339
+ 'desktop' => array( 'unicode' => '&#xf108;', 'styles' => array( 'sow-fas' ), ),
340
+ 'dev' => array( 'unicode' => '&#xf6cc;', 'styles' => array( 'sow-fab' ), ),
341
+ 'deviantart' => array( 'unicode' => '&#xf1bd;', 'styles' => array( 'sow-fab' ), ),
342
+ 'dharmachakra' => array( 'unicode' => '&#xf655;', 'styles' => array( 'sow-fas' ), ),
343
+ 'dhl' => array( 'unicode' => '&#xf790;', 'styles' => array( 'sow-fab' ), ),
344
+ 'diagnoses' => array( 'unicode' => '&#xf470;', 'styles' => array( 'sow-fas' ), ),
345
+ 'diaspora' => array( 'unicode' => '&#xf791;', 'styles' => array( 'sow-fab' ), ),
346
+ 'dice' => array( 'unicode' => '&#xf522;', 'styles' => array( 'sow-fas' ), ),
347
+ 'dice-d20' => array( 'unicode' => '&#xf6cf;', 'styles' => array( 'sow-fas' ), ),
348
+ 'dice-d6' => array( 'unicode' => '&#xf6d1;', 'styles' => array( 'sow-fas' ), ),
349
+ 'dice-five' => array( 'unicode' => '&#xf523;', 'styles' => array( 'sow-fas' ), ),
350
+ 'dice-four' => array( 'unicode' => '&#xf524;', 'styles' => array( 'sow-fas' ), ),
351
+ 'dice-one' => array( 'unicode' => '&#xf525;', 'styles' => array( 'sow-fas' ), ),
352
+ 'dice-six' => array( 'unicode' => '&#xf526;', 'styles' => array( 'sow-fas' ), ),
353
+ 'dice-three' => array( 'unicode' => '&#xf527;', 'styles' => array( 'sow-fas' ), ),
354
+ 'dice-two' => array( 'unicode' => '&#xf528;', 'styles' => array( 'sow-fas' ), ),
355
+ 'digg' => array( 'unicode' => '&#xf1a6;', 'styles' => array( 'sow-fab' ), ),
356
+ 'digital-ocean' => array( 'unicode' => '&#xf391;', 'styles' => array( 'sow-fab' ), ),
357
+ 'digital-tachograph' => array( 'unicode' => '&#xf566;', 'styles' => array( 'sow-fas' ), ),
358
+ 'directions' => array( 'unicode' => '&#xf5eb;', 'styles' => array( 'sow-fas' ), ),
359
+ 'discord' => array( 'unicode' => '&#xf392;', 'styles' => array( 'sow-fab' ), ),
360
+ 'discourse' => array( 'unicode' => '&#xf393;', 'styles' => array( 'sow-fab' ), ),
361
+ 'divide' => array( 'unicode' => '&#xf529;', 'styles' => array( 'sow-fas' ), ),
362
+ 'dizzy' => array( 'unicode' => '&#xf567;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
363
+ 'dna' => array( 'unicode' => '&#xf471;', 'styles' => array( 'sow-fas' ), ),
364
+ 'dochub' => array( 'unicode' => '&#xf394;', 'styles' => array( 'sow-fab' ), ),
365
+ 'docker' => array( 'unicode' => '&#xf395;', 'styles' => array( 'sow-fab' ), ),
366
+ 'dog' => array( 'unicode' => '&#xf6d3;', 'styles' => array( 'sow-fas' ), ),
367
+ 'dollar-sign' => array( 'unicode' => '&#xf155;', 'styles' => array( 'sow-fas' ), ),
368
+ 'dolly' => array( 'unicode' => '&#xf472;', 'styles' => array( 'sow-fas' ), ),
369
+ 'dolly-flatbed' => array( 'unicode' => '&#xf474;', 'styles' => array( 'sow-fas' ), ),
370
+ 'donate' => array( 'unicode' => '&#xf4b9;', 'styles' => array( 'sow-fas' ), ),
371
+ 'door-closed' => array( 'unicode' => '&#xf52a;', 'styles' => array( 'sow-fas' ), ),
372
+ 'door-open' => array( 'unicode' => '&#xf52b;', 'styles' => array( 'sow-fas' ), ),
373
+ 'dot-circle' => array( 'unicode' => '&#xf192;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
374
+ 'dove' => array( 'unicode' => '&#xf4ba;', 'styles' => array( 'sow-fas' ), ),
375
+ 'download' => array( 'unicode' => '&#xf019;', 'styles' => array( 'sow-fas' ), ),
376
+ 'draft2digital' => array( 'unicode' => '&#xf396;', 'styles' => array( 'sow-fab' ), ),
377
+ 'drafting-compass' => array( 'unicode' => '&#xf568;', 'styles' => array( 'sow-fas' ), ),
378
+ 'dragon' => array( 'unicode' => '&#xf6d5;', 'styles' => array( 'sow-fas' ), ),
379
+ 'draw-polygon' => array( 'unicode' => '&#xf5ee;', 'styles' => array( 'sow-fas' ), ),
380
+ 'dribbble' => array( 'unicode' => '&#xf17d;', 'styles' => array( 'sow-fab' ), ),
381
+ 'dribbble-square' => array( 'unicode' => '&#xf397;', 'styles' => array( 'sow-fab' ), ),
382
+ 'dropbox' => array( 'unicode' => '&#xf16b;', 'styles' => array( 'sow-fab' ), ),
383
+ 'drum' => array( 'unicode' => '&#xf569;', 'styles' => array( 'sow-fas' ), ),
384
+ 'drum-steelpan' => array( 'unicode' => '&#xf56a;', 'styles' => array( 'sow-fas' ), ),
385
+ 'drumstick-bite' => array( 'unicode' => '&#xf6d7;', 'styles' => array( 'sow-fas' ), ),
386
+ 'drupal' => array( 'unicode' => '&#xf1a9;', 'styles' => array( 'sow-fab' ), ),
387
+ 'dumbbell' => array( 'unicode' => '&#xf44b;', 'styles' => array( 'sow-fas' ), ),
388
+ 'dumpster' => array( 'unicode' => '&#xf793;', 'styles' => array( 'sow-fas' ), ),
389
+ 'dumpster-fire' => array( 'unicode' => '&#xf794;', 'styles' => array( 'sow-fas' ), ),
390
+ 'dungeon' => array( 'unicode' => '&#xf6d9;', 'styles' => array( 'sow-fas' ), ),
391
+ 'dyalog' => array( 'unicode' => '&#xf399;', 'styles' => array( 'sow-fab' ), ),
392
+ 'earlybirds' => array( 'unicode' => '&#xf39a;', 'styles' => array( 'sow-fab' ), ),
393
+ 'ebay' => array( 'unicode' => '&#xf4f4;', 'styles' => array( 'sow-fab' ), ),
394
+ 'edge' => array( 'unicode' => '&#xf282;', 'styles' => array( 'sow-fab' ), ),
395
+ 'edit' => array( 'unicode' => '&#xf044;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
396
+ 'egg' => array( 'unicode' => '&#xf7fb;', 'styles' => array( 'sow-fas' ), ),
397
+ 'eject' => array( 'unicode' => '&#xf052;', 'styles' => array( 'sow-fas' ), ),
398
+ 'elementor' => array( 'unicode' => '&#xf430;', 'styles' => array( 'sow-fab' ), ),
399
+ 'ellipsis-h' => array( 'unicode' => '&#xf141;', 'styles' => array( 'sow-fas' ), ),
400
+ 'ellipsis-v' => array( 'unicode' => '&#xf142;', 'styles' => array( 'sow-fas' ), ),
401
+ 'ello' => array( 'unicode' => '&#xf5f1;', 'styles' => array( 'sow-fab' ), ),
402
+ 'ember' => array( 'unicode' => '&#xf423;', 'styles' => array( 'sow-fab' ), ),
403
+ 'empire' => array( 'unicode' => '&#xf1d1;', 'styles' => array( 'sow-fab' ), ),
404
+ 'envelope' => array( 'unicode' => '&#xf0e0;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
405
+ 'envelope-open' => array( 'unicode' => '&#xf2b6;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
406
+ 'envelope-open-text' => array( 'unicode' => '&#xf658;', 'styles' => array( 'sow-fas' ), ),
407
+ 'envelope-square' => array( 'unicode' => '&#xf199;', 'styles' => array( 'sow-fas' ), ),
408
+ 'envira' => array( 'unicode' => '&#xf299;', 'styles' => array( 'sow-fab' ), ),
409
+ 'equals' => array( 'unicode' => '&#xf52c;', 'styles' => array( 'sow-fas' ), ),
410
+ 'eraser' => array( 'unicode' => '&#xf12d;', 'styles' => array( 'sow-fas' ), ),
411
+ 'erlang' => array( 'unicode' => '&#xf39d;', 'styles' => array( 'sow-fab' ), ),
412
+ 'ethereum' => array( 'unicode' => '&#xf42e;', 'styles' => array( 'sow-fab' ), ),
413
+ 'ethernet' => array( 'unicode' => '&#xf796;', 'styles' => array( 'sow-fas' ), ),
414
+ 'etsy' => array( 'unicode' => '&#xf2d7;', 'styles' => array( 'sow-fab' ), ),
415
+ 'euro-sign' => array( 'unicode' => '&#xf153;', 'styles' => array( 'sow-fas' ), ),
416
+ 'evernote' => array( 'unicode' => '&#xf839;', 'styles' => array( 'sow-fab' ), ),
417
+ 'exchange-alt' => array( 'unicode' => '&#xf362;', 'styles' => array( 'sow-fas' ), ),
418
+ 'exclamation' => array( 'unicode' => '&#xf12a;', 'styles' => array( 'sow-fas' ), ),
419
+ 'exclamation-circle' => array( 'unicode' => '&#xf06a;', 'styles' => array( 'sow-fas' ), ),
420
+ 'exclamation-triangle' => array( 'unicode' => '&#xf071;', 'styles' => array( 'sow-fas' ), ),
421
+ 'expand' => array( 'unicode' => '&#xf065;', 'styles' => array( 'sow-fas' ), ),
422
+ 'expand-arrows-alt' => array( 'unicode' => '&#xf31e;', 'styles' => array( 'sow-fas' ), ),
423
+ 'expeditedssl' => array( 'unicode' => '&#xf23e;', 'styles' => array( 'sow-fab' ), ),
424
+ 'external-link-alt' => array( 'unicode' => '&#xf35d;', 'styles' => array( 'sow-fas' ), ),
425
+ 'external-link-square-alt' => array( 'unicode' => '&#xf360;', 'styles' => array( 'sow-fas' ), ),
426
+ 'eye' => array( 'unicode' => '&#xf06e;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
427
+ 'eye-dropper' => array( 'unicode' => '&#xf1fb;', 'styles' => array( 'sow-fas' ), ),
428
+ 'eye-slash' => array( 'unicode' => '&#xf070;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
429
+ 'facebook' => array( 'unicode' => '&#xf09a;', 'styles' => array( 'sow-fab' ), ),
430
+ 'facebook-f' => array( 'unicode' => '&#xf39e;', 'styles' => array( 'sow-fab' ), ),
431
+ 'facebook-messenger' => array( 'unicode' => '&#xf39f;', 'styles' => array( 'sow-fab' ), ),
432
+ 'facebook-square' => array( 'unicode' => '&#xf082;', 'styles' => array( 'sow-fab' ), ),
433
+ 'fantasy-flight-games' => array( 'unicode' => '&#xf6dc;', 'styles' => array( 'sow-fab' ), ),
434
+ 'fast-backward' => array( 'unicode' => '&#xf049;', 'styles' => array( 'sow-fas' ), ),
435
+ 'fast-forward' => array( 'unicode' => '&#xf050;', 'styles' => array( 'sow-fas' ), ),
436
+ 'fax' => array( 'unicode' => '&#xf1ac;', 'styles' => array( 'sow-fas' ), ),
437
+ 'feather' => array( 'unicode' => '&#xf52d;', 'styles' => array( 'sow-fas' ), ),
438
+ 'feather-alt' => array( 'unicode' => '&#xf56b;', 'styles' => array( 'sow-fas' ), ),
439
+ 'fedex' => array( 'unicode' => '&#xf797;', 'styles' => array( 'sow-fab' ), ),
440
+ 'fedora' => array( 'unicode' => '&#xf798;', 'styles' => array( 'sow-fab' ), ),
441
+ 'female' => array( 'unicode' => '&#xf182;', 'styles' => array( 'sow-fas' ), ),
442
+ 'fighter-jet' => array( 'unicode' => '&#xf0fb;', 'styles' => array( 'sow-fas' ), ),
443
+ 'figma' => array( 'unicode' => '&#xf799;', 'styles' => array( 'sow-fab' ), ),
444
+ 'file' => array( 'unicode' => '&#xf15b;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
445
+ 'file-alt' => array( 'unicode' => '&#xf15c;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
446
+ 'file-archive' => array( 'unicode' => '&#xf1c6;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
447
+ 'file-audio' => array( 'unicode' => '&#xf1c7;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
448
+ 'file-code' => array( 'unicode' => '&#xf1c9;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
449
+ 'file-contract' => array( 'unicode' => '&#xf56c;', 'styles' => array( 'sow-fas' ), ),
450
+ 'file-csv' => array( 'unicode' => '&#xf6dd;', 'styles' => array( 'sow-fas' ), ),
451
+ 'file-download' => array( 'unicode' => '&#xf56d;', 'styles' => array( 'sow-fas' ), ),
452
+ 'file-excel' => array( 'unicode' => '&#xf1c3;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
453
+ 'file-export' => array( 'unicode' => '&#xf56e;', 'styles' => array( 'sow-fas' ), ),
454
+ 'file-image' => array( 'unicode' => '&#xf1c5;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
455
+ 'file-import' => array( 'unicode' => '&#xf56f;', 'styles' => array( 'sow-fas' ), ),
456
+ 'file-invoice' => array( 'unicode' => '&#xf570;', 'styles' => array( 'sow-fas' ), ),
457
+ 'file-invoice-dollar' => array( 'unicode' => '&#xf571;', 'styles' => array( 'sow-fas' ), ),
458
+ 'file-medical' => array( 'unicode' => '&#xf477;', 'styles' => array( 'sow-fas' ), ),
459
+ 'file-medical-alt' => array( 'unicode' => '&#xf478;', 'styles' => array( 'sow-fas' ), ),
460
+ 'file-pdf' => array( 'unicode' => '&#xf1c1;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
461
+ 'file-powerpoint' => array( 'unicode' => '&#xf1c4;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
462
+ 'file-prescription' => array( 'unicode' => '&#xf572;', 'styles' => array( 'sow-fas' ), ),
463
+ 'file-signature' => array( 'unicode' => '&#xf573;', 'styles' => array( 'sow-fas' ), ),
464
+ 'file-upload' => array( 'unicode' => '&#xf574;', 'styles' => array( 'sow-fas' ), ),
465
+ 'file-video' => array( 'unicode' => '&#xf1c8;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
466
+ 'file-word' => array( 'unicode' => '&#xf1c2;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
467
+ 'fill' => array( 'unicode' => '&#xf575;', 'styles' => array( 'sow-fas' ), ),
468
+ 'fill-drip' => array( 'unicode' => '&#xf576;', 'styles' => array( 'sow-fas' ), ),
469
+ 'film' => array( 'unicode' => '&#xf008;', 'styles' => array( 'sow-fas' ), ),
470
+ 'filter' => array( 'unicode' => '&#xf0b0;', 'styles' => array( 'sow-fas' ), ),
471
+ 'fingerprint' => array( 'unicode' => '&#xf577;', 'styles' => array( 'sow-fas' ), ),
472
+ 'fire' => array( 'unicode' => '&#xf06d;', 'styles' => array( 'sow-fas' ), ),
473
+ 'fire-alt' => array( 'unicode' => '&#xf7e4;', 'styles' => array( 'sow-fas' ), ),
474
+ 'fire-extinguisher' => array( 'unicode' => '&#xf134;', 'styles' => array( 'sow-fas' ), ),
475
+ 'firefox' => array( 'unicode' => '&#xf269;', 'styles' => array( 'sow-fab' ), ),
476
+ 'first-aid' => array( 'unicode' => '&#xf479;', 'styles' => array( 'sow-fas' ), ),
477
+ 'first-order' => array( 'unicode' => '&#xf2b0;', 'styles' => array( 'sow-fab' ), ),
478
+ 'first-order-alt' => array( 'unicode' => '&#xf50a;', 'styles' => array( 'sow-fab' ), ),
479
+ 'firstdraft' => array( 'unicode' => '&#xf3a1;', 'styles' => array( 'sow-fab' ), ),
480
+ 'fish' => array( 'unicode' => '&#xf578;', 'styles' => array( 'sow-fas' ), ),
481
+ 'fist-raised' => array( 'unicode' => '&#xf6de;', 'styles' => array( 'sow-fas' ), ),
482
+ 'flag' => array( 'unicode' => '&#xf024;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
483
+ 'flag-checkered' => array( 'unicode' => '&#xf11e;', 'styles' => array( 'sow-fas' ), ),
484
+ 'flag-usa' => array( 'unicode' => '&#xf74d;', 'styles' => array( 'sow-fas' ), ),
485
+ 'flask' => array( 'unicode' => '&#xf0c3;', 'styles' => array( 'sow-fas' ), ),
486
+ 'flickr' => array( 'unicode' => '&#xf16e;', 'styles' => array( 'sow-fab' ), ),
487
+ 'flipboard' => array( 'unicode' => '&#xf44d;', 'styles' => array( 'sow-fab' ), ),
488
+ 'flushed' => array( 'unicode' => '&#xf579;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
489
+ 'fly' => array( 'unicode' => '&#xf417;', 'styles' => array( 'sow-fab' ), ),
490
+ 'folder' => array( 'unicode' => '&#xf07b;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
491
+ 'folder-minus' => array( 'unicode' => '&#xf65d;', 'styles' => array( 'sow-fas' ), ),
492
+ 'folder-open' => array( 'unicode' => '&#xf07c;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
493
+ 'folder-plus' => array( 'unicode' => '&#xf65e;', 'styles' => array( 'sow-fas' ), ),
494
+ 'font' => array( 'unicode' => '&#xf031;', 'styles' => array( 'sow-fas' ), ),
495
+ 'font-awesome' => array( 'unicode' => '&#xf2b4;', 'styles' => array( 'sow-fab' ), ),
496
+ 'font-awesome-alt' => array( 'unicode' => '&#xf35c;', 'styles' => array( 'sow-fab' ), ),
497
+ 'font-awesome-flag' => array( 'unicode' => '&#xf425;', 'styles' => array( 'sow-fab' ), ),
498
+ 'font-awesome-logo-full' => array( 'unicode' => '&#xf4e6;', 'styles' => array( 'sow-fab', 'sow-fas', 'sow-far' ), ),
499
+ 'fonticons' => array( 'unicode' => '&#xf280;', 'styles' => array( 'sow-fab' ), ),
500
+ 'fonticons-fi' => array( 'unicode' => '&#xf3a2;', 'styles' => array( 'sow-fab' ), ),
501
+ 'football-ball' => array( 'unicode' => '&#xf44e;', 'styles' => array( 'sow-fas' ), ),
502
+ 'fort-awesome' => array( 'unicode' => '&#xf286;', 'styles' => array( 'sow-fab' ), ),
503
+ 'fort-awesome-alt' => array( 'unicode' => '&#xf3a3;', 'styles' => array( 'sow-fab' ), ),
504
+ 'forumbee' => array( 'unicode' => '&#xf211;', 'styles' => array( 'sow-fab' ), ),
505
+ 'forward' => array( 'unicode' => '&#xf04e;', 'styles' => array( 'sow-fas' ), ),
506
+ 'foursquare' => array( 'unicode' => '&#xf180;', 'styles' => array( 'sow-fab' ), ),
507
+ 'free-code-camp' => array( 'unicode' => '&#xf2c5;', 'styles' => array( 'sow-fab' ), ),
508
+ 'freebsd' => array( 'unicode' => '&#xf3a4;', 'styles' => array( 'sow-fab' ), ),
509
+ 'frog' => array( 'unicode' => '&#xf52e;', 'styles' => array( 'sow-fas' ), ),
510
+ 'frown' => array( 'unicode' => '&#xf119;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
511
+ 'frown-open' => array( 'unicode' => '&#xf57a;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
512
+ 'fulcrum' => array( 'unicode' => '&#xf50b;', 'styles' => array( 'sow-fab' ), ),
513
+ 'funnel-dollar' => array( 'unicode' => '&#xf662;', 'styles' => array( 'sow-fas' ), ),
514
+ 'futbol' => array( 'unicode' => '&#xf1e3;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
515
+ 'galactic-republic' => array( 'unicode' => '&#xf50c;', 'styles' => array( 'sow-fab' ), ),
516
+ 'galactic-senate' => array( 'unicode' => '&#xf50d;', 'styles' => array( 'sow-fab' ), ),
517
+ 'gamepad' => array( 'unicode' => '&#xf11b;', 'styles' => array( 'sow-fas' ), ),
518
+ 'gas-pump' => array( 'unicode' => '&#xf52f;', 'styles' => array( 'sow-fas' ), ),
519
+ 'gavel' => array( 'unicode' => '&#xf0e3;', 'styles' => array( 'sow-fas' ), ),
520
+ 'gem' => array( 'unicode' => '&#xf3a5;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
521
+ 'genderless' => array( 'unicode' => '&#xf22d;', 'styles' => array( 'sow-fas' ), ),
522
+ 'get-pocket' => array( 'unicode' => '&#xf265;', 'styles' => array( 'sow-fab' ), ),
523
+ 'gg' => array( 'unicode' => '&#xf260;', 'styles' => array( 'sow-fab' ), ),
524
+ 'gg-circle' => array( 'unicode' => '&#xf261;', 'styles' => array( 'sow-fab' ), ),
525
+ 'ghost' => array( 'unicode' => '&#xf6e2;', 'styles' => array( 'sow-fas' ), ),
526
+ 'gift' => array( 'unicode' => '&#xf06b;', 'styles' => array( 'sow-fas' ), ),
527
+ 'gifts' => array( 'unicode' => '&#xf79c;', 'styles' => array( 'sow-fas' ), ),
528
+ 'git' => array( 'unicode' => '&#xf1d3;', 'styles' => array( 'sow-fab' ), ),
529
+ 'git-alt' => array( 'unicode' => '&#xf841;', 'styles' => array( 'sow-fab' ), ),
530
+ 'git-square' => array( 'unicode' => '&#xf1d2;', 'styles' => array( 'sow-fab' ), ),
531
+ 'github' => array( 'unicode' => '&#xf09b;', 'styles' => array( 'sow-fab' ), ),
532
+ 'github-alt' => array( 'unicode' => '&#xf113;', 'styles' => array( 'sow-fab' ), ),
533
+ 'github-square' => array( 'unicode' => '&#xf092;', 'styles' => array( 'sow-fab' ), ),
534
+ 'gitkraken' => array( 'unicode' => '&#xf3a6;', 'styles' => array( 'sow-fab' ), ),
535
+ 'gitlab' => array( 'unicode' => '&#xf296;', 'styles' => array( 'sow-fab' ), ),
536
+ 'gitter' => array( 'unicode' => '&#xf426;', 'styles' => array( 'sow-fab' ), ),
537
+ 'glass-cheers' => array( 'unicode' => '&#xf79f;', 'styles' => array( 'sow-fas' ), ),
538
+ 'glass-martini' => array( 'unicode' => '&#xf000;', 'styles' => array( 'sow-fas' ), ),
539
+ 'glass-martini-alt' => array( 'unicode' => '&#xf57b;', 'styles' => array( 'sow-fas' ), ),
540
+ 'glass-whiskey' => array( 'unicode' => '&#xf7a0;', 'styles' => array( 'sow-fas' ), ),
541
+ 'glasses' => array( 'unicode' => '&#xf530;', 'styles' => array( 'sow-fas' ), ),
542
+ 'glide' => array( 'unicode' => '&#xf2a5;', 'styles' => array( 'sow-fab' ), ),
543
+ 'glide-g' => array( 'unicode' => '&#xf2a6;', 'styles' => array( 'sow-fab' ), ),
544
+ 'globe' => array( 'unicode' => '&#xf0ac;', 'styles' => array( 'sow-fas' ), ),
545
+ 'globe-africa' => array( 'unicode' => '&#xf57c;', 'styles' => array( 'sow-fas' ), ),
546
+ 'globe-americas' => array( 'unicode' => '&#xf57d;', 'styles' => array( 'sow-fas' ), ),
547
+ 'globe-asia' => array( 'unicode' => '&#xf57e;', 'styles' => array( 'sow-fas' ), ),
548
+ 'globe-europe' => array( 'unicode' => '&#xf7a2;', 'styles' => array( 'sow-fas' ), ),
549
+ 'gofore' => array( 'unicode' => '&#xf3a7;', 'styles' => array( 'sow-fab' ), ),
550
+ 'golf-ball' => array( 'unicode' => '&#xf450;', 'styles' => array( 'sow-fas' ), ),
551
+ 'goodreads' => array( 'unicode' => '&#xf3a8;', 'styles' => array( 'sow-fab' ), ),
552
+ 'goodreads-g' => array( 'unicode' => '&#xf3a9;', 'styles' => array( 'sow-fab' ), ),
553
+ 'google' => array( 'unicode' => '&#xf1a0;', 'styles' => array( 'sow-fab' ), ),
554
+ 'google-drive' => array( 'unicode' => '&#xf3aa;', 'styles' => array( 'sow-fab' ), ),
555
+ 'google-play' => array( 'unicode' => '&#xf3ab;', 'styles' => array( 'sow-fab' ), ),
556
+ 'google-plus' => array( 'unicode' => '&#xf2b3;', 'styles' => array( 'sow-fab' ), ),
557
+ 'google-plus-g' => array( 'unicode' => '&#xf0d5;', 'styles' => array( 'sow-fab' ), ),
558
+ 'google-plus-square' => array( 'unicode' => '&#xf0d4;', 'styles' => array( 'sow-fab' ), ),
559
+ 'google-wallet' => array( 'unicode' => '&#xf1ee;', 'styles' => array( 'sow-fab' ), ),
560
+ 'gopuram' => array( 'unicode' => '&#xf664;', 'styles' => array( 'sow-fas' ), ),
561
+ 'graduation-cap' => array( 'unicode' => '&#xf19d;', 'styles' => array( 'sow-fas' ), ),
562
+ 'gratipay' => array( 'unicode' => '&#xf184;', 'styles' => array( 'sow-fab' ), ),
563
+ 'grav' => array( 'unicode' => '&#xf2d6;', 'styles' => array( 'sow-fab' ), ),
564
+ 'greater-than' => array( 'unicode' => '&#xf531;', 'styles' => array( 'sow-fas' ), ),
565
+ 'greater-than-equal' => array( 'unicode' => '&#xf532;', 'styles' => array( 'sow-fas' ), ),
566
+ 'grimace' => array( 'unicode' => '&#xf57f;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
567
+ 'grin' => array( 'unicode' => '&#xf580;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
568
+ 'grin-alt' => array( 'unicode' => '&#xf581;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
569
+ 'grin-beam' => array( 'unicode' => '&#xf582;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
570
+ 'grin-beam-sweat' => array( 'unicode' => '&#xf583;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
571
+ 'grin-hearts' => array( 'unicode' => '&#xf584;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
572
+ 'grin-squint' => array( 'unicode' => '&#xf585;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
573
+ 'grin-squint-tears' => array( 'unicode' => '&#xf586;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
574
+ 'grin-stars' => array( 'unicode' => '&#xf587;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
575
+ 'grin-tears' => array( 'unicode' => '&#xf588;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
576
+ 'grin-tongue' => array( 'unicode' => '&#xf589;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
577
+ 'grin-tongue-squint' => array( 'unicode' => '&#xf58a;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
578
+ 'grin-tongue-wink' => array( 'unicode' => '&#xf58b;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
579
+ 'grin-wink' => array( 'unicode' => '&#xf58c;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
580
+ 'grip-horizontal' => array( 'unicode' => '&#xf58d;', 'styles' => array( 'sow-fas' ), ),
581
+ 'grip-lines' => array( 'unicode' => '&#xf7a4;', 'styles' => array( 'sow-fas' ), ),
582
+ 'grip-lines-vertical' => array( 'unicode' => '&#xf7a5;', 'styles' => array( 'sow-fas' ), ),
583
+ 'grip-vertical' => array( 'unicode' => '&#xf58e;', 'styles' => array( 'sow-fas' ), ),
584
+ 'gripfire' => array( 'unicode' => '&#xf3ac;', 'styles' => array( 'sow-fab' ), ),
585
+ 'grunt' => array( 'unicode' => '&#xf3ad;', 'styles' => array( 'sow-fab' ), ),
586
+ 'guitar' => array( 'unicode' => '&#xf7a6;', 'styles' => array( 'sow-fas' ), ),
587
+ 'gulp' => array( 'unicode' => '&#xf3ae;', 'styles' => array( 'sow-fab' ), ),
588
+ 'h-square' => array( 'unicode' => '&#xf0fd;', 'styles' => array( 'sow-fas' ), ),
589
+ 'hacker-news' => array( 'unicode' => '&#xf1d4;', 'styles' => array( 'sow-fab' ), ),
590
+ 'hacker-news-square' => array( 'unicode' => '&#xf3af;', 'styles' => array( 'sow-fab' ), ),
591
+ 'hackerrank' => array( 'unicode' => '&#xf5f7;', 'styles' => array( 'sow-fab' ), ),
592
+ 'hamburger' => array( 'unicode' => '&#xf805;', 'styles' => array( 'sow-fas' ), ),
593
+ 'hammer' => array( 'unicode' => '&#xf6e3;', 'styles' => array( 'sow-fas' ), ),
594
+ 'hamsa' => array( 'unicode' => '&#xf665;', 'styles' => array( 'sow-fas' ), ),
595
+ 'hand-holding' => array( 'unicode' => '&#xf4bd;', 'styles' => array( 'sow-fas' ), ),
596
+ 'hand-holding-heart' => array( 'unicode' => '&#xf4be;', 'styles' => array( 'sow-fas' ), ),
597
+ 'hand-holding-usd' => array( 'unicode' => '&#xf4c0;', 'styles' => array( 'sow-fas' ), ),
598
+ 'hand-lizard' => array( 'unicode' => '&#xf258;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
599
+ 'hand-middle-finger' => array( 'unicode' => '&#xf806;', 'styles' => array( 'sow-fas' ), ),
600
+ 'hand-paper' => array( 'unicode' => '&#xf256;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
601
+ 'hand-peace' => array( 'unicode' => '&#xf25b;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
602
+ 'hand-point-down' => array( 'unicode' => '&#xf0a7;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
603
+ 'hand-point-left' => array( 'unicode' => '&#xf0a5;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
604
+ 'hand-point-right' => array( 'unicode' => '&#xf0a4;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
605
+ 'hand-point-up' => array( 'unicode' => '&#xf0a6;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
606
+ 'hand-pointer' => array( 'unicode' => '&#xf25a;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
607
+ 'hand-rock' => array( 'unicode' => '&#xf255;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
608
+ 'hand-scissors' => array( 'unicode' => '&#xf257;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
609
+ 'hand-spock' => array( 'unicode' => '&#xf259;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
610
+ 'hands' => array( 'unicode' => '&#xf4c2;', 'styles' => array( 'sow-fas' ), ),
611
+ 'hands-helping' => array( 'unicode' => '&#xf4c4;', 'styles' => array( 'sow-fas' ), ),
612
+ 'handshake' => array( 'unicode' => '&#xf2b5;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
613
+ 'hanukiah' => array( 'unicode' => '&#xf6e6;', 'styles' => array( 'sow-fas' ), ),
614
+ 'hard-hat' => array( 'unicode' => '&#xf807;', 'styles' => array( 'sow-fas' ), ),
615
+ 'hashtag' => array( 'unicode' => '&#xf292;', 'styles' => array( 'sow-fas' ), ),
616
+ 'hat-wizard' => array( 'unicode' => '&#xf6e8;', 'styles' => array( 'sow-fas' ), ),
617
+ 'haykal' => array( 'unicode' => '&#xf666;', 'styles' => array( 'sow-fas' ), ),
618
+ 'hdd' => array( 'unicode' => '&#xf0a0;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
619
+ 'heading' => array( 'unicode' => '&#xf1dc;', 'styles' => array( 'sow-fas' ), ),
620
+ 'headphones' => array( 'unicode' => '&#xf025;', 'styles' => array( 'sow-fas' ), ),
621
+ 'headphones-alt' => array( 'unicode' => '&#xf58f;', 'styles' => array( 'sow-fas' ), ),
622
+ 'headset' => array( 'unicode' => '&#xf590;', 'styles' => array( 'sow-fas' ), ),
623
+ 'heart' => array( 'unicode' => '&#xf004;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
624
+ 'heart-broken' => array( 'unicode' => '&#xf7a9;', 'styles' => array( 'sow-fas' ), ),
625
+ 'heartbeat' => array( 'unicode' => '&#xf21e;', 'styles' => array( 'sow-fas' ), ),
626
+ 'helicopter' => array( 'unicode' => '&#xf533;', 'styles' => array( 'sow-fas' ), ),
627
+ 'highlighter' => array( 'unicode' => '&#xf591;', 'styles' => array( 'sow-fas' ), ),
628
+ 'hiking' => array( 'unicode' => '&#xf6ec;', 'styles' => array( 'sow-fas' ), ),
629
+ 'hippo' => array( 'unicode' => '&#xf6ed;', 'styles' => array( 'sow-fas' ), ),
630
+ 'hips' => array( 'unicode' => '&#xf452;', 'styles' => array( 'sow-fab' ), ),
631
+ 'hire-a-helper' => array( 'unicode' => '&#xf3b0;', 'styles' => array( 'sow-fab' ), ),
632
+ 'history' => array( 'unicode' => '&#xf1da;', 'styles' => array( 'sow-fas' ), ),
633
+ 'hockey-puck' => array( 'unicode' => '&#xf453;', 'styles' => array( 'sow-fas' ), ),
634
+ 'holly-berry' => array( 'unicode' => '&#xf7aa;', 'styles' => array( 'sow-fas' ), ),
635
+ 'home' => array( 'unicode' => '&#xf015;', 'styles' => array( 'sow-fas' ), ),
636
+ 'hooli' => array( 'unicode' => '&#xf427;', 'styles' => array( 'sow-fab' ), ),
637
+ 'hornbill' => array( 'unicode' => '&#xf592;', 'styles' => array( 'sow-fab' ), ),
638
+ 'horse' => array( 'unicode' => '&#xf6f0;', 'styles' => array( 'sow-fas' ), ),
639
+ 'horse-head' => array( 'unicode' => '&#xf7ab;', 'styles' => array( 'sow-fas' ), ),
640
+ 'hospital' => array( 'unicode' => '&#xf0f8;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
641
+ 'hospital-alt' => array( 'unicode' => '&#xf47d;', 'styles' => array( 'sow-fas' ), ),
642
+ 'hospital-symbol' => array( 'unicode' => '&#xf47e;', 'styles' => array( 'sow-fas' ), ),
643
+ 'hot-tub' => array( 'unicode' => '&#xf593;', 'styles' => array( 'sow-fas' ), ),
644
+ 'hotdog' => array( 'unicode' => '&#xf80f;', 'styles' => array( 'sow-fas' ), ),
645
+ 'hotel' => array( 'unicode' => '&#xf594;', 'styles' => array( 'sow-fas' ), ),
646
+ 'hotjar' => array( 'unicode' => '&#xf3b1;', 'styles' => array( 'sow-fab' ), ),
647
+ 'hourglass' => array( 'unicode' => '&#xf254;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
648
+ 'hourglass-end' => array( 'unicode' => '&#xf253;', 'styles' => array( 'sow-fas' ), ),
649
+ 'hourglass-half' => array( 'unicode' => '&#xf252;', 'styles' => array( 'sow-fas' ), ),
650
+ 'hourglass-start' => array( 'unicode' => '&#xf251;', 'styles' => array( 'sow-fas' ), ),
651
+ 'house-damage' => array( 'unicode' => '&#xf6f1;', 'styles' => array( 'sow-fas' ), ),
652
+ 'houzz' => array( 'unicode' => '&#xf27c;', 'styles' => array( 'sow-fab' ), ),
653
+ 'hryvnia' => array( 'unicode' => '&#xf6f2;', 'styles' => array( 'sow-fas' ), ),
654
+ 'html5' => array( 'unicode' => '&#xf13b;', 'styles' => array( 'sow-fab' ), ),
655
+ 'hubspot' => array( 'unicode' => '&#xf3b2;', 'styles' => array( 'sow-fab' ), ),
656
+ 'i-cursor' => array( 'unicode' => '&#xf246;', 'styles' => array( 'sow-fas' ), ),
657
+ 'ice-cream' => array( 'unicode' => '&#xf810;', 'styles' => array( 'sow-fas' ), ),
658
+ 'icicles' => array( 'unicode' => '&#xf7ad;', 'styles' => array( 'sow-fas' ), ),
659
+ 'id-badge' => array( 'unicode' => '&#xf2c1;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
660
+ 'id-card' => array( 'unicode' => '&#xf2c2;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
661
+ 'id-card-alt' => array( 'unicode' => '&#xf47f;', 'styles' => array( 'sow-fas' ), ),
662
+ 'igloo' => array( 'unicode' => '&#xf7ae;', 'styles' => array( 'sow-fas' ), ),
663
+ 'image' => array( 'unicode' => '&#xf03e;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
664
+ 'images' => array( 'unicode' => '&#xf302;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
665
+ 'imdb' => array( 'unicode' => '&#xf2d8;', 'styles' => array( 'sow-fab' ), ),
666
+ 'inbox' => array( 'unicode' => '&#xf01c;', 'styles' => array( 'sow-fas' ), ),
667
+ 'indent' => array( 'unicode' => '&#xf03c;', 'styles' => array( 'sow-fas' ), ),
668
+ 'industry' => array( 'unicode' => '&#xf275;', 'styles' => array( 'sow-fas' ), ),
669
+ 'infinity' => array( 'unicode' => '&#xf534;', 'styles' => array( 'sow-fas' ), ),
670
+ 'info' => array( 'unicode' => '&#xf129;', 'styles' => array( 'sow-fas' ), ),
671
+ 'info-circle' => array( 'unicode' => '&#xf05a;', 'styles' => array( 'sow-fas' ), ),
672
+ 'instagram' => array( 'unicode' => '&#xf16d;', 'styles' => array( 'sow-fab' ), ),
673
+ 'intercom' => array( 'unicode' => '&#xf7af;', 'styles' => array( 'sow-fab' ), ),
674
+ 'internet-explorer' => array( 'unicode' => '&#xf26b;', 'styles' => array( 'sow-fab' ), ),
675
+ 'invision' => array( 'unicode' => '&#xf7b0;', 'styles' => array( 'sow-fab' ), ),
676
+ 'ioxhost' => array( 'unicode' => '&#xf208;', 'styles' => array( 'sow-fab' ), ),
677
+ 'italic' => array( 'unicode' => '&#xf033;', 'styles' => array( 'sow-fas' ), ),
678
+ 'itch-io' => array( 'unicode' => '&#xf83a;', 'styles' => array( 'sow-fab' ), ),
679
+ 'itunes' => array( 'unicode' => '&#xf3b4;', 'styles' => array( 'sow-fab' ), ),
680
+ 'itunes-note' => array( 'unicode' => '&#xf3b5;', 'styles' => array( 'sow-fab' ), ),
681
+ 'java' => array( 'unicode' => '&#xf4e4;', 'styles' => array( 'sow-fab' ), ),
682
+ 'jedi' => array( 'unicode' => '&#xf669;', 'styles' => array( 'sow-fas' ), ),
683
+ 'jedi-order' => array( 'unicode' => '&#xf50e;', 'styles' => array( 'sow-fab' ), ),
684
+ 'jenkins' => array( 'unicode' => '&#xf3b6;', 'styles' => array( 'sow-fab' ), ),
685
+ 'jira' => array( 'unicode' => '&#xf7b1;', 'styles' => array( 'sow-fab' ), ),
686
+ 'joget' => array( 'unicode' => '&#xf3b7;', 'styles' => array( 'sow-fab' ), ),
687
+ 'joint' => array( 'unicode' => '&#xf595;', 'styles' => array( 'sow-fas' ), ),
688
+ 'joomla' => array( 'unicode' => '&#xf1aa;', 'styles' => array( 'sow-fab' ), ),
689
+ 'journal-whills' => array( 'unicode' => '&#xf66a;', 'styles' => array( 'sow-fas' ), ),
690
+ 'js' => array( 'unicode' => '&#xf3b8;', 'styles' => array( 'sow-fab' ), ),
691
+ 'js-square' => array( 'unicode' => '&#xf3b9;', 'styles' => array( 'sow-fab' ), ),
692
+ 'jsfiddle' => array( 'unicode' => '&#xf1cc;', 'styles' => array( 'sow-fab' ), ),
693
+ 'kaaba' => array( 'unicode' => '&#xf66b;', 'styles' => array( 'sow-fas' ), ),
694
+ 'kaggle' => array( 'unicode' => '&#xf5fa;', 'styles' => array( 'sow-fab' ), ),
695
+ 'key' => array( 'unicode' => '&#xf084;', 'styles' => array( 'sow-fas' ), ),
696
+ 'keybase' => array( 'unicode' => '&#xf4f5;', 'styles' => array( 'sow-fab' ), ),
697
+ 'keyboard' => array( 'unicode' => '&#xf11c;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
698
+ 'keycdn' => array( 'unicode' => '&#xf3ba;', 'styles' => array( 'sow-fab' ), ),
699
+ 'khanda' => array( 'unicode' => '&#xf66d;', 'styles' => array( 'sow-fas' ), ),
700
+ 'kickstarter' => array( 'unicode' => '&#xf3bb;', 'styles' => array( 'sow-fab' ), ),
701
+ 'kickstarter-k' => array( 'unicode' => '&#xf3bc;', 'styles' => array( 'sow-fab' ), ),
702
+ 'kiss' => array( 'unicode' => '&#xf596;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
703
+ 'kiss-beam' => array( 'unicode' => '&#xf597;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
704
+ 'kiss-wink-heart' => array( 'unicode' => '&#xf598;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
705
+ 'kiwi-bird' => array( 'unicode' => '&#xf535;', 'styles' => array( 'sow-fas' ), ),
706
+ 'korvue' => array( 'unicode' => '&#xf42f;', 'styles' => array( 'sow-fab' ), ),
707
+ 'landmark' => array( 'unicode' => '&#xf66f;', 'styles' => array( 'sow-fas' ), ),
708
+ 'language' => array( 'unicode' => '&#xf1ab;', 'styles' => array( 'sow-fas' ), ),
709
+ 'laptop' => array( 'unicode' => '&#xf109;', 'styles' => array( 'sow-fas' ), ),
710
+ 'laptop-code' => array( 'unicode' => '&#xf5fc;', 'styles' => array( 'sow-fas' ), ),
711
+ 'laptop-medical' => array( 'unicode' => '&#xf812;', 'styles' => array( 'sow-fas' ), ),
712
+ 'laravel' => array( 'unicode' => '&#xf3bd;', 'styles' => array( 'sow-fab' ), ),
713
+ 'lastfm' => array( 'unicode' => '&#xf202;', 'styles' => array( 'sow-fab' ), ),
714
+ 'lastfm-square' => array( 'unicode' => '&#xf203;', 'styles' => array( 'sow-fab' ), ),
715
+ 'laugh' => array( 'unicode' => '&#xf599;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
716
+ 'laugh-beam' => array( 'unicode' => '&#xf59a;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
717
+ 'laugh-squint' => array( 'unicode' => '&#xf59b;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
718
+ 'laugh-wink' => array( 'unicode' => '&#xf59c;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
719
+ 'layer-group' => array( 'unicode' => '&#xf5fd;', 'styles' => array( 'sow-fas' ), ),
720
+ 'leaf' => array( 'unicode' => '&#xf06c;', 'styles' => array( 'sow-fas' ), ),
721
+ 'leanpub' => array( 'unicode' => '&#xf212;', 'styles' => array( 'sow-fab' ), ),
722
+ 'lemon' => array( 'unicode' => '&#xf094;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
723
+ 'less' => array( 'unicode' => '&#xf41d;', 'styles' => array( 'sow-fab' ), ),
724
+ 'less-than' => array( 'unicode' => '&#xf536;', 'styles' => array( 'sow-fas' ), ),
725
+ 'less-than-equal' => array( 'unicode' => '&#xf537;', 'styles' => array( 'sow-fas' ), ),
726
+ 'level-down-alt' => array( 'unicode' => '&#xf3be;', 'styles' => array( 'sow-fas' ), ),
727
+ 'level-up-alt' => array( 'unicode' => '&#xf3bf;', 'styles' => array( 'sow-fas' ), ),
728
+ 'life-ring' => array( 'unicode' => '&#xf1cd;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
729
+ 'lightbulb' => array( 'unicode' => '&#xf0eb;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
730
+ 'line' => array( 'unicode' => '&#xf3c0;', 'styles' => array( 'sow-fab' ), ),
731
+ 'link' => array( 'unicode' => '&#xf0c1;', 'styles' => array( 'sow-fas' ), ),
732
+ 'linkedin' => array( 'unicode' => '&#xf08c;', 'styles' => array( 'sow-fab' ), ),
733
+ 'linkedin-in' => array( 'unicode' => '&#xf0e1;', 'styles' => array( 'sow-fab' ), ),
734
+ 'linode' => array( 'unicode' => '&#xf2b8;', 'styles' => array( 'sow-fab' ), ),
735
+ 'linux' => array( 'unicode' => '&#xf17c;', 'styles' => array( 'sow-fab' ), ),
736
+ 'lira-sign' => array( 'unicode' => '&#xf195;', 'styles' => array( 'sow-fas' ), ),
737
+ 'list' => array( 'unicode' => '&#xf03a;', 'styles' => array( 'sow-fas' ), ),
738
+ 'list-alt' => array( 'unicode' => '&#xf022;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
739
+ 'list-ol' => array( 'unicode' => '&#xf0cb;', 'styles' => array( 'sow-fas' ), ),
740
+ 'list-ul' => array( 'unicode' => '&#xf0ca;', 'styles' => array( 'sow-fas' ), ),
741
+ 'location-arrow' => array( 'unicode' => '&#xf124;', 'styles' => array( 'sow-fas' ), ),
742
+ 'lock' => array( 'unicode' => '&#xf023;', 'styles' => array( 'sow-fas' ), ),
743
+ 'lock-open' => array( 'unicode' => '&#xf3c1;', 'styles' => array( 'sow-fas' ), ),
744
+ 'long-arrow-alt-down' => array( 'unicode' => '&#xf309;', 'styles' => array( 'sow-fas' ), ),
745
+ 'long-arrow-alt-left' => array( 'unicode' => '&#xf30a;', 'styles' => array( 'sow-fas' ), ),
746
+ 'long-arrow-alt-right' => array( 'unicode' => '&#xf30b;', 'styles' => array( 'sow-fas' ), ),
747
+ 'long-arrow-alt-up' => array( 'unicode' => '&#xf30c;', 'styles' => array( 'sow-fas' ), ),
748
+ 'low-vision' => array( 'unicode' => '&#xf2a8;', 'styles' => array( 'sow-fas' ), ),
749
+ 'luggage-cart' => array( 'unicode' => '&#xf59d;', 'styles' => array( 'sow-fas' ), ),
750
+ 'lyft' => array( 'unicode' => '&#xf3c3;', 'styles' => array( 'sow-fab' ), ),
751
+ 'magento' => array( 'unicode' => '&#xf3c4;', 'styles' => array( 'sow-fab' ), ),
752
+ 'magic' => array( 'unicode' => '&#xf0d0;', 'styles' => array( 'sow-fas' ), ),
753
+ 'magnet' => array( 'unicode' => '&#xf076;', 'styles' => array( 'sow-fas' ), ),
754
+ 'mail-bulk' => array( 'unicode' => '&#xf674;', 'styles' => array( 'sow-fas' ), ),
755
+ 'mailchimp' => array( 'unicode' => '&#xf59e;', 'styles' => array( 'sow-fab' ), ),
756
+ 'male' => array( 'unicode' => '&#xf183;', 'styles' => array( 'sow-fas' ), ),
757
+ 'mandalorian' => array( 'unicode' => '&#xf50f;', 'styles' => array( 'sow-fab' ), ),
758
+ 'map' => array( 'unicode' => '&#xf279;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
759
+ 'map-marked' => array( 'unicode' => '&#xf59f;', 'styles' => array( 'sow-fas' ), ),
760
+ 'map-marked-alt' => array( 'unicode' => '&#xf5a0;', 'styles' => array( 'sow-fas' ), ),
761
+ 'map-marker' => array( 'unicode' => '&#xf041;', 'styles' => array( 'sow-fas' ), ),
762
+ 'map-marker-alt' => array( 'unicode' => '&#xf3c5;', 'styles' => array( 'sow-fas' ), ),
763
+ 'map-pin' => array( 'unicode' => '&#xf276;', 'styles' => array( 'sow-fas' ), ),
764
+ 'map-signs' => array( 'unicode' => '&#xf277;', 'styles' => array( 'sow-fas' ), ),
765
+ 'markdown' => array( 'unicode' => '&#xf60f;', 'styles' => array( 'sow-fab' ), ),
766
+ 'marker' => array( 'unicode' => '&#xf5a1;', 'styles' => array( 'sow-fas' ), ),
767
+ 'mars' => array( 'unicode' => '&#xf222;', 'styles' => array( 'sow-fas' ), ),
768
+ 'mars-double' => array( 'unicode' => '&#xf227;', 'styles' => array( 'sow-fas' ), ),
769
+ 'mars-stroke' => array( 'unicode' => '&#xf229;', 'styles' => array( 'sow-fas' ), ),
770
+ 'mars-stroke-h' => array( 'unicode' => '&#xf22b;', 'styles' => array( 'sow-fas' ), ),
771
+ 'mars-stroke-v' => array( 'unicode' => '&#xf22a;', 'styles' => array( 'sow-fas' ), ),
772
+ 'mask' => array( 'unicode' => '&#xf6fa;', 'styles' => array( 'sow-fas' ), ),
773
+ 'mastodon' => array( 'unicode' => '&#xf4f6;', 'styles' => array( 'sow-fab' ), ),
774
+ 'maxcdn' => array( 'unicode' => '&#xf136;', 'styles' => array( 'sow-fab' ), ),
775
+ 'medal' => array( 'unicode' => '&#xf5a2;', 'styles' => array( 'sow-fas' ), ),
776
+ 'medapps' => array( 'unicode' => '&#xf3c6;', 'styles' => array( 'sow-fab' ), ),
777
+ 'medium' => array( 'unicode' => '&#xf23a;', 'styles' => array( 'sow-fab' ), ),
778
+ 'medium-m' => array( 'unicode' => '&#xf3c7;', 'styles' => array( 'sow-fab' ), ),
779
+ 'medkit' => array( 'unicode' => '&#xf0fa;', 'styles' => array( 'sow-fas' ), ),
780
+ 'medrt' => array( 'unicode' => '&#xf3c8;', 'styles' => array( 'sow-fab' ), ),
781
+ 'meetup' => array( 'unicode' => '&#xf2e0;', 'styles' => array( 'sow-fab' ), ),
782
+ 'megaport' => array( 'unicode' => '&#xf5a3;', 'styles' => array( 'sow-fab' ), ),
783
+ 'meh' => array( 'unicode' => '&#xf11a;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
784
+ 'meh-blank' => array( 'unicode' => '&#xf5a4;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
785
+ 'meh-rolling-eyes' => array( 'unicode' => '&#xf5a5;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
786
+ 'memory' => array( 'unicode' => '&#xf538;', 'styles' => array( 'sow-fas' ), ),
787
+ 'mendeley' => array( 'unicode' => '&#xf7b3;', 'styles' => array( 'sow-fab' ), ),
788
+ 'menorah' => array( 'unicode' => '&#xf676;', 'styles' => array( 'sow-fas' ), ),
789
+ 'mercury' => array( 'unicode' => '&#xf223;', 'styles' => array( 'sow-fas' ), ),
790
+ 'meteor' => array( 'unicode' => '&#xf753;', 'styles' => array( 'sow-fas' ), ),
791
+ 'microchip' => array( 'unicode' => '&#xf2db;', 'styles' => array( 'sow-fas' ), ),
792
+ 'microphone' => array( 'unicode' => '&#xf130;', 'styles' => array( 'sow-fas' ), ),
793
+ 'microphone-alt' => array( 'unicode' => '&#xf3c9;', 'styles' => array( 'sow-fas' ), ),
794
+ 'microphone-alt-slash' => array( 'unicode' => '&#xf539;', 'styles' => array( 'sow-fas' ), ),
795
+ 'microphone-slash' => array( 'unicode' => '&#xf131;', 'styles' => array( 'sow-fas' ), ),
796
+ 'microscope' => array( 'unicode' => '&#xf610;', 'styles' => array( 'sow-fas' ), ),
797
+ 'microsoft' => array( 'unicode' => '&#xf3ca;', 'styles' => array( 'sow-fab' ), ),
798
+ 'minus' => array( 'unicode' => '&#xf068;', 'styles' => array( 'sow-fas' ), ),
799
+ 'minus-circle' => array( 'unicode' => '&#xf056;', 'styles' => array( 'sow-fas' ), ),
800
+ 'minus-square' => array( 'unicode' => '&#xf146;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
801
+ 'mitten' => array( 'unicode' => '&#xf7b5;', 'styles' => array( 'sow-fas' ), ),
802
+ 'mix' => array( 'unicode' => '&#xf3cb;', 'styles' => array( 'sow-fab' ), ),
803
+ 'mixcloud' => array( 'unicode' => '&#xf289;', 'styles' => array( 'sow-fab' ), ),
804
+ 'mizuni' => array( 'unicode' => '&#xf3cc;', 'styles' => array( 'sow-fab' ), ),
805
+ 'mobile' => array( 'unicode' => '&#xf10b;', 'styles' => array( 'sow-fas' ), ),
806
+ 'mobile-alt' => array( 'unicode' => '&#xf3cd;', 'styles' => array( 'sow-fas' ), ),
807
+ 'modx' => array( 'unicode' => '&#xf285;', 'styles' => array( 'sow-fab' ), ),
808
+ 'monero' => array( 'unicode' => '&#xf3d0;', 'styles' => array( 'sow-fab' ), ),
809
+ 'money-bill' => array( 'unicode' => '&#xf0d6;', 'styles' => array( 'sow-fas' ), ),
810
+ 'money-bill-alt' => array( 'unicode' => '&#xf3d1;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
811
+ 'money-bill-wave' => array( 'unicode' => '&#xf53a;', 'styles' => array( 'sow-fas' ), ),
812
+ 'money-bill-wave-alt' => array( 'unicode' => '&#xf53b;', 'styles' => array( 'sow-fas' ), ),
813
+ 'money-check' => array( 'unicode' => '&#xf53c;', 'styles' => array( 'sow-fas' ), ),
814
+ 'money-check-alt' => array( 'unicode' => '&#xf53d;', 'styles' => array( 'sow-fas' ), ),
815
+ 'monument' => array( 'unicode' => '&#xf5a6;', 'styles' => array( 'sow-fas' ), ),
816
+ 'moon' => array( 'unicode' => '&#xf186;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
817
+ 'mortar-pestle' => array( 'unicode' => '&#xf5a7;', 'styles' => array( 'sow-fas' ), ),
818
+ 'mosque' => array( 'unicode' => '&#xf678;', 'styles' => array( 'sow-fas' ), ),
819
+ 'motorcycle' => array( 'unicode' => '&#xf21c;', 'styles' => array( 'sow-fas' ), ),
820
+ 'mountain' => array( 'unicode' => '&#xf6fc;', 'styles' => array( 'sow-fas' ), ),
821
+ 'mouse-pointer' => array( 'unicode' => '&#xf245;', 'styles' => array( 'sow-fas' ), ),
822
+ 'mug-hot' => array( 'unicode' => '&#xf7b6;', 'styles' => array( 'sow-fas' ), ),
823
+ 'music' => array( 'unicode' => '&#xf001;', 'styles' => array( 'sow-fas' ), ),
824
+ 'napster' => array( 'unicode' => '&#xf3d2;', 'styles' => array( 'sow-fab' ), ),
825
+ 'neos' => array( 'unicode' => '&#xf612;', 'styles' => array( 'sow-fab' ), ),
826
+ 'network-wired' => array( 'unicode' => '&#xf6ff;', 'styles' => array( 'sow-fas' ), ),
827
+ 'neuter' => array( 'unicode' => '&#xf22c;', 'styles' => array( 'sow-fas' ), ),
828
+ 'newspaper' => array( 'unicode' => '&#xf1ea;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
829
+ 'nimblr' => array( 'unicode' => '&#xf5a8;', 'styles' => array( 'sow-fab' ), ),
830
+ 'nintendo-switch' => array( 'unicode' => '&#xf418;', 'styles' => array( 'sow-fab' ), ),
831
+ 'node' => array( 'unicode' => '&#xf419;', 'styles' => array( 'sow-fab' ), ),
832
+ 'node-js' => array( 'unicode' => '&#xf3d3;', 'styles' => array( 'sow-fab' ), ),
833
+ 'not-equal' => array( 'unicode' => '&#xf53e;', 'styles' => array( 'sow-fas' ), ),
834
+ 'notes-medical' => array( 'unicode' => '&#xf481;', 'styles' => array( 'sow-fas' ), ),
835
+ 'npm' => array( 'unicode' => '&#xf3d4;', 'styles' => array( 'sow-fab' ), ),
836
+ 'ns8' => array( 'unicode' => '&#xf3d5;', 'styles' => array( 'sow-fab' ), ),
837
+ 'nutritionix' => array( 'unicode' => '&#xf3d6;', 'styles' => array( 'sow-fab' ), ),
838
+ 'object-group' => array( 'unicode' => '&#xf247;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
839
+ 'object-ungroup' => array( 'unicode' => '&#xf248;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
840
+ 'odnoklassniki' => array( 'unicode' => '&#xf263;', 'styles' => array( 'sow-fab' ), ),
841
+ 'odnoklassniki-square' => array( 'unicode' => '&#xf264;', 'styles' => array( 'sow-fab' ), ),
842
+ 'oil-can' => array( 'unicode' => '&#xf613;', 'styles' => array( 'sow-fas' ), ),
843
+ 'old-republic' => array( 'unicode' => '&#xf510;', 'styles' => array( 'sow-fab' ), ),
844
+ 'om' => array( 'unicode' => '&#xf679;', 'styles' => array( 'sow-fas' ), ),
845
+ 'opencart' => array( 'unicode' => '&#xf23d;', 'styles' => array( 'sow-fab' ), ),
846
+ 'openid' => array( 'unicode' => '&#xf19b;', 'styles' => array( 'sow-fab' ), ),
847
+ 'opera' => array( 'unicode' => '&#xf26a;', 'styles' => array( 'sow-fab' ), ),
848
+ 'optin-monster' => array( 'unicode' => '&#xf23c;', 'styles' => array( 'sow-fab' ), ),
849
+ 'osi' => array( 'unicode' => '&#xf41a;', 'styles' => array( 'sow-fab' ), ),
850
+ 'otter' => array( 'unicode' => '&#xf700;', 'styles' => array( 'sow-fas' ), ),
851
+ 'outdent' => array( 'unicode' => '&#xf03b;', 'styles' => array( 'sow-fas' ), ),
852
+ 'page4' => array( 'unicode' => '&#xf3d7;', 'styles' => array( 'sow-fab' ), ),
853
+ 'pagelines' => array( 'unicode' => '&#xf18c;', 'styles' => array( 'sow-fab' ), ),
854
+ 'pager' => array( 'unicode' => '&#xf815;', 'styles' => array( 'sow-fas' ), ),
855
+ 'paint-brush' => array( 'unicode' => '&#xf1fc;', 'styles' => array( 'sow-fas' ), ),
856
+ 'paint-roller' => array( 'unicode' => '&#xf5aa;', 'styles' => array( 'sow-fas' ), ),
857
+ 'palette' => array( 'unicode' => '&#xf53f;', 'styles' => array( 'sow-fas' ), ),
858
+ 'palfed' => array( 'unicode' => '&#xf3d8;', 'styles' => array( 'sow-fab' ), ),
859
+ 'pallet' => array( 'unicode' => '&#xf482;', 'styles' => array( 'sow-fas' ), ),
860
+ 'paper-plane' => array( 'unicode' => '&#xf1d8;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
861
+ 'paperclip' => array( 'unicode' => '&#xf0c6;', 'styles' => array( 'sow-fas' ), ),
862
+ 'parachute-box' => array( 'unicode' => '&#xf4cd;', 'styles' => array( 'sow-fas' ), ),
863
+ 'paragraph' => array( 'unicode' => '&#xf1dd;', 'styles' => array( 'sow-fas' ), ),
864
+ 'parking' => array( 'unicode' => '&#xf540;', 'styles' => array( 'sow-fas' ), ),
865
+ 'passport' => array( 'unicode' => '&#xf5ab;', 'styles' => array( 'sow-fas' ), ),
866
+ 'pastafarianism' => array( 'unicode' => '&#xf67b;', 'styles' => array( 'sow-fas' ), ),
867
+ 'paste' => array( 'unicode' => '&#xf0ea;', 'styles' => array( 'sow-fas' ), ),
868
+ 'patreon' => array( 'unicode' => '&#xf3d9;', 'styles' => array( 'sow-fab' ), ),
869
+ 'pause' => array( 'unicode' => '&#xf04c;', 'styles' => array( 'sow-fas' ), ),
870
+ 'pause-circle' => array( 'unicode' => '&#xf28b;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
871
+ 'paw' => array( 'unicode' => '&#xf1b0;', 'styles' => array( 'sow-fas' ), ),
872
+ 'paypal' => array( 'unicode' => '&#xf1ed;', 'styles' => array( 'sow-fab' ), ),
873
+ 'peace' => array( 'unicode' => '&#xf67c;', 'styles' => array( 'sow-fas' ), ),
874
+ 'pen' => array( 'unicode' => '&#xf304;', 'styles' => array( 'sow-fas' ), ),
875
+ 'pen-alt' => array( 'unicode' => '&#xf305;', 'styles' => array( 'sow-fas' ), ),
876
+ 'pen-fancy' => array( 'unicode' => '&#xf5ac;', 'styles' => array( 'sow-fas' ), ),
877
+ 'pen-nib' => array( 'unicode' => '&#xf5ad;', 'styles' => array( 'sow-fas' ), ),
878
+ 'pen-square' => array( 'unicode' => '&#xf14b;', 'styles' => array( 'sow-fas' ), ),
879
+ 'pencil-alt' => array( 'unicode' => '&#xf303;', 'styles' => array( 'sow-fas' ), ),
880
+ 'pencil-ruler' => array( 'unicode' => '&#xf5ae;', 'styles' => array( 'sow-fas' ), ),
881
+ 'penny-arcade' => array( 'unicode' => '&#xf704;', 'styles' => array( 'sow-fab' ), ),
882
+ 'people-carry' => array( 'unicode' => '&#xf4ce;', 'styles' => array( 'sow-fas' ), ),
883
+ 'pepper-hot' => array( 'unicode' => '&#xf816;', 'styles' => array( 'sow-fas' ), ),
884
+ 'percent' => array( 'unicode' => '&#xf295;', 'styles' => array( 'sow-fas' ), ),
885
+ 'percentage' => array( 'unicode' => '&#xf541;', 'styles' => array( 'sow-fas' ), ),
886
+ 'periscope' => array( 'unicode' => '&#xf3da;', 'styles' => array( 'sow-fab' ), ),
887
+ 'person-booth' => array( 'unicode' => '&#xf756;', 'styles' => array( 'sow-fas' ), ),
888
+ 'phabricator' => array( 'unicode' => '&#xf3db;', 'styles' => array( 'sow-fab' ), ),
889
+ 'phoenix-framework' => array( 'unicode' => '&#xf3dc;', 'styles' => array( 'sow-fab' ), ),
890
+ 'phoenix-squadron' => array( 'unicode' => '&#xf511;', 'styles' => array( 'sow-fab' ), ),
891
+ 'phone' => array( 'unicode' => '&#xf095;', 'styles' => array( 'sow-fas' ), ),
892
+ 'phone-slash' => array( 'unicode' => '&#xf3dd;', 'styles' => array( 'sow-fas' ), ),
893
+ 'phone-square' => array( 'unicode' => '&#xf098;', 'styles' => array( 'sow-fas' ), ),
894
+ 'phone-volume' => array( 'unicode' => '&#xf2a0;', 'styles' => array( 'sow-fas' ), ),
895
+ 'php' => array( 'unicode' => '&#xf457;', 'styles' => array( 'sow-fab' ), ),
896
+ 'pied-piper' => array( 'unicode' => '&#xf2ae;', 'styles' => array( 'sow-fab' ), ),
897
+ 'pied-piper-alt' => array( 'unicode' => '&#xf1a8;', 'styles' => array( 'sow-fab' ), ),
898
+ 'pied-piper-hat' => array( 'unicode' => '&#xf4e5;', 'styles' => array( 'sow-fab' ), ),
899
+ 'pied-piper-pp' => array( 'unicode' => '&#xf1a7;', 'styles' => array( 'sow-fab' ), ),
900
+ 'piggy-bank' => array( 'unicode' => '&#xf4d3;', 'styles' => array( 'sow-fas' ), ),
901
+ 'pills' => array( 'unicode' => '&#xf484;', 'styles' => array( 'sow-fas' ), ),
902
+ 'pinterest' => array( 'unicode' => '&#xf0d2;', 'styles' => array( 'sow-fab' ), ),
903
+ 'pinterest-p' => array( 'unicode' => '&#xf231;', 'styles' => array( 'sow-fab' ), ),
904
+ 'pinterest-square' => array( 'unicode' => '&#xf0d3;', 'styles' => array( 'sow-fab' ), ),
905
+ 'pizza-slice' => array( 'unicode' => '&#xf818;', 'styles' => array( 'sow-fas' ), ),
906
+ 'place-of-worship' => array( 'unicode' => '&#xf67f;', 'styles' => array( 'sow-fas' ), ),
907
+ 'plane' => array( 'unicode' => '&#xf072;', 'styles' => array( 'sow-fas' ), ),
908
+ 'plane-arrival' => array( 'unicode' => '&#xf5af;', 'styles' => array( 'sow-fas' ), ),
909
+ 'plane-departure' => array( 'unicode' => '&#xf5b0;', 'styles' => array( 'sow-fas' ), ),
910
+ 'play' => array( 'unicode' => '&#xf04b;', 'styles' => array( 'sow-fas' ), ),
911
+ 'play-circle' => array( 'unicode' => '&#xf144;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
912
+ 'playstation' => array( 'unicode' => '&#xf3df;', 'styles' => array( 'sow-fab' ), ),
913
+ 'plug' => array( 'unicode' => '&#xf1e6;', 'styles' => array( 'sow-fas' ), ),
914
+ 'plus' => array( 'unicode' => '&#xf067;', 'styles' => array( 'sow-fas' ), ),
915
+ 'plus-circle' => array( 'unicode' => '&#xf055;', 'styles' => array( 'sow-fas' ), ),
916
+ 'plus-square' => array( 'unicode' => '&#xf0fe;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
917
+ 'podcast' => array( 'unicode' => '&#xf2ce;', 'styles' => array( 'sow-fas' ), ),
918
+ 'poll' => array( 'unicode' => '&#xf681;', 'styles' => array( 'sow-fas' ), ),
919
+ 'poll-h' => array( 'unicode' => '&#xf682;', 'styles' => array( 'sow-fas' ), ),
920
+ 'poo' => array( 'unicode' => '&#xf2fe;', 'styles' => array( 'sow-fas' ), ),
921
+ 'poo-storm' => array( 'unicode' => '&#xf75a;', 'styles' => array( 'sow-fas' ), ),
922
+ 'poop' => array( 'unicode' => '&#xf619;', 'styles' => array( 'sow-fas' ), ),
923
+ 'portrait' => array( 'unicode' => '&#xf3e0;', 'styles' => array( 'sow-fas' ), ),
924
+ 'pound-sign' => array( 'unicode' => '&#xf154;', 'styles' => array( 'sow-fas' ), ),
925
+ 'power-off' => array( 'unicode' => '&#xf011;', 'styles' => array( 'sow-fas' ), ),
926
+ 'pray' => array( 'unicode' => '&#xf683;', 'styles' => array( 'sow-fas' ), ),
927
+ 'praying-hands' => array( 'unicode' => '&#xf684;', 'styles' => array( 'sow-fas' ), ),
928
+ 'prescription' => array( 'unicode' => '&#xf5b1;', 'styles' => array( 'sow-fas' ), ),
929
+ 'prescription-bottle' => array( 'unicode' => '&#xf485;', 'styles' => array( 'sow-fas' ), ),
930
+ 'prescription-bottle-alt' => array( 'unicode' => '&#xf486;', 'styles' => array( 'sow-fas' ), ),
931
+ 'print' => array( 'unicode' => '&#xf02f;', 'styles' => array( 'sow-fas' ), ),
932
+ 'procedures' => array( 'unicode' => '&#xf487;', 'styles' => array( 'sow-fas' ), ),
933
+ 'product-hunt' => array( 'unicode' => '&#xf288;', 'styles' => array( 'sow-fab' ), ),
934
+ 'project-diagram' => array( 'unicode' => '&#xf542;', 'styles' => array( 'sow-fas' ), ),
935
+ 'pushed' => array( 'unicode' => '&#xf3e1;', 'styles' => array( 'sow-fab' ), ),
936
+ 'puzzle-piece' => array( 'unicode' => '&#xf12e;', 'styles' => array( 'sow-fas' ), ),
937
+ 'python' => array( 'unicode' => '&#xf3e2;', 'styles' => array( 'sow-fab' ), ),
938
+ 'qq' => array( 'unicode' => '&#xf1d6;', 'styles' => array( 'sow-fab' ), ),
939
+ 'qrcode' => array( 'unicode' => '&#xf029;', 'styles' => array( 'sow-fas' ), ),
940
+ 'question' => array( 'unicode' => '&#xf128;', 'styles' => array( 'sow-fas' ), ),
941
+ 'question-circle' => array( 'unicode' => '&#xf059;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
942
+ 'quidditch' => array( 'unicode' => '&#xf458;', 'styles' => array( 'sow-fas' ), ),
943
+ 'quinscape' => array( 'unicode' => '&#xf459;', 'styles' => array( 'sow-fab' ), ),
944
+ 'quora' => array( 'unicode' => '&#xf2c4;', 'styles' => array( 'sow-fab' ), ),
945
+ 'quote-left' => array( 'unicode' => '&#xf10d;', 'styles' => array( 'sow-fas' ), ),
946
+ 'quote-right' => array( 'unicode' => '&#xf10e;', 'styles' => array( 'sow-fas' ), ),
947
+ 'quran' => array( 'unicode' => '&#xf687;', 'styles' => array( 'sow-fas' ), ),
948
+ 'r-project' => array( 'unicode' => '&#xf4f7;', 'styles' => array( 'sow-fab' ), ),
949
+ 'radiation' => array( 'unicode' => '&#xf7b9;', 'styles' => array( 'sow-fas' ), ),
950
+ 'radiation-alt' => array( 'unicode' => '&#xf7ba;', 'styles' => array( 'sow-fas' ), ),
951
+ 'rainbow' => array( 'unicode' => '&#xf75b;', 'styles' => array( 'sow-fas' ), ),
952
+ 'random' => array( 'unicode' => '&#xf074;', 'styles' => array( 'sow-fas' ), ),
953
+ 'raspberry-pi' => array( 'unicode' => '&#xf7bb;', 'styles' => array( 'sow-fab' ), ),
954
+ 'ravelry' => array( 'unicode' => '&#xf2d9;', 'styles' => array( 'sow-fab' ), ),
955
+ 'react' => array( 'unicode' => '&#xf41b;', 'styles' => array( 'sow-fab' ), ),
956
+ 'reacteurope' => array( 'unicode' => '&#xf75d;', 'styles' => array( 'sow-fab' ), ),
957
+ 'readme' => array( 'unicode' => '&#xf4d5;', 'styles' => array( 'sow-fab' ), ),
958
+ 'rebel' => array( 'unicode' => '&#xf1d0;', 'styles' => array( 'sow-fab' ), ),
959
+ 'receipt' => array( 'unicode' => '&#xf543;', 'styles' => array( 'sow-fas' ), ),
960
+ 'recycle' => array( 'unicode' => '&#xf1b8;', 'styles' => array( 'sow-fas' ), ),
961
+ 'red-river' => array( 'unicode' => '&#xf3e3;', 'styles' => array( 'sow-fab' ), ),
962
+ 'reddit' => array( 'unicode' => '&#xf1a1;', 'styles' => array( 'sow-fab' ), ),
963
+ 'reddit-alien' => array( 'unicode' => '&#xf281;', 'styles' => array( 'sow-fab' ), ),
964
+ 'reddit-square' => array( 'unicode' => '&#xf1a2;', 'styles' => array( 'sow-fab' ), ),
965
+ 'redhat' => array( 'unicode' => '&#xf7bc;', 'styles' => array( 'sow-fab' ), ),
966
+ 'redo' => array( 'unicode' => '&#xf01e;', 'styles' => array( 'sow-fas' ), ),
967
+ 'redo-alt' => array( 'unicode' => '&#xf2f9;', 'styles' => array( 'sow-fas' ), ),
968
+ 'registered' => array( 'unicode' => '&#xf25d;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
969
+ 'renren' => array( 'unicode' => '&#xf18b;', 'styles' => array( 'sow-fab' ), ),
970
+ 'reply' => array( 'unicode' => '&#xf3e5;', 'styles' => array( 'sow-fas' ), ),
971
+ 'reply-all' => array( 'unicode' => '&#xf122;', 'styles' => array( 'sow-fas' ), ),
972
+ 'replyd' => array( 'unicode' => '&#xf3e6;', 'styles' => array( 'sow-fab' ), ),
973
+ 'republican' => array( 'unicode' => '&#xf75e;', 'styles' => array( 'sow-fas' ), ),
974
+ 'researchgate' => array( 'unicode' => '&#xf4f8;', 'styles' => array( 'sow-fab' ), ),
975
+ 'resolving' => array( 'unicode' => '&#xf3e7;', 'styles' => array( 'sow-fab' ), ),
976
+ 'restroom' => array( 'unicode' => '&#xf7bd;', 'styles' => array( 'sow-fas' ), ),
977
+ 'retweet' => array( 'unicode' => '&#xf079;', 'styles' => array( 'sow-fas' ), ),
978
+ 'rev' => array( 'unicode' => '&#xf5b2;', 'styles' => array( 'sow-fab' ), ),
979
+ 'ribbon' => array( 'unicode' => '&#xf4d6;', 'styles' => array( 'sow-fas' ), ),
980
+ 'ring' => array( 'unicode' => '&#xf70b;', 'styles' => array( 'sow-fas' ), ),
981
+ 'road' => array( 'unicode' => '&#xf018;', 'styles' => array( 'sow-fas' ), ),
982
+ 'robot' => array( 'unicode' => '&#xf544;', 'styles' => array( 'sow-fas' ), ),
983
+ 'rocket' => array( 'unicode' => '&#xf135;', 'styles' => array( 'sow-fas' ), ),
984
+ 'rocketchat' => array( 'unicode' => '&#xf3e8;', 'styles' => array( 'sow-fab' ), ),
985
+ 'rockrms' => array( 'unicode' => '&#xf3e9;', 'styles' => array( 'sow-fab' ), ),
986
+ 'route' => array( 'unicode' => '&#xf4d7;', 'styles' => array( 'sow-fas' ), ),
987
+ 'rss' => array( 'unicode' => '&#xf09e;', 'styles' => array( 'sow-fas' ), ),
988
+ 'rss-square' => array( 'unicode' => '&#xf143;', 'styles' => array( 'sow-fas' ), ),
989
+ 'ruble-sign' => array( 'unicode' => '&#xf158;', 'styles' => array( 'sow-fas' ), ),
990
+ 'ruler' => array( 'unicode' => '&#xf545;', 'styles' => array( 'sow-fas' ), ),
991
+ 'ruler-combined' => array( 'unicode' => '&#xf546;', 'styles' => array( 'sow-fas' ), ),
992
+ 'ruler-horizontal' => array( 'unicode' => '&#xf547;', 'styles' => array( 'sow-fas' ), ),
993
+ 'ruler-vertical' => array( 'unicode' => '&#xf548;', 'styles' => array( 'sow-fas' ), ),
994
+ 'running' => array( 'unicode' => '&#xf70c;', 'styles' => array( 'sow-fas' ), ),
995
+ 'rupee-sign' => array( 'unicode' => '&#xf156;', 'styles' => array( 'sow-fas' ), ),
996
+ 'sad-cry' => array( 'unicode' => '&#xf5b3;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
997
+ 'sad-tear' => array( 'unicode' => '&#xf5b4;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
998
+ 'safari' => array( 'unicode' => '&#xf267;', 'styles' => array( 'sow-fab' ), ),
999
+ 'salesforce' => array( 'unicode' => '&#xf83b;', 'styles' => array( 'sow-fab' ), ),
1000
+ 'sass' => array( 'unicode' => '&#xf41e;', 'styles' => array( 'sow-fab' ), ),
1001
+ 'satellite' => array( 'unicode' => '&#xf7bf;', 'styles' => array( 'sow-fas' ), ),
1002
+ 'satellite-dish' => array( 'unicode' => '&#xf7c0;', 'styles' => array( 'sow-fas' ), ),
1003
+ 'save' => array( 'unicode' => '&#xf0c7;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
1004
+ 'schlix' => array( 'unicode' => '&#xf3ea;', 'styles' => array( 'sow-fab' ), ),
1005
+ 'school' => array( 'unicode' => '&#xf549;', 'styles' => array( 'sow-fas' ), ),
1006
+ 'screwdriver' => array( 'unicode' => '&#xf54a;', 'styles' => array( 'sow-fas' ), ),
1007
+ 'scribd' => array( 'unicode' => '&#xf28a;', 'styles' => array( 'sow-fab' ), ),
1008
+ 'scroll' => array( 'unicode' => '&#xf70e;', 'styles' => array( 'sow-fas' ), ),
1009
+ 'sd-card' => array( 'unicode' => '&#xf7c2;', 'styles' => array( 'sow-fas' ), ),
1010
+ 'search' => array( 'unicode' => '&#xf002;', 'styles' => array( 'sow-fas' ), ),
1011
+ 'search-dollar' => array( 'unicode' => '&#xf688;', 'styles' => array( 'sow-fas' ), ),
1012
+ 'search-location' => array( 'unicode' => '&#xf689;', 'styles' => array( 'sow-fas' ), ),
1013
+ 'search-minus' => array( 'unicode' => '&#xf010;', 'styles' => array( 'sow-fas' ), ),
1014
+ 'search-plus' => array( 'unicode' => '&#xf00e;', 'styles' => array( 'sow-fas' ), ),
1015
+ 'searchengin' => array( 'unicode' => '&#xf3eb;', 'styles' => array( 'sow-fab' ), ),
1016
+ 'seedling' => array( 'unicode' => '&#xf4d8;', 'styles' => array( 'sow-fas' ), ),
1017
+ 'sellcast' => array( 'unicode' => '&#xf2da;', 'styles' => array( 'sow-fab' ), ),
1018
+ 'sellsy' => array( 'unicode' => '&#xf213;', 'styles' => array( 'sow-fab' ), ),
1019
+ 'server' => array( 'unicode' => '&#xf233;', 'styles' => array( 'sow-fas' ), ),
1020
+ 'servicestack' => array( 'unicode' => '&#xf3ec;', 'styles' => array( 'sow-fab' ), ),
1021
+ 'shapes' => array( 'unicode' => '&#xf61f;', 'styles' => array( 'sow-fas' ), ),
1022
+ 'share' => array( 'unicode' => '&#xf064;', 'styles' => array( 'sow-fas' ), ),
1023
+ 'share-alt' => array( 'unicode' => '&#xf1e0;', 'styles' => array( 'sow-fas' ), ),
1024
+ 'share-alt-square' => array( 'unicode' => '&#xf1e1;', 'styles' => array( 'sow-fas' ), ),
1025
+ 'share-square' => array( 'unicode' => '&#xf14d;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
1026
+ 'shekel-sign' => array( 'unicode' => '&#xf20b;', 'styles' => array( 'sow-fas' ), ),
1027
+ 'shield-alt' => array( 'unicode' => '&#xf3ed;', 'styles' => array( 'sow-fas' ), ),
1028
+ 'ship' => array( 'unicode' => '&#xf21a;', 'styles' => array( 'sow-fas' ), ),
1029
+ 'shipping-fast' => array( 'unicode' => '&#xf48b;', 'styles' => array( 'sow-fas' ), ),
1030
+ 'shirtsinbulk' => array( 'unicode' => '&#xf214;', 'styles' => array( 'sow-fab' ), ),
1031
+ 'shoe-prints' => array( 'unicode' => '&#xf54b;', 'styles' => array( 'sow-fas' ), ),
1032
+ 'shopping-bag' => array( 'unicode' => '&#xf290;', 'styles' => array( 'sow-fas' ), ),
1033
+ 'shopping-basket' => array( 'unicode' => '&#xf291;', 'styles' => array( 'sow-fas' ), ),
1034
+ 'shopping-cart' => array( 'unicode' => '&#xf07a;', 'styles' => array( 'sow-fas' ), ),
1035
+ 'shopware' => array( 'unicode' => '&#xf5b5;', 'styles' => array( 'sow-fab' ), ),
1036
+ 'shower' => array( 'unicode' => '&#xf2cc;', 'styles' => array( 'sow-fas' ), ),
1037
+ 'shuttle-van' => array( 'unicode' => '&#xf5b6;', 'styles' => array( 'sow-fas' ), ),
1038
+ 'sign' => array( 'unicode' => '&#xf4d9;', 'styles' => array( 'sow-fas' ), ),
1039
+ 'sign-in-alt' => array( 'unicode' => '&#xf2f6;', 'styles' => array( 'sow-fas' ), ),
1040
+ 'sign-language' => array( 'unicode' => '&#xf2a7;', 'styles' => array( 'sow-fas' ), ),
1041
+ 'sign-out-alt' => array( 'unicode' => '&#xf2f5;', 'styles' => array( 'sow-fas' ), ),
1042
+ 'signal' => array( 'unicode' => '&#xf012;', 'styles' => array( 'sow-fas' ), ),
1043
+ 'signature' => array( 'unicode' => '&#xf5b7;', 'styles' => array( 'sow-fas' ), ),
1044
+ 'sim-card' => array( 'unicode' => '&#xf7c4;', 'styles' => array( 'sow-fas' ), ),
1045
+ 'simplybuilt' => array( 'unicode' => '&#xf215;', 'styles' => array( 'sow-fab' ), ),
1046
+ 'sistrix' => array( 'unicode' => '&#xf3ee;', 'styles' => array( 'sow-fab' ), ),
1047
+ 'sitemap' => array( 'unicode' => '&#xf0e8;', 'styles' => array( 'sow-fas' ), ),
1048
+ 'sith' => array( 'unicode' => '&#xf512;', 'styles' => array( 'sow-fab' ), ),
1049
+ 'skating' => array( 'unicode' => '&#xf7c5;', 'styles' => array( 'sow-fas' ), ),
1050
+ 'sketch' => array( 'unicode' => '&#xf7c6;', 'styles' => array( 'sow-fab' ), ),
1051
+ 'skiing' => array( 'unicode' => '&#xf7c9;', 'styles' => array( 'sow-fas' ), ),
1052
+ 'skiing-nordic' => array( 'unicode' => '&#xf7ca;', 'styles' => array( 'sow-fas' ), ),
1053
+ 'skull' => array( 'unicode' => '&#xf54c;', 'styles' => array( 'sow-fas' ), ),
1054
+ 'skull-crossbones' => array( 'unicode' => '&#xf714;', 'styles' => array( 'sow-fas' ), ),
1055
+ 'skyatlas' => array( 'unicode' => '&#xf216;', 'styles' => array( 'sow-fab' ), ),
1056
+ 'skype' => array( 'unicode' => '&#xf17e;', 'styles' => array( 'sow-fab' ), ),
1057
+ 'slack' => array( 'unicode' => '&#xf198;', 'styles' => array( 'sow-fab' ), ),
1058
+ 'slack-hash' => array( 'unicode' => '&#xf3ef;', 'styles' => array( 'sow-fab' ), ),
1059
+ 'slash' => array( 'unicode' => '&#xf715;', 'styles' => array( 'sow-fas' ), ),
1060
+ 'sleigh' => array( 'unicode' => '&#xf7cc;', 'styles' => array( 'sow-fas' ), ),
1061
+ 'sliders-h' => array( 'unicode' => '&#xf1de;', 'styles' => array( 'sow-fas' ), ),
1062
+ 'slideshare' => array( 'unicode' => '&#xf1e7;', 'styles' => array( 'sow-fab' ), ),
1063
+ 'smile' => array( 'unicode' => '&#xf118;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
1064
+ 'smile-beam' => array( 'unicode' => '&#xf5b8;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
1065
+ 'smile-wink' => array( 'unicode' => '&#xf4da;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
1066
+ 'smog' => array( 'unicode' => '&#xf75f;', 'styles' => array( 'sow-fas' ), ),
1067
+ 'smoking' => array( 'unicode' => '&#xf48d;', 'styles' => array( 'sow-fas' ), ),
1068
+ 'smoking-ban' => array( 'unicode' => '&#xf54d;', 'styles' => array( 'sow-fas' ), ),
1069
+ 'sms' => array( 'unicode' => '&#xf7cd;', 'styles' => array( 'sow-fas' ), ),
1070
+ 'snapchat' => array( 'unicode' => '&#xf2ab;', 'styles' => array( 'sow-fab' ), ),
1071
+ 'snapchat-ghost' => array( 'unicode' => '&#xf2ac;', 'styles' => array( 'sow-fab' ), ),
1072
+ 'snapchat-square' => array( 'unicode' => '&#xf2ad;', 'styles' => array( 'sow-fab' ), ),
1073
+ 'snowboarding' => array( 'unicode' => '&#xf7ce;', 'styles' => array( 'sow-fas' ), ),
1074
+ 'snowflake' => array( 'unicode' => '&#xf2dc;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
1075
+ 'snowman' => array( 'unicode' => '&#xf7d0;', 'styles' => array( 'sow-fas' ), ),
1076
+ 'snowplow' => array( 'unicode' => '&#xf7d2;', 'styles' => array( 'sow-fas' ), ),
1077
+ 'socks' => array( 'unicode' => '&#xf696;', 'styles' => array( 'sow-fas' ), ),
1078
+ 'solar-panel' => array( 'unicode' => '&#xf5ba;', 'styles' => array( 'sow-fas' ), ),
1079
+ 'sort' => array( 'unicode' => '&#xf0dc;', 'styles' => array( 'sow-fas' ), ),
1080
+ 'sort-alpha-down' => array( 'unicode' => '&#xf15d;', 'styles' => array( 'sow-fas' ), ),
1081
+ 'sort-alpha-up' => array( 'unicode' => '&#xf15e;', 'styles' => array( 'sow-fas' ), ),
1082
+ 'sort-amount-down' => array( 'unicode' => '&#xf160;', 'styles' => array( 'sow-fas' ), ),
1083
+ 'sort-amount-up' => array( 'unicode' => '&#xf161;', 'styles' => array( 'sow-fas' ), ),
1084
+ 'sort-down' => array( 'unicode' => '&#xf0dd;', 'styles' => array( 'sow-fas' ), ),
1085
+ 'sort-numeric-down' => array( 'unicode' => '&#xf162;', 'styles' => array( 'sow-fas' ), ),
1086
+ 'sort-numeric-up' => array( 'unicode' => '&#xf163;', 'styles' => array( 'sow-fas' ), ),
1087
+ 'sort-up' => array( 'unicode' => '&#xf0de;', 'styles' => array( 'sow-fas' ), ),
1088
+ 'soundcloud' => array( 'unicode' => '&#xf1be;', 'styles' => array( 'sow-fab' ), ),
1089
+ 'sourcetree' => array( 'unicode' => '&#xf7d3;', 'styles' => array( 'sow-fab' ), ),
1090
+ 'spa' => array( 'unicode' => '&#xf5bb;', 'styles' => array( 'sow-fas' ), ),
1091
+ 'space-shuttle' => array( 'unicode' => '&#xf197;', 'styles' => array( 'sow-fas' ), ),
1092
+ 'speakap' => array( 'unicode' => '&#xf3f3;', 'styles' => array( 'sow-fab' ), ),
1093
+ 'speaker-deck' => array( 'unicode' => '&#xf83c;', 'styles' => array( 'sow-fab' ), ),
1094
+ 'spider' => array( 'unicode' => '&#xf717;', 'styles' => array( 'sow-fas' ), ),
1095
+ 'spinner' => array( 'unicode' => '&#xf110;', 'styles' => array( 'sow-fas' ), ),
1096
+ 'splotch' => array( 'unicode' => '&#xf5bc;', 'styles' => array( 'sow-fas' ), ),
1097
+ 'spotify' => array( 'unicode' => '&#xf1bc;', 'styles' => array( 'sow-fab' ), ),
1098
+ 'spray-can' => array( 'unicode' => '&#xf5bd;', 'styles' => array( 'sow-fas' ), ),
1099
+ 'square' => array( 'unicode' => '&#xf0c8;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
1100
+ 'square-full' => array( 'unicode' => '&#xf45c;', 'styles' => array( 'sow-fas' ), ),
1101
+ 'square-root-alt' => array( 'unicode' => '&#xf698;', 'styles' => array( 'sow-fas' ), ),
1102
+ 'squarespace' => array( 'unicode' => '&#xf5be;', 'styles' => array( 'sow-fab' ), ),
1103
+ 'stack-exchange' => array( 'unicode' => '&#xf18d;', 'styles' => array( 'sow-fab' ), ),
1104
+ 'stack-overflow' => array( 'unicode' => '&#xf16c;', 'styles' => array( 'sow-fab' ), ),
1105
+ 'stackpath' => array( 'unicode' => '&#xf842;', 'styles' => array( 'sow-fab' ), ),
1106
+ 'stamp' => array( 'unicode' => '&#xf5bf;', 'styles' => array( 'sow-fas' ), ),
1107
+ 'star' => array( 'unicode' => '&#xf005;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
1108
+ 'star-and-crescent' => array( 'unicode' => '&#xf699;', 'styles' => array( 'sow-fas' ), ),
1109
+ 'star-half' => array( 'unicode' => '&#xf089;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
1110
+ 'star-half-alt' => array( 'unicode' => '&#xf5c0;', 'styles' => array( 'sow-fas' ), ),
1111
+ 'star-of-david' => array( 'unicode' => '&#xf69a;', 'styles' => array( 'sow-fas' ), ),
1112
+ 'star-of-life' => array( 'unicode' => '&#xf621;', 'styles' => array( 'sow-fas' ), ),
1113
+ 'staylinked' => array( 'unicode' => '&#xf3f5;', 'styles' => array( 'sow-fab' ), ),
1114
+ 'steam' => array( 'unicode' => '&#xf1b6;', 'styles' => array( 'sow-fab' ), ),
1115
+ 'steam-square' => array( 'unicode' => '&#xf1b7;', 'styles' => array( 'sow-fab' ), ),
1116
+ 'steam-symbol' => array( 'unicode' => '&#xf3f6;', 'styles' => array( 'sow-fab' ), ),
1117
+ 'step-backward' => array( 'unicode' => '&#xf048;', 'styles' => array( 'sow-fas' ), ),
1118
+ 'step-forward' => array( 'unicode' => '&#xf051;', 'styles' => array( 'sow-fas' ), ),
1119
+ 'stethoscope' => array( 'unicode' => '&#xf0f1;', 'styles' => array( 'sow-fas' ), ),
1120
+ 'sticker-mule' => array( 'unicode' => '&#xf3f7;', 'styles' => array( 'sow-fab' ), ),
1121
+ 'sticky-note' => array( 'unicode' => '&#xf249;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
1122
+ 'stop' => array( 'unicode' => '&#xf04d;', 'styles' => array( 'sow-fas' ), ),
1123
+ 'stop-circle' => array( 'unicode' => '&#xf28d;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
1124
+ 'stopwatch' => array( 'unicode' => '&#xf2f2;', 'styles' => array( 'sow-fas' ), ),
1125
+ 'store' => array( 'unicode' => '&#xf54e;', 'styles' => array( 'sow-fas' ), ),
1126
+ 'store-alt' => array( 'unicode' => '&#xf54f;', 'styles' => array( 'sow-fas' ), ),
1127
+ 'strava' => array( 'unicode' => '&#xf428;', 'styles' => array( 'sow-fab' ), ),
1128
+ 'stream' => array( 'unicode' => '&#xf550;', 'styles' => array( 'sow-fas' ), ),
1129
+ 'street-view' => array( 'unicode' => '&#xf21d;', 'styles' => array( 'sow-fas' ), ),
1130
+ 'strikethrough' => array( 'unicode' => '&#xf0cc;', 'styles' => array( 'sow-fas' ), ),
1131
+ 'stripe' => array( 'unicode' => '&#xf429;', 'styles' => array( 'sow-fab' ), ),
1132
+ 'stripe-s' => array( 'unicode' => '&#xf42a;', 'styles' => array( 'sow-fab' ), ),
1133
+ 'stroopwafel' => array( 'unicode' => '&#xf551;', 'styles' => array( 'sow-fas' ), ),
1134
+ 'studiovinari' => array( 'unicode' => '&#xf3f8;', 'styles' => array( 'sow-fab' ), ),
1135
+ 'stumbleupon' => array( 'unicode' => '&#xf1a4;', 'styles' => array( 'sow-fab' ), ),
1136
+ 'stumbleupon-circle' => array( 'unicode' => '&#xf1a3;', 'styles' => array( 'sow-fab' ), ),
1137
+ 'subscript' => array( 'unicode' => '&#xf12c;', 'styles' => array( 'sow-fas' ), ),
1138
+ 'subway' => array( 'unicode' => '&#xf239;', 'styles' => array( 'sow-fas' ), ),
1139
+ 'suitcase' => array( 'unicode' => '&#xf0f2;', 'styles' => array( 'sow-fas' ), ),
1140
+ 'suitcase-rolling' => array( 'unicode' => '&#xf5c1;', 'styles' => array( 'sow-fas' ), ),
1141
+ 'sun' => array( 'unicode' => '&#xf185;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
1142
+ 'superpowers' => array( 'unicode' => '&#xf2dd;', 'styles' => array( 'sow-fab' ), ),
1143
+ 'superscript' => array( 'unicode' => '&#xf12b;', 'styles' => array( 'sow-fas' ), ),
1144
+ 'supple' => array( 'unicode' => '&#xf3f9;', 'styles' => array( 'sow-fab' ), ),
1145
+ 'surprise' => array( 'unicode' => '&#xf5c2;', 'styles' => array( 'sow-fas', 'sow-far' ), ),
1146
+ 'suse' => array( 'unicode' => '&#xf7d6;', 'styles' => array( 'sow-fab' ), ),
1147
+ 'swatchbook' => array( 'unicode' => '&#xf5c3;', 'styles' => array( 'sow-fas' ), ),
1148
+ 'swimmer' => array( 'unicode' => '&#xf5c4;', 'styles' => array( 'sow-fas' ), ),
1149
+ 'swimming-pool' => array( 'unicode' => '&#xf5c5;', 'styles' => array( 'sow-fas' ), ),
1150
+ 'symfony' => array( 'unicode' => '&#xf83d;', 'styles' => array( 'sow-fab' ), ),
1151
+ 'synagogue' => array( 'unicode' => '&#xf69b;', 'styles' => array( 'sow-fas' ), ),
1152
+ 'sync' => array( 'unicode' => '&#xf021;', 'styles' => array( 'sow-fas' ), ),
1153
+ 'sync-alt' => array( 'unicode' => '&#xf2f1;', 'styles' => array( 'sow-fas' ), ),
1154
+ 'syringe' => array( 'unicode' => '&#xf48e;', 'styles' => array( 'sow-fas' ), ),
1155
+ 'table' => array( 'unicode' => '&#xf0ce;', 'styles' => array( 'sow-fas' ), ),
1156
+ 'table-tennis' => array( 'unicode' => '&#xf45d;', 'styles' => array( 'sow-fas' ), ),
1157
+ 'tablet' => array( 'unicode' => '&#xf10a;', 'styles' => array( 'sow-fas' ), ),
1158
+ 'tablet-alt' => array( 'unicode' => '&#xf3fa;', 'styles' => array( 'sow-fas' ), ),
1159
+ 'tablets' => array( 'unicode' => '&#xf490;', 'styles' => array( 'sow-fas' ), ),
1160
+ 'tachometer-alt' => array( 'unicode' => '&#xf3fd;', 'styles' => array( 'sow-fas' ), ),
1161
+ 'tag' => array( 'unicode' => '&#xf02b;', 'styles' => array( 'sow-fas' ), ),
1162
+ 'tags' => array( 'unicode' => '&#xf02c;', 'styles' => array( 'sow-fas' ), ),
1163
+ 'tape' => array( 'unicode' => '&#xf4db;', 'styles' => array( 'sow-fas' ), ),
1164
+ 'tasks' => array( 'unicode' => '&#xf0ae;', 'styles' => array( 'sow-fas' ), ),
1165
+ 'taxi' => array( 'unicode' => '&#xf1ba;', 'styles' => array( 'sow-fas' ), ),
1166
+ 'teamspeak' => array( 'unicode' => '&#xf4f9;', 'styles' => array( 'sow-fab' ), ),
1167
+ 'teeth' => array( 'unicode' => '&#xf62e;', 'styles' => array( 'sow-fas' ), ),
1168
+ 'teeth-open' => array( 'unicode' => '&#xf62f;', 'styles' => array( 'sow-fas' ), ),
1169
+ 'telegram' => array( 'unicode' => '&#xf2c6;', 'styles' => array( 'sow-fab' ), ),
1170
+ 'telegram-plane' => array( 'unicode' => '&#xf3fe;', 'styles' => array( 'sow-fab' ), ),
1171
+ 'temperature-high' => array( 'unicode' => '&#xf769;', 'styles' => array( 'sow-fas' ), ),
1172
+ 'temperature-low' => array( 'unicode' => '&#xf76b;', 'styles' => array( 'sow-fas' ), ),
1173
+ 'tencent-weibo' => array( 'unicode' => '&#xf1d5;', 'styles' => array( 'sow-fab' ), ),
1174
+ 'tenge' => array( 'unicode' => '&#xf7d7;', 'styles' => array( 'sow-fas' ), ),
1175
+ 'terminal' => array( 'unicode' => '&#xf120;', 'styles' => array( 'sow-fas' ), ),
1176
+ 'text-height' => array( 'unicode' => '&#xf034;', 'styles' => array( 'sow-fas' ), ),
1177
+ 'text-width' => array( 'unicode' => '&#xf035;', 'styles' => array( 'sow-fas' ), ),
1178
+ 'th' => array( 'unicode' => '&#xf00a;', 'styles' => array( 'sow-fas' ), ),
1179
+ 'th-large' => array( 'unicode' => '&#xf009;', 'styles' => array( 'sow-fas' ), ),
1180
+ 'th-list' => array( 'unicode' => '&#xf00b;', 'styles' => array( 'sow-fas' ), ),
1181
+ 'the-red-yeti' => array( 'unicode' => '&#xf69d;', 'styles' => array( 'sow-fab' ), ),
1182
+ 'theater-masks' => array( 'unicode' => '&#xf630;', 'styles' => array( 'sow-fas' ), ),
1183
+ 'themeco' => array(