Version Description
Download this release
Release Info
Developer | justinbusa |
Plugin | WordPress Page Builder – Beaver Builder |
Version | 1.7.1 |
Comparing to | |
See all releases |
Code changes from version 1.6.4.7 to 1.7.1
- changelog.txt +73 -0
- classes/class-fl-builder-ajax-layout.php +519 -0
- classes/class-fl-builder-ajax.php +190 -0
- classes/class-fl-builder-auto-suggest.php +2 -3
- classes/class-fl-builder-fonts.php +2638 -2377
- classes/class-fl-builder-loop.php +1 -1
- classes/class-fl-builder-model.php +414 -269
- classes/class-fl-builder-module.php +10 -0
- classes/class-fl-builder-photo.php +5 -0
- classes/class-fl-builder-service-sendinblue.php +1 -1
- classes/class-fl-builder-services.php +10 -16
- classes/class-fl-builder-shortcodes.php +75 -0
- classes/class-fl-builder-timezones.php +126 -0
- classes/class-fl-builder.php +445 -373
- css/fl-builder.css +53 -2
- css/fl-builder.min.css +1 -0
- fl-builder.php +15 -28
- includes/column-css.php +2 -0
- includes/column-group.php +1 -5
- includes/column.php +5 -0
- includes/field-code.php +8 -1
- includes/field-form.php +2 -2
- includes/field-link.php +1 -1
- includes/field-multiple-audios.php +27 -0
- includes/field-time.php +24 -0
- includes/field-timezone.php +3 -0
- includes/global-settings.php +40 -2
- includes/layout-settings.php +45 -0
- includes/ui-js-config.php +22 -14
- includes/updater-config.php +1 -1
- js/ace/ace.js +5 -5
- js/ace/ext-beautify.js +5 -0
- js/ace/ext-chromevox.js +5 -1
- js/ace/ext-elastic_tabstops_lite.js +5 -1
- js/ace/ext-emmet.js +5 -1
- js/ace/ext-error_marker.js +5 -0
- js/ace/ext-keybinding_menu.js +5 -1
- js/ace/ext-language_tools.js +0 -1
changelog.txt
CHANGED
@@ -1,3 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<h4>1.6.4.7 - 1/10/2016</h4>
|
2 |
<p><strong>Enhancements</strong></p>
|
3 |
<ul>
|
1 |
+
<h4>1.7.1 - 01/24/2016</h4>
|
2 |
+
<p><strong>Security</strong></p>
|
3 |
+
<ul>
|
4 |
+
<li>Fixed a security issue that could allow a logged in user that doesn't have permission to edit a page to make calls to the builder's editing functions by spoofing an AJAX request. While this issue mainly affects sites that allow anyone to register, it is still recommended that everyone update immediately.</li>
|
5 |
+
<li>Now using nonces in AJAX requests for additional security.</li>
|
6 |
+
</ul>
|
7 |
+
<p><strong>Enhancements</strong></p>
|
8 |
+
<ul>
|
9 |
+
<li>The Number Counter module now uses thousands separators.</li>
|
10 |
+
<li>Updated multiple translations.</li>
|
11 |
+
<li>The parent node id is now passed when nested forms are rendered so the parent settings can be accessed by the nested form's controls.</li>
|
12 |
+
</ul>
|
13 |
+
<p><strong>Bug Fixes</strong></p>
|
14 |
+
<ul>
|
15 |
+
<li>Fixed multiple translation issues.</li>
|
16 |
+
<li>Fixed a bug causing an error on the post list admin screen.</li>
|
17 |
+
<li>Fixed a bug with the read more link not showing in the Posts module when the content is hidden.</li>
|
18 |
+
<li>Fixed a bug with the default value in font fields.</li>
|
19 |
+
<li>Fixed a bug with button style settings showing when no background color is selected.</li>
|
20 |
+
<li>Fixed a bug with nested form preview text on PHP 7.</li>
|
21 |
+
</ul>
|
22 |
+
|
23 |
+
<h4>1.7 - 01/18/2016</h4>
|
24 |
+
<p>This update adds a number of new features. Be sure to check out <a href="https://www.wpbeaverbuilder.com/beaver-builder-1-7-now-with-partial-refresh-per-page-code-settings-and-our-first-shortcode/">the blog post</a> for detailed info on what was added.</p>
|
25 |
+
<p><strong>Enhancements</strong></p>
|
26 |
+
<ul>
|
27 |
+
<li>Added partial refresh for all rows, columns, and modules. Developers will need to read the custom module docs for info on making their modules compatible with partial refresh.</li>
|
28 |
+
<li>Added the Layout Settings panel with per-page CSS and JavaScript settings.</li>
|
29 |
+
<li>Added CSS and JavaScript settings to the Global Settings panel.</li>
|
30 |
+
<li>Added the Audio module.</li>
|
31 |
+
<li>Added the Countdown module.</li>
|
32 |
+
<li>Added new style settings to the Pricing Table module for achieving a variety of different looks.</li>
|
33 |
+
<li>Added the fl_builder_insert_layout shortcode for inserting builder saved templates, rows, modules anywhere in your posts.</li>
|
34 |
+
<li>Added the FLBuilder::render_query method for rendering layouts anywhere within a theme's PHP files.</li>
|
35 |
+
<li>Refactored frontend AJAX actions and rendering to support partial refresh. Developers tapping into those actions may need to update their code.</li>
|
36 |
+
<li>Optimized loading of the builder UI by concatenating and minifying all core CSS and JavaScript files.</li>
|
37 |
+
<li>Builder caching is now disabled when WP_DEBUG is set to true.</li>
|
38 |
+
<li>The editing capability setting now supports multiple comma seperated values.</li>
|
39 |
+
<li>Updated Google fonts.</li>
|
40 |
+
</ul>
|
41 |
+
<p><strong>Bug Fixes</strong></p>
|
42 |
+
<ul>
|
43 |
+
<li>Fixed a bug with the Subscribe Form module.</li>
|
44 |
+
<li>Fixed CSS specificity issues with the new builder shortcode.</li>
|
45 |
+
<li>Fixed a CSS bug with custom column widths on small devices.</li>
|
46 |
+
</ul>
|
47 |
+
|
48 |
+
<h4>1.7-beta.2 - 1/10/2016</h4>
|
49 |
+
<p><strong>Enhancements</strong></p>
|
50 |
+
<ul>
|
51 |
+
<li>Builder caching is now disabled when WP_DEBUG is set to true.</li>
|
52 |
+
</ul>
|
53 |
+
<p><strong>Bug Fixes</strong></p>
|
54 |
+
<ul>
|
55 |
+
<li>Fixed a bug with the Subscribe Form module.</li>
|
56 |
+
<li>Fixed CSS specificity issues with the new builder shortcode.</li>
|
57 |
+
</ul>
|
58 |
+
|
59 |
+
<h4>1.7-beta.1 - 12/16/2015</h4>
|
60 |
+
<p><strong>Enhancements</strong></p>
|
61 |
+
<ul>
|
62 |
+
<li>Added partial refresh for all rows, columns, and modules. Developers will need to read the custom module docs for info on making their modules compatible with partial refresh.</li>
|
63 |
+
<li>Added the Layout Settings panel with per-page CSS and JavaScript settings.</li>
|
64 |
+
<li>Added CSS and JavaScript settings to the Global Settings panel.</li>
|
65 |
+
<li>Added the Audio module.</li>
|
66 |
+
<li>Added the Countdown module.</li>
|
67 |
+
<li>Added new style settings to the Pricing Table module for achieving a variety of different looks.</li>
|
68 |
+
<li>Added the fl_builder_insert_layout shortcode for inserting builder saved templates, rows, modules anywhere in your posts.</li>
|
69 |
+
<li>Added the FLBuilder::render_query method for rendering layouts anywhere within a theme's PHP files.</li>
|
70 |
+
<li>Refactored frontend AJAX actions and rendering to support partial refresh. Developers tapping into those actions may need to update their code.</li>
|
71 |
+
<li>Optimized loading of the builder UI by concatenating and minifying all core CSS and JavaScript files.</li>
|
72 |
+
</ul>
|
73 |
+
|
74 |
<h4>1.6.4.7 - 1/10/2016</h4>
|
75 |
<p><strong>Enhancements</strong></p>
|
76 |
<ul>
|
classes/class-fl-builder-ajax-layout.php
ADDED
@@ -0,0 +1,519 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Handles the rendering of the layout for AJAX refreshes.
|
5 |
+
*
|
6 |
+
* @since 1.7
|
7 |
+
*/
|
8 |
+
final class FLBuilderAJAXLayout {
|
9 |
+
|
10 |
+
/**
|
11 |
+
* An array with data for partial refreshes.
|
12 |
+
*
|
13 |
+
* @since 1.7
|
14 |
+
* @access private
|
15 |
+
* @var array $partial_refresh_data
|
16 |
+
*/
|
17 |
+
static private $partial_refresh_data = null;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Renders the layout data to be passed back to the builder.
|
21 |
+
*
|
22 |
+
* @since 1.7
|
23 |
+
* @param string $node_id The ID of a node to try and render instead of the entire layout.
|
24 |
+
* @param string $old_node_id The ID of a node that has been replaced in the layout.
|
25 |
+
* @return array
|
26 |
+
*/
|
27 |
+
static public function render( $node_id = null, $old_node_id = null )
|
28 |
+
{
|
29 |
+
// Update the node ID in the post data?
|
30 |
+
if ( $node_id ) {
|
31 |
+
FLBuilderModel::update_post_data( 'node_id', $node_id );
|
32 |
+
}
|
33 |
+
|
34 |
+
// Render CSS and JS assets.
|
35 |
+
FLBuilder::render_assets();
|
36 |
+
|
37 |
+
// Register scripts needed for shortcodes and widgets.
|
38 |
+
self::register_scripts();
|
39 |
+
|
40 |
+
// Dequeue scripts and styles to only capture those that are needed.
|
41 |
+
self::dequeue_scripts_and_styles();
|
42 |
+
|
43 |
+
// Get the partial refresh data.
|
44 |
+
$partial_refresh_data = self::get_partial_refresh_data();
|
45 |
+
|
46 |
+
// Render the markup.
|
47 |
+
$html = self::render_html();
|
48 |
+
|
49 |
+
// Render scripts and styles.
|
50 |
+
$scripts_styles = self::render_scripts_and_styles();
|
51 |
+
|
52 |
+
// Render the assets.
|
53 |
+
$assets = self::render_assets();
|
54 |
+
|
55 |
+
// Return the response.
|
56 |
+
return array(
|
57 |
+
'partial' => $partial_refresh_data['is_partial_refresh'],
|
58 |
+
'nodeId' => $partial_refresh_data['node_id'],
|
59 |
+
'nodeType' => $partial_refresh_data['node_type'],
|
60 |
+
'oldNodeId' => $old_node_id,
|
61 |
+
'html' => $html,
|
62 |
+
'scriptsStyles' => $scripts_styles,
|
63 |
+
'css' => $assets['css'],
|
64 |
+
'js' => $assets['js']
|
65 |
+
);
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Renders the layout data for a new row.
|
70 |
+
*
|
71 |
+
* @since 1.7
|
72 |
+
* @param string $cols The type of column layout to use.
|
73 |
+
* @param int $position The position of the new row in the layout.
|
74 |
+
* @param string $template_id The ID of a row template to render.
|
75 |
+
* @return array
|
76 |
+
*/
|
77 |
+
static public function render_new_row( $cols = '1-col', $position = false, $template_id = null )
|
78 |
+
{
|
79 |
+
// Add a row template?
|
80 |
+
if ( $template_id ) {
|
81 |
+
|
82 |
+
// Add the row template.
|
83 |
+
$row = FLBuilderModel::apply_node_template( $template_id, null, $position );
|
84 |
+
|
85 |
+
// Return the response.
|
86 |
+
return self::render( $row->node );
|
87 |
+
}
|
88 |
+
// Add a standard row.
|
89 |
+
else {
|
90 |
+
|
91 |
+
// Add the row.
|
92 |
+
$row = FLBuilderModel::add_row( $cols, $position );
|
93 |
+
|
94 |
+
// Render the row.
|
95 |
+
ob_start();
|
96 |
+
FLBuilder::render_row( $row );
|
97 |
+
$html = ob_get_clean();
|
98 |
+
|
99 |
+
// Return the response.
|
100 |
+
return array(
|
101 |
+
'partial' => true,
|
102 |
+
'nodeType' => $row->type,
|
103 |
+
'html' => $html,
|
104 |
+
'js' => 'FLBuilder._renderLayoutComplete();'
|
105 |
+
);
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
/**
|
110 |
+
* Renders the layout data for a copied row.
|
111 |
+
*
|
112 |
+
* @since 1.7
|
113 |
+
* @param string $node_id The ID of a row to copy.
|
114 |
+
* @return array
|
115 |
+
*/
|
116 |
+
static public function copy_row( $node_id )
|
117 |
+
{
|
118 |
+
$row = FLBuilderModel::copy_row( $node_id );
|
119 |
+
|
120 |
+
return self::render( $row->node );
|
121 |
+
}
|
122 |
+
|
123 |
+
/**
|
124 |
+
* Renders the layout data for a new column group.
|
125 |
+
*
|
126 |
+
* @since 1.7
|
127 |
+
* @param string $node_id The node ID of a row to add the new group to.
|
128 |
+
* @param string $cols The type of column layout to use.
|
129 |
+
* @param int $position The position of the new column group in the row.
|
130 |
+
* @return array
|
131 |
+
*/
|
132 |
+
static public function render_new_column_group( $node_id, $cols = '1-col', $position = false )
|
133 |
+
{
|
134 |
+
// Add the group.
|
135 |
+
$group = FLBuilderModel::add_col_group( $node_id, $cols, $position );
|
136 |
+
|
137 |
+
// Render the group.
|
138 |
+
ob_start();
|
139 |
+
FLBuilder::render_column_group( $group );
|
140 |
+
$html = ob_get_clean();
|
141 |
+
|
142 |
+
// Return the response.
|
143 |
+
return array(
|
144 |
+
'partial' => true,
|
145 |
+
'nodeType' => $group->type,
|
146 |
+
'html' => $html,
|
147 |
+
'js' => 'FLBuilder._renderLayoutComplete();'
|
148 |
+
);
|
149 |
+
}
|
150 |
+
|
151 |
+
/**
|
152 |
+
* Renders the layout data for a new column.
|
153 |
+
*
|
154 |
+
* @since 1.7
|
155 |
+
* @param string $node_id Node ID of the column to insert before or after.
|
156 |
+
* @param string $insert Either before or after.
|
157 |
+
* @return array
|
158 |
+
*/
|
159 |
+
static public function render_new_column( $node_id, $insert )
|
160 |
+
{
|
161 |
+
// Add the column.
|
162 |
+
$col = FLBuilderModel::add_col( $node_id, $insert );
|
163 |
+
|
164 |
+
// Return the response.
|
165 |
+
return self::render( $col->parent );
|
166 |
+
}
|
167 |
+
|
168 |
+
/**
|
169 |
+
* Renders the layout data for a new module.
|
170 |
+
*
|
171 |
+
* @since 1.7
|
172 |
+
* @param string $parent_id A column node ID.
|
173 |
+
* @param int $position The new module position.
|
174 |
+
* @param string $type The type of module.
|
175 |
+
* @param string $template_id The ID of a module template to render.
|
176 |
+
* @return array
|
177 |
+
*/
|
178 |
+
static public function render_new_module( $parent_id, $position = false, $type = null, $template_id = null )
|
179 |
+
{
|
180 |
+
// Add a module template?
|
181 |
+
if ( $template_id ) {
|
182 |
+
$module = FLBuilderModel::apply_node_template( $template_id, $parent_id, $position );
|
183 |
+
}
|
184 |
+
// Add a standard module.
|
185 |
+
else {
|
186 |
+
$module = FLBuilderModel::add_default_module( $parent_id, $type, $position );
|
187 |
+
}
|
188 |
+
|
189 |
+
// Render the new module's settings.
|
190 |
+
$settings = FLBuilder::render_module_settings( $module->node, $module->settings->type, $module->parent, false );
|
191 |
+
|
192 |
+
// Maybe render the module's parent for a partial refresh?
|
193 |
+
if ( $module->partial_refresh ) {
|
194 |
+
|
195 |
+
// Get the new module parent.
|
196 |
+
$parent = ! $parent_id ? null : FLBuilderModel::get_node( $parent_id );
|
197 |
+
|
198 |
+
// Get the node to render.
|
199 |
+
if ( ! $parent ) {
|
200 |
+
$row = FLBuilderModel::get_module_parent( 'row', $module );
|
201 |
+
$render_id = $row->node;
|
202 |
+
}
|
203 |
+
else if ( $parent->type == 'row' ) {
|
204 |
+
$col = FLBuilderModel::get_module_parent( 'column-group', $module );
|
205 |
+
$render_id = $col->node;
|
206 |
+
}
|
207 |
+
else {
|
208 |
+
$render_id = $module->node;
|
209 |
+
}
|
210 |
+
}
|
211 |
+
else {
|
212 |
+
$render_id = null;
|
213 |
+
}
|
214 |
+
|
215 |
+
// Return the response.
|
216 |
+
return array(
|
217 |
+
'layout' => self::render( $render_id ),
|
218 |
+
'settings' => $settings['settings']
|
219 |
+
);
|
220 |
+
}
|
221 |
+
|
222 |
+
/**
|
223 |
+
* Renders the layout data for a copied module.
|
224 |
+
*
|
225 |
+
* @since 1.7
|
226 |
+
* @param string $node_id The ID of a module to copy.
|
227 |
+
* @return array
|
228 |
+
*/
|
229 |
+
static public function copy_module( $node_id )
|
230 |
+
{
|
231 |
+
$module = FLBuilderModel::copy_module( $node_id );
|
232 |
+
|
233 |
+
return self::render( $module->node );
|
234 |
+
}
|
235 |
+
|
236 |
+
/**
|
237 |
+
* Returns an array of partial refresh data.
|
238 |
+
*
|
239 |
+
* @since 1.7
|
240 |
+
* @access private
|
241 |
+
* @return array
|
242 |
+
*/
|
243 |
+
static private function get_partial_refresh_data()
|
244 |
+
{
|
245 |
+
// Get the data if it's not cached.
|
246 |
+
if ( ! self::$partial_refresh_data ) {
|
247 |
+
|
248 |
+
$post_data = FLBuilderModel::get_post_data();
|
249 |
+
$partial_refresh = false;
|
250 |
+
|
251 |
+
// Check for partial refresh if we have a node ID.
|
252 |
+
if ( isset( $post_data['node_id'] ) ) {
|
253 |
+
|
254 |
+
// Get the node.
|
255 |
+
$node_id = $post_data['node_id'];
|
256 |
+
$node = FLBuilderModel::get_node( $post_data['node_id'] );
|
257 |
+
|
258 |
+
// Check a module for partial refresh.
|
259 |
+
if ( $node && 'module' == $node->type ) {
|
260 |
+
$node = FLBuilderModel::get_module( $node_id );
|
261 |
+
$node_type = 'module';
|
262 |
+
$partial_refresh = $node->partial_refresh;
|
263 |
+
}
|
264 |
+
// Always partial refresh rows and columns.
|
265 |
+
else if ( $node ) {
|
266 |
+
$node_type = $node->type;
|
267 |
+
$partial_refresh = self::node_modules_support_partial_refresh( $node );
|
268 |
+
}
|
269 |
+
}
|
270 |
+
|
271 |
+
// Clear the node data if we're not doing a partial refresh.
|
272 |
+
if ( ! $partial_refresh ) {
|
273 |
+
$node_id = null;
|
274 |
+
$node = null;
|
275 |
+
$node_type = null;
|
276 |
+
}
|
277 |
+
|
278 |
+
// Cache the partial refresh data.
|
279 |
+
self::$partial_refresh_data = array(
|
280 |
+
'is_partial_refresh' => $partial_refresh,
|
281 |
+
'node_id' => $node_id,
|
282 |
+
'node' => $node,
|
283 |
+
'node_type' => $node_type
|
284 |
+
);
|
285 |
+
}
|
286 |
+
|
287 |
+
// Return the data.
|
288 |
+
return self::$partial_refresh_data;
|
289 |
+
}
|
290 |
+
|
291 |
+
/**
|
292 |
+
* Checks to see if all modules in a node support partial refresh.
|
293 |
+
*
|
294 |
+
* @since 1.7
|
295 |
+
* @access private
|
296 |
+
* @param object $node The node to check.
|
297 |
+
* @return bool
|
298 |
+
*/
|
299 |
+
static private function node_modules_support_partial_refresh( $node )
|
300 |
+
{
|
301 |
+
$nodes = FLBuilderModel::get_categorized_nodes();
|
302 |
+
|
303 |
+
if ( 'row' == $node->type ) {
|
304 |
+
|
305 |
+
$template_post_id = FLBuilderModel::is_node_global( $node );
|
306 |
+
|
307 |
+
foreach( $nodes['groups'] as $group ) {
|
308 |
+
if ( $node->node == $group->parent || ( $template_post_id && $node->template_node_id == $group->parent ) ) {
|
309 |
+
foreach( $nodes['columns'] as $column ) {
|
310 |
+
if ( $group->node == $column->parent ) {
|
311 |
+
foreach( $nodes['modules'] as $module ) {
|
312 |
+
if ( $column->node == $module->parent ) {
|
313 |
+
if ( ! $module->partial_refresh ) {
|
314 |
+
return false;
|
315 |
+
}
|
316 |
+
}
|
317 |
+
}
|
318 |
+
}
|
319 |
+
}
|
320 |
+
}
|
321 |
+
}
|
322 |
+
}
|
323 |
+
else if ( 'column-group' == $node->type ) {
|
324 |
+
foreach( $nodes['columns'] as $column ) {
|
325 |
+
if ( $node->node == $column->parent ) {
|
326 |
+
foreach( $nodes['modules'] as $module ) {
|
327 |
+
if ( $column->node == $module->parent ) {
|
328 |
+
if ( ! $module->partial_refresh ) {
|
329 |
+
return false;
|
330 |
+
}
|
331 |
+
}
|
332 |
+
}
|
333 |
+
}
|
334 |
+
}
|
335 |
+
}
|
336 |
+
else if ( 'column' == $node->type ) {
|
337 |
+
foreach( $nodes['modules'] as $module ) {
|
338 |
+
if ( $node->node == $module->parent ) {
|
339 |
+
if ( ! $module->partial_refresh ) {
|
340 |
+
return false;
|
341 |
+
}
|
342 |
+
}
|
343 |
+
}
|
344 |
+
}
|
345 |
+
|
346 |
+
return true;
|
347 |
+
}
|
348 |
+
|
349 |
+
/**
|
350 |
+
* Renders the html for the layout or node.
|
351 |
+
*
|
352 |
+
* @since 1.7
|
353 |
+
* @access private
|
354 |
+
* @return string
|
355 |
+
*/
|
356 |
+
static private function render_html()
|
357 |
+
{
|
358 |
+
// Get the partial refresh data.
|
359 |
+
$partial_refresh_data = self::get_partial_refresh_data();
|
360 |
+
|
361 |
+
// Start the output buffer.
|
362 |
+
ob_start();
|
363 |
+
|
364 |
+
// Render a node?
|
365 |
+
if ( $partial_refresh_data['is_partial_refresh'] ) {
|
366 |
+
|
367 |
+
switch ( $partial_refresh_data[ 'node' ]->type ) {
|
368 |
+
|
369 |
+
case 'row':
|
370 |
+
FLBuilder::render_row( $partial_refresh_data['node'] );
|
371 |
+
break;
|
372 |
+
|
373 |
+
case 'column-group':
|
374 |
+
FLBuilder::render_column_group( $partial_refresh_data['node'] );
|
375 |
+
break;
|
376 |
+
|
377 |
+
case 'column':
|
378 |
+
FLBuilder::render_column( $partial_refresh_data['node'] );
|
379 |
+
break;
|
380 |
+
|
381 |
+
case 'module':
|
382 |
+
FLBuilder::render_module( $partial_refresh_data['node'] );
|
383 |
+
break;
|
384 |
+
}
|
385 |
+
}
|
386 |
+
// Render the layout.
|
387 |
+
else {
|
388 |
+
FLBuilder::render_nodes();
|
389 |
+
}
|
390 |
+
|
391 |
+
// Get the rendered HTML.
|
392 |
+
$html = ob_get_clean();
|
393 |
+
|
394 |
+
// Process shortcodes and return the HTML.
|
395 |
+
ob_start();
|
396 |
+
echo do_shortcode( $html );
|
397 |
+
return ob_get_clean();
|
398 |
+
}
|
399 |
+
|
400 |
+
/**
|
401 |
+
* Renders the assets for the layout or a node.
|
402 |
+
*
|
403 |
+
* @since 1.7
|
404 |
+
* @access private
|
405 |
+
* @return array
|
406 |
+
*/
|
407 |
+
static private function render_assets()
|
408 |
+
{
|
409 |
+
$partial_refresh_data = self::get_partial_refresh_data();
|
410 |
+
$asset_info = FLBuilderModel::get_asset_info();
|
411 |
+
$asset_ver = FLBuilderModel::get_asset_version();
|
412 |
+
$assets = array( 'js' => '', 'css' => '' );
|
413 |
+
|
414 |
+
// Render the JS.
|
415 |
+
if ( $partial_refresh_data['is_partial_refresh'] ) {
|
416 |
+
|
417 |
+
if ( ! class_exists( 'FLJSMin' ) ) {
|
418 |
+
include FL_BUILDER_DIR . 'classes/class-fl-jsmin.php';
|
419 |
+
}
|
420 |
+
|
421 |
+
switch ( $partial_refresh_data['node']->type ) {
|
422 |
+
|
423 |
+
case 'row':
|
424 |
+
$assets['js'] = FLBuilder::render_row_js( $partial_refresh_data['node'] );
|
425 |
+
$assets['js'] .= FLBuilder::render_row_modules_js( $partial_refresh_data['node'] );
|
426 |
+
break;
|
427 |
+
|
428 |
+
case 'column':
|
429 |
+
$assets['js'] = FLBuilder::render_column_modules_js( $partial_refresh_data['node'] );
|
430 |
+
break;
|
431 |
+
|
432 |
+
case 'module':
|
433 |
+
$assets['js'] = FLBuilder::render_module_js( $partial_refresh_data['node'] );
|
434 |
+
break;
|
435 |
+
}
|
436 |
+
|
437 |
+
$assets['js'] .= 'FLBuilder._renderLayoutComplete();';
|
438 |
+
$assets['js'] = FLJSMin::minify( $assets['js'] );
|
439 |
+
}
|
440 |
+
else {
|
441 |
+
$assets['js'] = $asset_info['js_url'] . '?ver=' . $asset_ver;
|
442 |
+
}
|
443 |
+
|
444 |
+
// Render the CSS.
|
445 |
+
$assets['css'] = $asset_info['css_url'] . '?ver=' . $asset_ver;
|
446 |
+
|
447 |
+
// Return the assets.
|
448 |
+
return $assets;
|
449 |
+
}
|
450 |
+
|
451 |
+
/**
|
452 |
+
* Do the wp_enqueue_scripts action to register any scripts or
|
453 |
+
* styles that might need to be registered for shortcodes or widgets.
|
454 |
+
*
|
455 |
+
* @since 1.7
|
456 |
+
* @access private
|
457 |
+
* @return void
|
458 |
+
*/
|
459 |
+
static private function register_scripts()
|
460 |
+
{
|
461 |
+
ob_start();
|
462 |
+
do_action( 'wp_enqueue_scripts' );
|
463 |
+
ob_end_clean();
|
464 |
+
}
|
465 |
+
|
466 |
+
/**
|
467 |
+
* Dequeue scripts and styles so we can capture only those
|
468 |
+
* enqueued by shortcodes or widgets.
|
469 |
+
*
|
470 |
+
* @since 1.7
|
471 |
+
* @access private
|
472 |
+
* @return void
|
473 |
+
*/
|
474 |
+
static private function dequeue_scripts_and_styles()
|
475 |
+
{
|
476 |
+
global $wp_scripts;
|
477 |
+
global $wp_styles;
|
478 |
+
|
479 |
+
if ( isset( $wp_scripts ) ) {
|
480 |
+
$wp_scripts->queue = array();
|
481 |
+
}
|
482 |
+
if ( isset( $wp_styles ) ) {
|
483 |
+
$wp_styles->queue = array();
|
484 |
+
}
|
485 |
+
|
486 |
+
remove_action( 'wp_print_styles', 'print_emoji_styles' );
|
487 |
+
}
|
488 |
+
|
489 |
+
/**
|
490 |
+
* Renders scripts and styles enqueued by shortcodes or widgets.
|
491 |
+
*
|
492 |
+
* @since 1.7
|
493 |
+
* @access private
|
494 |
+
* @return string
|
495 |
+
*/
|
496 |
+
static private function render_scripts_and_styles()
|
497 |
+
{
|
498 |
+
global $wp_scripts;
|
499 |
+
global $wp_styles;
|
500 |
+
|
501 |
+
$partial_refresh_data = self::get_partial_refresh_data();
|
502 |
+
$scripts_styles = '';
|
503 |
+
|
504 |
+
// Start the output buffer.
|
505 |
+
ob_start();
|
506 |
+
|
507 |
+
// Print scripts and styles.
|
508 |
+
if ( isset( $wp_scripts ) ) {
|
509 |
+
$wp_scripts->done[] = 'jquery';
|
510 |
+
wp_print_scripts( $wp_scripts->queue );
|
511 |
+
}
|
512 |
+
if ( isset( $wp_styles ) ) {
|
513 |
+
wp_print_styles( $wp_styles->queue );
|
514 |
+
}
|
515 |
+
|
516 |
+
// Return the scripts and styles markup.
|
517 |
+
return ob_get_clean();
|
518 |
+
}
|
519 |
+
}
|
classes/class-fl-builder-ajax.php
ADDED
@@ -0,0 +1,190 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Front-end AJAX handler for the builder interface. We use this
|
5 |
+
* instead of wp_ajax because that only works in the admin and
|
6 |
+
* certain things like some shortcodes won't render there. AJAX
|
7 |
+
* requests handled through this method only run for logged in users
|
8 |
+
* for extra security. Developers creating custom modules that need
|
9 |
+
* AJAX should use wp_ajax instead.
|
10 |
+
*
|
11 |
+
* @since 1.7
|
12 |
+
*/
|
13 |
+
final class FLBuilderAJAX {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* An array of registered action data.
|
17 |
+
*
|
18 |
+
* @since 1.7
|
19 |
+
* @access private
|
20 |
+
* @var array $actions
|
21 |
+
*/
|
22 |
+
static private $actions = array();
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Initializes builder AJAX.
|
26 |
+
*
|
27 |
+
* @since 1.7
|
28 |
+
* @return void
|
29 |
+
*/
|
30 |
+
static public function init()
|
31 |
+
{
|
32 |
+
self::add_actions();
|
33 |
+
self::call_action();
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Adds a callable AJAX action.
|
38 |
+
*
|
39 |
+
* @since 1.7
|
40 |
+
* @param string $action The action name.
|
41 |
+
* @param string $method The method to call.
|
42 |
+
* @param array $args An array of method arg names that are present in the post data.
|
43 |
+
* @return void
|
44 |
+
*/
|
45 |
+
static public function add_action( $action, $method, $args = array() )
|
46 |
+
{
|
47 |
+
self::$actions[ $action ] = array(
|
48 |
+
'method' => $method,
|
49 |
+
'args' => $args
|
50 |
+
);
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Adds all callable AJAX actions.
|
55 |
+
*
|
56 |
+
* @since 1.7
|
57 |
+
* @access private
|
58 |
+
* @return void
|
59 |
+
*/
|
60 |
+
static private function add_actions()
|
61 |
+
{
|
62 |
+
// FLBuilder
|
63 |
+
self::add_action( 'render_settings_form', 'FLBuilder::render_settings_form', array( 'type', 'settings' ) );
|
64 |
+
self::add_action( 'render_node_template_settings', 'FLBuilder::render_node_template_settings', array( 'node_id' ) );
|
65 |
+
self::add_action( 'render_row_settings', 'FLBuilder::render_row_settings', array( 'node_id' ) );
|
66 |
+
self::add_action( 'render_column_settings', 'FLBuilder::render_column_settings', array( 'node_id' ) );
|
67 |
+
self::add_action( 'render_module_settings', 'FLBuilder::render_module_settings', array( 'node_id', 'type', 'parent_id' ) );
|
68 |
+
self::add_action( 'render_layout_settings', 'FLBuilder::render_layout_settings' );
|
69 |
+
self::add_action( 'render_global_settings', 'FLBuilder::render_global_settings' );
|
70 |
+
self::add_action( 'render_template_selector', 'FLBuilder::render_template_selector' );
|
71 |
+
self::add_action( 'render_user_template_settings', 'FLBuilder::render_user_template_settings' );
|
72 |
+
self::add_action( 'render_icon_selector', 'FLBuilder::render_icon_selector' );
|
73 |
+
|
74 |
+
// FLBuilderModel
|
75 |
+
self::add_action( 'delete_node', 'FLBuilderModel::delete_node', array( 'node_id' ) );
|
76 |
+
self::add_action( 'delete_col', 'FLBuilderModel::delete_col', array( 'node_id', 'new_width' ) );
|
77 |
+
self::add_action( 'reorder_node', 'FLBuilderModel::reorder_node', array( 'node_id', 'position' ) );
|
78 |
+
self::add_action( 'move_node', 'FLBuilderModel::move_node', array( 'node_id', 'new_parent', 'position' ) );
|
79 |
+
self::add_action( 'resize_cols', 'FLBuilderModel::resize_cols', array( 'col_id', 'col_width', 'sibling_id', 'sibling_width' ) );
|
80 |
+
self::add_action( 'reset_col_widths', 'FLBuilderModel::reset_col_widths', array( 'group_id' ) );
|
81 |
+
self::add_action( 'save_settings', 'FLBuilderModel::save_settings', array( 'node_id', 'settings' ) );
|
82 |
+
self::add_action( 'save_layout_settings', 'FLBuilderModel::save_layout_settings', array( 'settings' ) );
|
83 |
+
self::add_action( 'save_global_settings', 'FLBuilderModel::save_global_settings', array( 'settings' ) );
|
84 |
+
self::add_action( 'save_color_presets', 'FLBuilderModel::save_color_presets', array( 'presets' ) );
|
85 |
+
self::add_action( 'duplicate_post', 'FLBuilderModel::duplicate_post' );
|
86 |
+
self::add_action( 'duplicate_wpml_layout', 'FLBuilderModel::duplicate_wpml_layout', array( 'original_post_id', 'post_id' ) );
|
87 |
+
self::add_action( 'save_user_template', 'FLBuilderModel::save_user_template', array( 'settings' ) );
|
88 |
+
self::add_action( 'delete_user_template', 'FLBuilderModel::delete_user_template', array( 'template_id' ) );
|
89 |
+
self::add_action( 'apply_user_template', 'FLBuilderModel::apply_user_template', array( 'template_id', 'append' ) );
|
90 |
+
self::add_action( 'save_node_template', 'FLBuilderModel::save_node_template', array( 'node_id', 'settings' ) );
|
91 |
+
self::add_action( 'delete_node_template', 'FLBuilderModel::delete_node_template', array( 'template_id' ) );
|
92 |
+
self::add_action( 'apply_template', 'FLBuilderModel::apply_template', array( 'template_id', 'append' ) );
|
93 |
+
self::add_action( 'save_layout', 'FLBuilderModel::save_layout' );
|
94 |
+
self::add_action( 'save_draft', 'FLBuilderModel::save_draft' );
|
95 |
+
self::add_action( 'clear_draft_layout', 'FLBuilderModel::clear_draft_layout' );
|
96 |
+
self::add_action( 'disable_builder', 'FLBuilderModel::disable' );
|
97 |
+
|
98 |
+
// FLBuilderAJAXLayout
|
99 |
+
self::add_action( 'render_layout', 'FLBuilderAJAXLayout::render' );
|
100 |
+
self::add_action( 'render_new_row', 'FLBuilderAJAXLayout::render_new_row', array( 'cols', 'position', 'template_id' ) );
|
101 |
+
self::add_action( 'copy_row', 'FLBuilderAJAXLayout::copy_row', array( 'node_id' ) );
|
102 |
+
self::add_action( 'render_new_column_group', 'FLBuilderAJAXLayout::render_new_column_group', array( 'node_id', 'cols', 'position' ) );
|
103 |
+
self::add_action( 'render_new_column', 'FLBuilderAJAXLayout::render_new_column', array( 'node_id', 'insert' ) );
|
104 |
+
self::add_action( 'render_new_module', 'FLBuilderAJAXLayout::render_new_module', array( 'parent_id', 'position', 'type', 'template_id' ) );
|
105 |
+
self::add_action( 'copy_module', 'FLBuilderAJAXLayout::copy_module', array( 'node_id' ) );
|
106 |
+
|
107 |
+
// FLBuilderServices
|
108 |
+
self::add_action( 'render_service_settings', 'FLBuilderServices::render_settings' );
|
109 |
+
self::add_action( 'render_service_fields', 'FLBuilderServices::render_fields' );
|
110 |
+
self::add_action( 'connect_service', 'FLBuilderServices::connect_service' );
|
111 |
+
self::add_action( 'delete_service_account', 'FLBuilderServices::delete_account' );
|
112 |
+
self::add_action( 'delete_service_account', 'FLBuilderServices::delete_account' );
|
113 |
+
|
114 |
+
// FLBuilderAutoSuggest
|
115 |
+
self::add_action( 'fl_builder_autosuggest', 'FLBuilderAutoSuggest::init' );
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Runs the current AJAX action.
|
120 |
+
*
|
121 |
+
* @since 1.7
|
122 |
+
* @access private
|
123 |
+
* @return void
|
124 |
+
*/
|
125 |
+
static private function call_action()
|
126 |
+
{
|
127 |
+
// Only run for logged in users.
|
128 |
+
if ( ! is_user_logged_in() ) {
|
129 |
+
return;
|
130 |
+
}
|
131 |
+
|
132 |
+
// Get the $_POST data.
|
133 |
+
$post_data = FLBuilderModel::get_post_data();
|
134 |
+
|
135 |
+
// Verify the AJAX nonce.
|
136 |
+
if ( ! isset( $post_data['_wpnonce'] ) || ! wp_verify_nonce( $post_data['_wpnonce'], 'fl_ajax_update' ) ) {
|
137 |
+
return;
|
138 |
+
}
|
139 |
+
|
140 |
+
// Get the post ID.
|
141 |
+
$post_id = FLBuilderModel::get_post_id();
|
142 |
+
|
143 |
+
// Make sure we have a post ID.
|
144 |
+
if ( ! $post_id ) {
|
145 |
+
return;
|
146 |
+
}
|
147 |
+
|
148 |
+
// Make sure the user can edit this post.
|
149 |
+
if ( ! current_user_can( 'edit_post', $post_id ) ) {
|
150 |
+
return;
|
151 |
+
}
|
152 |
+
|
153 |
+
// Get the action.
|
154 |
+
if ( ! empty( $_REQUEST['fl_action'] ) ) {
|
155 |
+
$action = $_REQUEST['fl_action'];
|
156 |
+
}
|
157 |
+
else if( ! empty( $post_data['fl_action'] ) ) {
|
158 |
+
$action = $post_data['fl_action'];
|
159 |
+
}
|
160 |
+
else {
|
161 |
+
return;
|
162 |
+
}
|
163 |
+
|
164 |
+
// Make sure the action exists.
|
165 |
+
if ( ! isset( self::$actions[ $action ] ) ) {
|
166 |
+
return;
|
167 |
+
}
|
168 |
+
|
169 |
+
// Get the action data.
|
170 |
+
$action = self::$actions[ $action ];
|
171 |
+
$args = array();
|
172 |
+
|
173 |
+
// Build the args array.
|
174 |
+
foreach ( $action['args'] as $arg ) {
|
175 |
+
$args[] = isset( $post_data[ $arg ] ) ? $post_data[ $arg ] : null;
|
176 |
+
}
|
177 |
+
|
178 |
+
// Tell WordPress this is an AJAX request.
|
179 |
+
define( 'DOING_AJAX', true );
|
180 |
+
|
181 |
+
// Call the method.
|
182 |
+
$result = call_user_func_array( $action['method'], $args );
|
183 |
+
|
184 |
+
// JSON encode the result.
|
185 |
+
echo json_encode( $result );
|
186 |
+
|
187 |
+
// Complete the request.
|
188 |
+
die();
|
189 |
+
}
|
190 |
+
}
|
classes/class-fl-builder-auto-suggest.php
CHANGED
@@ -12,7 +12,7 @@ final class FLBuilderAutoSuggest {
|
|
12 |
* the data will be echoed as a JSON response.
|
13 |
*
|
14 |
* @since 1.2.3
|
15 |
-
* @return
|
16 |
*/
|
17 |
static public function init()
|
18 |
{
|
@@ -38,8 +38,7 @@ final class FLBuilderAutoSuggest {
|
|
38 |
}
|
39 |
|
40 |
if(isset($data)) {
|
41 |
-
|
42 |
-
die();
|
43 |
}
|
44 |
}
|
45 |
}
|
12 |
* the data will be echoed as a JSON response.
|
13 |
*
|
14 |
* @since 1.2.3
|
15 |
+
* @return array
|
16 |
*/
|
17 |
static public function init()
|
18 |
{
|
38 |
}
|
39 |
|
40 |
if(isset($data)) {
|
41 |
+
return $data;
|
|
|
42 |
}
|
43 |
}
|
44 |
}
|
classes/class-fl-builder-fonts.php
CHANGED
@@ -95,6 +95,7 @@ final class FLBuilderFonts {
|
|
95 |
|
96 |
$weight_string = array(
|
97 |
'default' => __( 'Default', 'fl-builder' ),
|
|
|
98 |
'100' => 'Thin 100',
|
99 |
'200' => 'Extra-Light 200',
|
100 |
'300' => 'Light 300',
|
@@ -280,2382 +281,2642 @@ final class FLBuilderFontFamilies {
|
|
280 |
* @var array
|
281 |
*/
|
282 |
static public $google = array(
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
|
930 |
-
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
-
|
938 |
-
|
939 |
-
|
940 |
-
|
941 |
-
|
942 |
-
|
943 |
-
|
944 |
-
|
945 |
-
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
-
|
966 |
-
|
967 |
-
|
968 |
-
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
|
973 |
-
|
974 |
-
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
-
|
980 |
-
|
981 |
-
|
982 |
-
|
983 |
-
|
984 |
-
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
|
990 |
-
|
991 |
-
|
992 |
-
|
993 |
-
|
994 |
-
|
995 |
-
|
996 |
-
|
997 |
-
|
998 |
-
|
999 |
-
|
1000 |
-
|
1001 |
-
|
1002 |
-
|
1003 |
-
|
1004 |
-
|
1005 |
-
|
1006 |
-
|
1007 |
-
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
1011 |
-
|
1012 |
-
|
1013 |
-
|
1014 |
-
|
1015 |
-
|
1016 |
-
|
1017 |
-
|
1018 |
-
|
1019 |
-
|
1020 |
-
|
1021 |
-
|
1022 |
-
|
1023 |
-
|
1024 |
-
|
1025 |
-
|
1026 |
-
|
1027 |
-
|
1028 |
-
|
1029 |
-
|
1030 |
-
|
1031 |
-
|
1032 |
-
|
1033 |
-
|
1034 |
-
|
1035 |
-
|
1036 |
-
|
1037 |
-
|
1038 |
-
|
1039 |
-
|
1040 |
-
|
1041 |
-
|
1042 |
-
|
1043 |
-
|
1044 |
-
|
1045 |
-
|
1046 |
-
|
1047 |
-
|
1048 |
-
|
1049 |
-
|
1050 |
-
|
1051 |
-
|
1052 |
-
|
1053 |
-
|
1054 |
-
|
1055 |
-
|
1056 |
-
|
1057 |
-
|
1058 |
-
|
1059 |
-
|
1060 |
-
|
1061 |
-
|
1062 |
-
|
1063 |
-
|
1064 |
-
|
1065 |
-
|
1066 |
-
|
1067 |
-
|
1068 |
-
|
1069 |
-
|
1070 |
-
|
1071 |
-
|
1072 |
-
|
1073 |
-
|
1074 |
-
|
1075 |
-
|
1076 |
-
|
1077 |
-
|
1078 |
-
|
1079 |
-
|
1080 |
-
|
1081 |
-
|
1082 |
-
|
1083 |
-
|
1084 |
-
|
1085 |
-
|
1086 |
-
|
1087 |
-
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
1091 |
-
|
1092 |
-
|
1093 |
-
|
1094 |
-
|
1095 |
-
|
1096 |
-
|
1097 |
-
|
1098 |
-
|
1099 |
-
|
1100 |
-
|
1101 |
-
|
1102 |
-
|
1103 |
-
|
1104 |
-
|
1105 |
-
|
1106 |
-
|
1107 |
-
|
1108 |
-
|
1109 |
-
|
1110 |
-
|
1111 |
-
|
1112 |
-
|
1113 |
-
|
1114 |
-
|
1115 |
-
|
1116 |
-
|
1117 |
-
|
1118 |
-
|
1119 |
-
|
1120 |
-
|
1121 |
-
|
1122 |
-
|
1123 |
-
|
1124 |
-
|
1125 |
-
|
1126 |
-
|
1127 |
-
|
1128 |
-
|
1129 |
-
|
1130 |
-
|
1131 |
-
|
1132 |
-
|
1133 |
-
|
1134 |
-
|
1135 |
-
|
1136 |
-
|
1137 |
-
|
1138 |
-
|
1139 |
-
|
1140 |
-
|
1141 |
-
|
1142 |
-
|
1143 |
-
|
1144 |
-
|
1145 |
-
|
1146 |
-
|
1147 |
-
|
1148 |
-
|
1149 |
-
|
1150 |
-
|
1151 |
-
|
1152 |
-
|
1153 |
-
|
1154 |
-
|
1155 |
-
|
1156 |
-
|
1157 |
-
|
1158 |
-
|
1159 |
-
|
1160 |
-
|
1161 |
-
|
1162 |
-
|
1163 |
-
|
1164 |
-
|
1165 |
-
|
1166 |
-
|
1167 |
-
|
1168 |
-
|
1169 |
-
|
1170 |
-
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
1178 |
-
|
1179 |
-
|
1180 |
-
|
1181 |
-
|
1182 |
-
|
1183 |
-
|
1184 |
-
|
1185 |
-
|
1186 |
-
|
1187 |
-
|
1188 |
-
|
1189 |
-
|
1190 |
-
|
1191 |
-
|
1192 |
-
|
1193 |
-
|
1194 |
-
|
1195 |
-
|
1196 |
-
|
1197 |
-
|
1198 |
-
|
1199 |
-
|
1200 |
-
|
1201 |
-
|
1202 |
-
|
1203 |
-
|
1204 |
-
|
1205 |
-
|
1206 |
-
|
1207 |
-
|
1208 |
-
|
1209 |
-
|
1210 |
-
|
1211 |
-
|
1212 |
-
|
1213 |
-
|
1214 |
-
|
1215 |
-
|
1216 |
-
|
1217 |
-
|
1218 |
-
|
1219 |
-
|
1220 |
-
|
1221 |
-
|
1222 |
-
|
1223 |
-
|
1224 |
-
|
1225 |
-
|
1226 |
-
|
1227 |
-
|
1228 |
-
|
1229 |
-
|
1230 |
-
|
1231 |
-
|
1232 |
-
|
1233 |
-
|
1234 |
-
|
1235 |
-
|
1236 |
-
|
1237 |
-
|
1238 |
-
|
1239 |
-
|
1240 |
-
|
1241 |
-
|
1242 |
-
|
1243 |
-
|
1244 |
-
|
1245 |
-
|
1246 |
-
|
1247 |
-
|
1248 |
-
|
1249 |
-
|
1250 |
-
|
1251 |
-
|
1252 |
-
|
1253 |
-
|
1254 |
-
|
1255 |
-
|
1256 |
-
|
1257 |
-
|
1258 |
-
|
1259 |
-
|
1260 |
-
|
1261 |
-
|
1262 |
-
|
1263 |
-
|
1264 |
-
|
1265 |
-
|
1266 |
-
|
1267 |
-
|
1268 |
-
|
1269 |
-
|
1270 |
-
|
1271 |
-
|
1272 |
-
|
1273 |
-
|
1274 |
-
|
1275 |
-
|
1276 |
-
|
1277 |
-
|
1278 |
-
|
1279 |
-
|
1280 |
-
|
1281 |
-
|
1282 |
-
|
1283 |
-
|
1284 |
-
|
1285 |
-
|
1286 |
-
|
1287 |
-
|
1288 |
-
|
1289 |
-
|
1290 |
-
|
1291 |
-
|
1292 |
-
|
1293 |
-
|
1294 |
-
|
1295 |
-
|
1296 |
-
|
1297 |
-
|
1298 |
-
|
1299 |
-
|
1300 |
-
|
1301 |
-
|
1302 |
-
|
1303 |
-
|
1304 |
-
|
1305 |
-
|
1306 |
-
|
1307 |
-
|
1308 |
-
|
1309 |
-
|
1310 |
-
|
1311 |
-
|
1312 |
-
|
1313 |
-
|
1314 |
-
|
1315 |
-
|
1316 |
-
|
1317 |
-
|
1318 |
-
|
1319 |
-
|
1320 |
-
|
1321 |
-
|
1322 |
-
|
1323 |
-
|
1324 |
-
|
1325 |
-
|
1326 |
-
|
1327 |
-
|
1328 |
-
|
1329 |
-
|
1330 |
-
|
1331 |
-
|
1332 |
-
|
1333 |
-
|
1334 |
-
|
1335 |
-
|
1336 |
-
|
1337 |
-
|
1338 |
-
|
1339 |
-
|
1340 |
-
|
1341 |
-
|
1342 |
-
|
1343 |
-
|
1344 |
-
|
1345 |
-
|
1346 |
-
|
1347 |
-
|
1348 |
-
|
1349 |
-
|
1350 |
-
|
1351 |
-
|
1352 |
-
|
1353 |
-
|
1354 |
-
|
1355 |
-
|
1356 |
-
|
1357 |
-
|
1358 |
-
|
1359 |
-
|
1360 |
-
|
1361 |
-
|
1362 |
-
|
1363 |
-
|
1364 |
-
|
1365 |
-
|
1366 |
-
|
1367 |
-
|
1368 |
-
|
1369 |
-
|
1370 |
-
|
1371 |
-
|
1372 |
-
|
1373 |
-
|
1374 |
-
|
1375 |
-
|
1376 |
-
|
1377 |
-
|
1378 |
-
|
1379 |
-
|
1380 |
-
|
1381 |
-
|
1382 |
-
|
1383 |
-
|
1384 |
-
|
1385 |
-
|
1386 |
-
|
1387 |
-
|
1388 |
-
|
1389 |
-
|
1390 |
-
|
1391 |
-
|
1392 |
-
|
1393 |
-
|
1394 |
-
|
1395 |
-
|
1396 |
-
|
1397 |
-
|
1398 |
-
|
1399 |
-
|
1400 |
-
|
1401 |
-
|
1402 |
-
|
1403 |
-
|
1404 |
-
|
1405 |
-
|
1406 |
-
|
1407 |
-
|
1408 |
-
|
1409 |
-
|
1410 |
-
|
1411 |
-
|
1412 |
-
|
1413 |
-
|
1414 |
-
|
1415 |
-
|
1416 |
-
|
1417 |
-
|
1418 |
-
|
1419 |
-
|
1420 |
-
|
1421 |
-
|
1422 |
-
|
1423 |
-
|
1424 |
-
|