WordPress Page Builder – Beaver Builder - Version 2.1.1.2

Version Description

Download this release

Release Info

Developer pross
Plugin Icon 128x128 WordPress Page Builder – Beaver Builder
Version 2.1.1.2
Comparing to
See all releases

Code changes from version 2.0.6.4 to 2.1.1.2

Files changed (107) hide show
  1. changelog.txt +370 -173
  2. classes/class-fl-builder-admin-pointers.php +94 -0
  3. classes/class-fl-builder-admin-posts.php +28 -5
  4. classes/class-fl-builder-admin-settings.php +10 -4
  5. classes/class-fl-builder-ajax-layout.php +47 -13
  6. classes/class-fl-builder-ajax.php +1 -0
  7. classes/class-fl-builder-debug.php +37 -4
  8. classes/class-fl-builder-filesystem.php +14 -3
  9. classes/class-fl-builder-fonts.php +4 -4
  10. classes/class-fl-builder-icons.php +48 -9
  11. classes/class-fl-builder-iframe-preview.php +12 -2
  12. classes/class-fl-builder-importer.php +2 -2
  13. classes/class-fl-builder-loader.php +14 -4
  14. classes/class-fl-builder-loop.php +25 -11
  15. classes/class-fl-builder-model.php +304 -52
  16. classes/class-fl-builder-notifications.php +174 -0
  17. classes/class-fl-builder-service-activecampaign.php +2 -3
  18. classes/class-fl-builder-service-aweber.php +2 -3
  19. classes/class-fl-builder-service-campaign-monitor.php +1 -2
  20. classes/class-fl-builder-service-campayn.php +2 -3
  21. classes/class-fl-builder-service-constant-contact.php +3 -5
  22. classes/class-fl-builder-service-convertkit.php +1 -2
  23. classes/class-fl-builder-service-drip.php +2 -3
  24. classes/class-fl-builder-service-email-address.php +1 -2
  25. classes/class-fl-builder-service-enormail.php +2 -4
  26. classes/class-fl-builder-service-getresponse.php +23 -10
  27. classes/class-fl-builder-service-godaddy-email-marketing.php +1 -2
  28. classes/class-fl-builder-service-hatchbuck.php +4 -6
  29. classes/class-fl-builder-service-icontact-pro.php +2 -3
  30. classes/class-fl-builder-service-icontact.php +2 -3
  31. classes/class-fl-builder-service-infusionsoft.php +3 -4
  32. classes/class-fl-builder-service-madmimi.php +1 -2
  33. classes/class-fl-builder-service-mailchimp.php +82 -89
  34. classes/class-fl-builder-service-mailerlite.php +5 -6
  35. classes/class-fl-builder-service-mailpoet.php +2 -2
  36. classes/class-fl-builder-service-mailrelay.php +1 -2
  37. classes/class-fl-builder-service-mautic.php +2 -2
  38. classes/class-fl-builder-service-sendinblue.php +1 -2
  39. classes/class-fl-builder-service-sendy.php +1 -2
  40. classes/class-fl-builder-services.php +2 -4
  41. classes/class-fl-builder-shortcodes.php +6 -0
  42. classes/class-fl-builder-ui-content-panel.php +32 -3
  43. classes/class-fl-builder-ui-settings-forms.php +145 -10
  44. classes/class-fl-builder-update.php +8 -4
  45. classes/class-fl-builder-usage.php +455 -0
  46. classes/class-fl-builder-user-access.php +19 -7
  47. classes/class-fl-builder-utils.php +34 -0
  48. classes/class-fl-builder-wp-blocks-layout.php +167 -0
  49. classes/class-fl-builder-wp-blocks.php +96 -0
  50. classes/class-fl-builder-wpcli-command.php +56 -2
  51. classes/class-fl-builder.php +169 -84
  52. classes/class-fl-jsmin.php +4 -4
  53. css/build/builder.bundle.css +162 -0
  54. css/build/builder.bundle.min.css +1 -0
  55. css/build/wp-editor.bundle.css +24 -0
  56. css/build/wp-editor.bundle.min.css +1 -0
  57. css/fl-builder-admin-posts.css +6 -5
  58. css/fl-builder-admin-settings.css +3 -3
  59. css/fl-builder-admin-usage.css +27 -0
  60. css/fl-builder-layout-responsive.css +25 -24
  61. css/fl-builder-layout.css +3 -0
  62. css/fl-builder.css +58 -10
  63. css/fl-builder.min.css +1 -1
  64. css/fl-icon-selector.css +2 -2
  65. fl-builder.php +1 -1
  66. img/screenshot-getting-started.jpg +0 -0
  67. img/screenshot-getting-started.png +0 -0
  68. img/svg/bell-active.svg +6 -0
  69. img/svg/bell.svg +5 -0
  70. includes/admin-posts.php +6 -0
  71. includes/admin-settings-tools.php +29 -1
  72. includes/admin-settings-welcome.php +8 -9
  73. includes/column-css.php +2 -2
  74. includes/compatibility.php +106 -4
  75. includes/export.php +4 -5
  76. includes/row-css.php +1 -1
  77. includes/row-video.php +5 -0
  78. includes/ui-extras.php +2 -0
  79. includes/ui-field-ordering.php +1 -1
  80. includes/ui-field-video.php +3 -0
  81. includes/ui-field.php +1 -1
  82. includes/ui-js-config.php +189 -177
  83. includes/ui-js-templates.php +48 -29
  84. includes/ui-legacy-custom-field.php +2 -2
  85. includes/ui-loop-settings.php +11 -0
  86. includes/ui-settings-config.php +4 -1
  87. includes/ui-settings-form-row.php +3 -3
  88. includes/updater-config.php +1 -1
  89. includes/updater/classes/class-fl-updater.php +34 -20
  90. includes/vendor/getresponse/getresponse.php +400 -570
  91. includes/vendor/mailchimp/Mailchimp/Campaigns.php +0 -378
  92. includes/vendor/mailchimp/Mailchimp/Conversations.php +0 -80
  93. includes/vendor/mailchimp/Mailchimp/Ecomm.php +0 -86
  94. includes/vendor/mailchimp/Mailchimp/Exceptions.php +0 -471
  95. includes/vendor/mailchimp/Mailchimp/Folders.php +0 -62
  96. includes/vendor/mailchimp/Mailchimp/Gallery.php +0 -106
  97. includes/vendor/mailchimp/Mailchimp/Goal.php +0 -49
  98. includes/vendor/mailchimp/Mailchimp/Helper.php +0 -237
  99. includes/vendor/mailchimp/Mailchimp/Lists.php +0 -904
  100. includes/vendor/mailchimp/Mailchimp/Mobile.php +0 -10
  101. includes/vendor/mailchimp/Mailchimp/Neapolitan.php +0 -10
  102. includes/vendor/mailchimp/Mailchimp/Reports.php +0 -459
  103. includes/vendor/mailchimp/Mailchimp/Templates.php +0 -114
  104. includes/vendor/mailchimp/Mailchimp/Users.php +0 -105
  105. includes/vendor/mailchimp/Mailchimp/Vip.php +0 -111
  106. includes/vendor/mailchimp/mailchimp.php +528 -221
  107. js/build/builder.bundle.js +5216 -0
changelog.txt CHANGED
@@ -1,7 +1,203 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <h4>2.0.6.4 - 03/27/2018</h4>
2
  <p><strong>Enhancements</strong></p>
3
  <ul>
4
- <li>Added optional Terms and Conditions to Contact and Subcribe Modules to comply with GDPR.</li>
5
  </ul>
6
  <p><strong>Bug Fixes</strong></p>
7
  <ul>
@@ -21,6 +217,7 @@
21
  <li>Fixed links not being clickable in modules that use bxslider with Firefox 59.</li>
22
  <li>Fixed incorrect links in Social Buttons Module when added in Themer.</li>
23
  <li>Added <code>$id</code> and <code>$type</code> to <code>fl_builder_render_module_css_settings</code> filter variables.</li>
 
24
  </ul>
25
 
26
  <h4>2.0.6.2 - 03/13/2018</h4>
@@ -232,179 +429,179 @@
232
  <li>Fixed GeneratePress Premium plugin Blog option overrules the Post modules excerpt setting.</li>
233
  </ul>
234
 
235
- <h4>2.0.2.2 - 12/06/2017</h4>
236
  <p>Beaver Builder 2.0 is now available for remote update!</p>
237
 
238
- <h4>2.0.2.1 - 11/27/2017</h4>
239
- <p><strong>Bug Fixes</strong></p>
240
- <ul>
241
- <li>Fixed responsive editing mode not working correctly.</li>
242
- <li>Fixed white labeling not working correctly on the updates page.</li>
243
  </ul>
244
 
245
  <h4>2.0.2 - 11/16/2017</h4>
246
- <p><strong>Enhancements</strong></p>
247
- <ul>
248
- <li>Added <code>fl_builder_cache_cleared</code> action.</li>
249
- </ul>
250
- <p><strong>Bug Fixes</strong></p>
251
- <ul>
252
- <li>Fixed settings config not loading when query strings are removed from script URLs.</li>
253
- <li>Fixed widgets not showing when site language is not in English.</li>
254
- <li>Fixed error when using namespaced widgets.</li>
255
- <li>Fixed JS errors in IE.</li>
256
- <li>Fixed keyboard shortcut formatting in IE.</li>
257
- <li>Fixed capitalization issues with translations.</li>
258
- <li>Fixed character encoding issues with strtolower.</li>
259
- </ul>
260
-
261
- <h4>2.0.1.1 - 11/07/2017</h4>
262
- <p><strong>Bug Fixes</strong></p>
263
- <ul>
264
- <li>Hotfix for a change in 2.0.1 that broke loading of the settings for the Subscribe Form module.</li>
265
- </ul>
266
-
267
- <h4>2.0.1 - 11/06/2017</h4>
268
- <p><strong>Bug Fixes</strong></p>
269
- <ul>
270
- <li>Fixed errors caused by settings config not completely loading on certain server setups.</li>
271
- <li>Fixed PHP warnings when attachment meta doesn't have a width or height set.</li>
272
- </ul>
273
-
274
- <h4>2.0 - 11/01/2017</h4>
275
  <p><strong>Beaver Builder 2.0 is here!</strong></p>
276
  <p>Please note that 2.0 is currently only available from your My Account page or via remote update if you already have 2.0 installed. We'll be releasing remote updates for older versions of Beaver Builder within the next few weeks.</p>
277
 
278
- <h4>2.0-beta.3 - 10/31/2017</h4>
279
- <p><strong>Enhancements</strong></p>
280
- <ul>
281
- <li>Updated the help video for 2.0.</li>
282
- <li>Added fl_row_resize_settings filter.</li>
283
- </ul>
284
- <p><strong>Bug Fixes</strong></p>
285
- <ul>
286
- <li>Fixed various UI styling issues.</li>
287
- <li>Fixed editing global rows not working properly.</li>
288
- <li>Fixed template override settings not working on multisite.</li>
289
- <li>Fixed repeater fields in nested forms not working.</li>
290
- <li>Fixed stylesheets in the body tag not being parsed for responsive preview.</li>
291
- <li>Fixed content panel showing during preview or unpinning during preview when not expected.</li>
292
- <li>Fixed anchor links in the layout causing the builder to launch again after publish.</li>
293
- </ul>
294
-
295
- <h4>2.0-beta.2 - 10/12/2017</h4>
296
- <p><strong>Enhancements</strong></p>
297
- <ul>
298
- <li>Publish button now says 'Submit for Review' if a user doesn't have permission to publish.</li>
299
- <li>Pinned settings are now responsive for smaller devices.</li>
300
- <li>Moved WordPress widgets into their own group.</li>
301
- <li>Moved Themer modules into their own group (coming in Themer 1.0.3).</li>
302
- </ul>
303
- <p><strong>Bug Fixes</strong></p>
304
- <ul>
305
- <li>Fixed row actions being covered by modules when the row has no padding.</li>
306
- <li>Fixed values in text inputs not being escaped which breaks the markup.</li>
307
- <li>Fixed settings being dragged or resized so you can't access the drag handle anymore.</li>
308
- <li>Fixed browser zoom triggering the action overflow menu when it shouldn't.</li>
309
- <li>Fixed multiple issues with saving new templates.</li>
310
- <li>Fixed styling issues with dark mode.</li>
311
- <li>Fixed module aliases not showing in the content panel.</li>
312
- <li>Fixed widgets not showing in the content panel.</li>
313
- </ul>
314
-
315
- <h4>2.0-beta.1 - 10/04/2017</h4>
316
- <p><strong>Enhancements</strong></p>
317
- <ul>
318
- <li>Added keyboard shortcut UI to the builder menu.</li>
319
- <li>Reworked keyboard shortcut system to support displaying shortcuts with labels and modifier key symbols.</li>
320
- </ul>
321
- <p><strong>Bug Fixes</strong></p>
322
- <ul>
323
- <li>Fixed various styling issues.</li>
324
- <li>Fixed photo and video fields that aren't in node settings not showing saved data when opened again after the page is refreshed.</li>
325
- <li>Fixed error when saving a template with no category set.</li>
326
- <li>Fixed saved values for medium and responsive in dimension fields not showing when going back to edit a node.</li>
327
- <li>Fixed module templates not showing in the content panel.</li>
328
- <li>Fixed issue with module hover in the content panel being covered by siblings.</li>
329
- <li>Fixed a major issue with secondary loops triggering the builder's content filter when they shouldn't. This caused a number of issues including an infinite loop in Themer and the incorrect posts being displayed on standard builder pages.</li>
330
- <li>Fixed FLBuilder::render_query so it doesn't have to override $wp_query which was causing incorrect connection data for Themer layouts.</li>
331
- </ul>
332
-
333
- <h4>2.0-alpha.7 - 09/21/2017</h4>
334
- <p><strong>Enhancements</strong></p>
335
- <ul>
336
- <li>Added the ability to match posts in the loop settings by related taxonomy terms.</li>
337
- </ul>
338
- <p><strong>Bug Fixes</strong></p>
339
- <ul>
340
- <li>Fixed page scrolling breaking when opening the main menu.</li>
341
- <li>Fixed field connections not rendering in nested settings forms.</li>
342
- </ul>
343
-
344
- <h4>2.0-alpha.6.1 - 09/19/2017</h4>
345
- <p><strong>Bug Fixes</strong></p>
346
- <ul>
347
- <li>Fixed a bug with the option labels in select option groups not showing.</li>
348
- </ul>
349
-
350
- <h4>2.0-alpha.6 - 09/19/2017</h4>
351
- <p><strong>Bug Fixes</strong></p>
352
- <ul>
353
- <li>Fixed a bug breaking the Pods integration.</li>
354
- <li>Fixed an issue causing the builder UI to break on SiteGround servers.</li>
355
- </ul>
356
-
357
- <h4>2.0-alpha.5 - 09/06/2017</h4>
358
- <p><strong>Enhancements</strong></p>
359
- <ul>
360
- <li>Settings panel tabs no longer become a drop-down menu when slim. Tabs that cannot fit into the available space are pushed into a menu.</li>
361
- <li>You can now move between settings tabs with the keyboard shortcuts "CMD + Left Arrow" or "CMD + Right Arrow" (CTRL on Windows).</li>
362
- <li>You can now reset row or column widths from the module overlay.</li>
363
- <li>"CMD + i" (CTRL on Windows) shortcut will take you directly to module search.</li>
364
- <li>Module search is now case-insensitive.</li>
365
- <li>Duplicated items that appear off screen will now scroll into view.</li>
366
- </ul>
367
- <p><strong>Bug Fixes</strong></p>
368
- <ul>
369
- <li>Fixed scrolling not working when hovering over the content panel and then back into the layout.</li>
370
- <li>Hovering over the content panel should no longer cause screen jitter in Windows browsers.</li>
371
- <li>Icon selector search/filter has been restored.</li>
372
- <li>J, K, L, and ; keys now show content panel tabs even when the panel has been collapsed.</li>
373
- <li>Dropping a row template into the layout immediately loads fonts.</li>
374
- <li>Overriding core templates now works again when applying a template.<li>
375
- <li>Fixed ACE editor resize causing incorrect cursor position.</li>
376
- <li>Fixed multiple issues with pinning in Safari and Firefox.</li>
377
- </ul>
378
-
379
- <h4>2.0-alpha.4 - 08/29/2017</h4>
380
- <ul>
381
- <li>A new slimmer version of the settings panels now opens when clicking to edit content.</li>
382
- <li>Settings panels can now be resized to any size that you desire.</li>
383
- <li>We'll remember the size and position you set for the settings panels even after reloading the page.</li>
384
- <li>The content panel and settings can now be pinned together on either the left or right side of the screen. You can resize the pinned sidebar when you need a little more room.</li>
385
- <li>You can now work with the toolbar or in the layout even when settings are open.</li>
386
- <li>If settings are open and you take action anywhere else in the builder, we'll save and close them for you. This means you can edit one module and click to edit another without ever needing to click save in between.</li>
387
- <li>Module search has been moved into the modules tab for more intuitive access.</li>
388
- </ul>
389
-
390
- <h4>2.0-alpha.3 - 08/07/2017</h4>
391
- <ul>
392
- <li>Settings forms now load instantly! We've completely rewritten the settings forms in JavaScript so they dont need to be loaded from the server anymore. The only time something needs to load is if youre using a third party add-on that introduces legacy PHP fields. Well have docs on the new JavaScript settings APIs when 2.0 is released and hope that all major add-on authors will convert their fields to JavaScript so everything loads instantly! :)</li>
393
- <li>Added an initial set of core row templates.</li>
394
- <li>Various bug fixes and style tweaks.</li>
395
- </ul>
396
-
397
- <h4>2.0-alpha.2 - 07/24/2017</h4>
398
- <ul>
399
- <li>Added the ability to duplicate columns.</li>
400
- <li>Increased contrast to light and dark UI modes.</li>
401
- <li>Added module icons.</li>
402
- <li>Restyled content group selector.</li>
403
- <li>Reworked how group labels are displayed in search results.</li>
404
- <li>Style hardening for GeneratePress theme.</li>
405
- <li>Publishing out of the builder now moves the history state and updates the url. Re-entering will move back.</li>
406
- </ul>
407
-
408
  <h4>1.11.1 11/29/17</h4>
409
  <p><strong>Hot Fix</strong></p>
410
  <ul>
@@ -596,8 +793,8 @@
596
  </ul>
597
  <p><strong>Bug Fixes</strong></p>
598
  <ul>
599
- <li>Removed the new core media widgets from the builder since they dont work in the builder and we have modules that do the same thing.</li>
600
- <li>Fixed the core text widget form in the builder so the legacy form loads since the new form in 4.8 doesnt. The text widget is also removed from the module list in favor of the Text Editor and HTML modules. Sites previously using the text widget will still render and they can still be edited, they just wont be able to add new text widgets.</li>
601
  <li>Fixed Slideshow module not showing in the Tabs module.</li>
602
  <li>Fixed JS error in Row > Background > Slideshow on touch-enabled devices.</li>
603
  <li>Increased the video ratio to 16:9 to fix the top/bottom black border on responsive layout.</li>
@@ -747,15 +944,15 @@
747
  </ul>
748
  <p><strong>Post Module Enhancements</strong></p>
749
  <ul>
750
- <li>Added columns layout to the layout setting.</li>
751
  <li>Added more layout and styling settings.</li>
752
- <li>The no results message is now shown when no posts are found.</li>
753
  <li>Added a setting to show a search form if no posts are found.</li>
754
  <li>Added the ability to exclude posts in the content filter for the query.</li>
755
  </ul>
756
  <p><strong>Menu Module Enhancements</strong></p>
757
  <ul>
758
- <li>Added below row" option for mobile menu position.</li>
759
  <li>Added font family setting.</li>
760
  <li>Misc CSS improvements.</li>
761
  </ul>
@@ -799,7 +996,7 @@
799
  <h4>1.9.5.1 - 3/21/2017</h4>
800
  <p><strong>Bug Fixes</strong></p>
801
  <ul>
802
- <li>Rolled back change in 1.9.5 that fixed some photos not going full width on mobile. That was causing all photos to go full width on mobile even when not intended. Well revisit that fix in 1.10.</li>
803
  </ul>
804
 
805
  <h4>1.9.5 - 3/20/2017</h4>
@@ -2535,5 +2732,5 @@
2535
  <h4>0.8.2</h4>
2536
  <p>Responsive module margins now only reset if negative or greater than the default.</p>
2537
 
2538
- <h4>0.8.1</h4>
2539
  <p>Initial beta release.</p>
1
+ <h4>2.1.1.2 - 05/07/2018</h4>
2
+ <p><strong>Enhancements</strong></p>
3
+ <ul>
4
+ <li>Added <code>fl_code_checking_enabled</code> filter to disable all code checking.</li>
5
+ <li>Added <code>fl_builder_get_layout_metadata</code> filter for filtering layout data when it comes out of the database.</li>
6
+ <li>Disabled notifications in restricted editing mode.</li>
7
+ <li>Updated Font Awesome to 5.0.12.</li>
8
+ </ul>
9
+ <p><strong>Bug Fixes</strong></p>
10
+ <ul>
11
+ <li>Fixed characters being encoded in text inputs when using inline editing.</li>
12
+ <li>Fixed invalid code errors preventing saving of code fields.</li>
13
+ <li>Fixed a fatal error with corrupted global rows.</li>
14
+ </ul>
15
+
16
+ <h4>2.1.1.1 - 05/02/2018</h4>
17
+ <p><strong>Enhancements</strong></p>
18
+ <ul>
19
+ <li>Font Awesome PRO support added! See <code>https://kb.wpbeaverbuilder.com/article/645-font-awesome-5-icons</code> for instructions.</li>
20
+ </ul>
21
+
22
+ <h4>2.1.1 - 05/02/2018</h4>
23
+ <p><strong>Enhancements</strong></p>
24
+ <ul>
25
+ <li>New filter <code>fl_inline_editing_enabled</code> to disable inline editing.</li>
26
+ <li>Removed obsolete Event Espresso code now covered by their official addon found at <code>https://github.com/eventespresso/eea-beaver-builder</code></li>
27
+ </ul>
28
+ <p><strong>Bug Fixes</strong></p>
29
+ <ul>
30
+ <li>Fixed JS error when canceling out of a settings form during responsive preview.</li>
31
+ <li>Fixed various icon issues and added a compatibility function to make sure css files are loaded in right order.</li>
32
+ </ul>
33
+
34
+ <h4>2.1.0.2 - 04/27/2018</h4>
35
+ <p><strong>Hot Fix</strong></p>
36
+ <ul>
37
+ <li>Fixed more compression issues with loading the settings JS.</li>
38
+ <li>Fixed a branding issue with Agency package, you can now use 'Page Builder' again.</li>
39
+ <li>Fixed issue with YouTube row backgrounds not looping.</li>
40
+ </ul>
41
+ <h4>2.1.0.1 - 04/26/2018</h4>
42
+ <p><strong>Hot Fix</strong></p>
43
+ <ul>
44
+ <li>Fixed compression issues with loading the settings JS.</li>
45
+ <li>Fixed CSS/JS assets returning a 404 after the builder has launched.</li>
46
+ <li>Fixed the button module not accepting 0 for style settings.</li>
47
+ <li>Fixed translation issues.</li>
48
+ <li>Fixed Font Awesome not loading for some modules.</li>
49
+ </ul>
50
+
51
+ <h4>2.1 - 04/25/2018</h4>
52
+ <p>Beaver Builder 2.1 "Redridge" is here! Check out the <a href="https://www.wpbeaverbuilder.com/beaver-builder-2-1-redridge/">blog post</a> for more info.</p>
53
+ <p><strong>Enhancements</strong></p>
54
+ <ul>
55
+ <li>You can now pin the settings panel in restricted editing mode and when editing module templates.</li>
56
+ <li>Changed default button settings so they can be customized via the Customizer in the next theme update.</li>
57
+ <li>Added featured image support for templates in all versions.</li>
58
+ <li>Update translations.</li>
59
+ </ul>
60
+ <p><strong>Bug Fixes</strong></p>
61
+ <ul>
62
+ <li>Fixed caching issues with the iframe layout preview.</li>
63
+ </ul>
64
+
65
+ <h4>2.1-beta.4 - 04/20/2018</h4>
66
+ <p><strong>Enhancements</strong></p>
67
+ <ul>
68
+ <li>Update UI icons to use Font Awesome 5</li>
69
+ <li>New filter <code>fl_disable_notifications</code> added to disable notifications.</li>
70
+ <li>Debug info will now show htaccess content.</li>
71
+ <li>Waypoints offset added to js config.</li>
72
+ </ul>
73
+ <p><strong>Bug Fixes</strong></p>
74
+ <ul>
75
+ <li>Fixed fatal errors in GetResonse and Mailerlite api.</li>
76
+ <li>Fixed background YouTube and Vimeo videos not using fallback image.</li>
77
+ <li>Fixed AJAX shortcode issue with Ninjaforms.</li>
78
+ <li>Fixed percent not working for the preview unit.</li>
79
+ <li>Fixed contact form field connections not working when sending email because connections aren't connected when wp_ajax runs.</li>
80
+ </ul>
81
+
82
+ <h4>2.1-beta.3 - 04/06/2018</h4>
83
+ <p><strong>Bug Fixes</strong></p>
84
+ <ul>
85
+ <li>Fixed broken links on the plugins page.</li>
86
+ </ul>
87
+
88
+ <h4>2.1-beta.2 - 04/05/2018</h4>
89
+ <p><strong>Bug Fixes</strong></p>
90
+ <ul>
91
+ <li>Fixed white labeling issues.</li>
92
+ <li>Fixed usage stats admin message redirecting to the dashboard.</li>
93
+ <li>Fixed WPML translations not linking when creating new templates in wp-admin.</li>
94
+ <li>Fixed WPML issue with the builder launching for the default language instead of the current translation.</li>
95
+ </ul>
96
+
97
+ <h4>2.1-beta.1 - 04/04/2018</h4>
98
+ <p><strong>Enhancements</strong></p>
99
+ <ul>
100
+ <li>Added support for enabling Font Awesome 5 in the icon settings. Note: you can't have 4 and 5 active at the same time as they are not compatible with each other.</li>
101
+ <li>Added underline to the inline editing formatting tools.</li>
102
+ <li>Added setting to exclude the current post in the posts module.</li>
103
+ <li>Add support for rendering layout CSS and JS inline on the page instead of enqueuing using the <code>fl_builder_render_assets_inline</code> filter.</li>
104
+ </ul>
105
+ <p><strong>Bug Fixes</strong></p>
106
+ <ul>
107
+ <li>Fixed multiple issues with inline editing.</li>
108
+ <li>Fixed usage stats opt-in not working on multisite.</li>
109
+ <li>Fixed JS settings config not fully loading on some servers with response size limits.</li>
110
+ </ul>
111
+
112
+ <h4>2.1-alpha.6 - 03/13/2018</h4>
113
+ <p><strong>Enhancements</strong></p>
114
+ <ul>
115
+ <li>Added the ability to save standard and global column templates.</li>
116
+ </ul>
117
+
118
+ <h4>2.1-alpha.5 - 03/07/2018</h4>
119
+ <ul>
120
+ <li>Reworked Beaver Builder for Gutenberg block to support API changes in Gutenberg 2.3.0.</li>
121
+ <li>Updated wording in warning when switching from Beaver Builder to Gutenberg.</li>
122
+ <li>Fixed inline editing not working in Safari.</li>
123
+ </ul>
124
+
125
+ <h4>2.1-alpha.4 - 02/22/2018</h4>
126
+ <p><strong>Enhancements</strong></p>
127
+ <ul>
128
+ <li>Add title tags when present to images in various modules.</li>
129
+ <li>Added the option to show category meta to Posts module.</li>
130
+ <li>Added improved RTL support to the Posts module.</li>
131
+ <li>Added YouTube video background support for start position and looping parameters.</li>
132
+ <li>Added video field parameter for enabling the remove button.</li>
133
+ <li>Added mobile background color option to all layouts in the Menu module.</li>
134
+ <li>Added option to disable autoplay on hover to the Content Slider module.</li>
135
+ <li>Added default change callback to trigger preview refresh on fields that don't have a preview defined.</li>
136
+ <li>Disable auto play and hide the pager if there's only one slide in the Testimonials module.</li>
137
+ <li>Updated GetResponse library to version 3.</li>
138
+ </ul>
139
+ <p><strong>Bug Fixes</strong></p>
140
+ <ul>
141
+ <li>Fixed video background alignment in older browsers that require vendor prefixes for CSS transforms.</li>
142
+ <li>Fixed repeater fields not working in row and column settings.</li>
143
+ <li>Fixed submenus in the menu module's vertical layout going off the page.</li>
144
+ <li>Fixed menu module smooth scrolling issues when clicking an anchor link.</li>
145
+ <li>Fixed issues with duplicating rows that contain another row inserted via shortcode.</li>
146
+ <li>Fixed issue with inactive tabs showing when resizing the browser.</li>
147
+ <li>Fixed various issues with row and column colors overriding module text colors.</li>
148
+ <li>Fixed layout shortcode rendering on search result pages.</li>
149
+ <li>Fixed videos not playing in the content slider.</li>
150
+ </ul>
151
+
152
+ <h4>2.1-alpha.3 - 02/20/2018</h4>
153
+ <ul>
154
+ <li>Reworked Beaver Builder for Gutenberg block to support API changes in Gutenberg 2.2.0.</li>
155
+ <li>Updated opt-in usage stats with theme info.</li>
156
+ </ul>
157
+
158
+ <h4>2.1-alpha.2 - 02/16/2018</h4>
159
+ <p><strong>Bug Fixes</strong></p>
160
+ <ul>
161
+ <li>Fixed inline editing breaking when you have more than one layout on the same page.</li>
162
+ <li>Fixed white labeling issues.</li>
163
+ </ul>
164
+
165
+ <h4>2.1-alpha.1 - 02/15/2018</h4>
166
+ <p><strong>Enhancements</strong></p>
167
+ <ul>
168
+ <li>Added inline text editing to all modules (core and 3rd party) that support live text preview.</li>
169
+ <li>Added support for Gutenberg via the new Beaver Builder block.</li>
170
+ <li>Added a new user access setting for restricting all builder access for certain roles.</li>
171
+ <li>Added a notification center within the builder (disabled when white labeled).</li>
172
+ <li>Added opt-in usage tracking for things like PHP version, settings and module usage.</li>
173
+ <li>Added validation check for all code fields to prevent bad code from breaking the builder.</li>
174
+ <li>Added WPML support for global nodes.</li>
175
+ <li>Added the ability to add your license key via WP-CLI.</li>
176
+ <li>Added filtering for Theme Layouts, Templates, Saved Rows and Saved Modules on the admin list screen.</li>
177
+ <li>Added text padding options to the Content Slider module.</li>
178
+ <li>Added `fl_contact_form_from` filter to allow users to filter the from header.</li>
179
+ <li>Added logic for registering admin pointers.</li>
180
+ <li>Upgrade MailChimp API to v3.</li>
181
+ </ul>
182
+ <p><strong>Bug Fixes</strong></p>
183
+ <ul>
184
+ <li>Fixed builder not working if both Event Espresso and Beaver Themer are active.</li>
185
+ <li>Fixed Posts module columns padding going outside of the module container on mobile.</li>
186
+ <li>Fixed Posts module first page of numbered pagination missing the trailing slash in URL.</li>
187
+ <li>Fixed video background proportions by removing potential max-width styles.</li>
188
+ <li>Fixed images with captions going out of the container when reverse stacking is enabled.</li>
189
+ <li>Fixed current menu class not being applied to the menu module when inserted via shortcode.</li>
190
+ <li>Fixed RTL issues with the Posts Carousel.</li>
191
+ <li>Fixed Content Slider module top/bottom margins not working when text background height is 100%.</li>
192
+ <li>Fixed sliders not displaying properly when inserted via shortcode in Tab/Accordion modules.</li>
193
+ <li>Now using a custom sort function instead of create_function which is deprecated in php 7.2.</li>
194
+ <li>Removed WPML language switcher widget from the content panel since it requires being in a registered sidebar to work.</li>
195
+ </ul>
196
+
197
  <h4>2.0.6.4 - 03/27/2018</h4>
198
  <p><strong>Enhancements</strong></p>
199
  <ul>
200
+ <li>Added optional Terms and Conditions to Contact and Subscribe Modules to comply with GDPR.</li>
201
  </ul>
202
  <p><strong>Bug Fixes</strong></p>
203
  <ul>
217
  <li>Fixed links not being clickable in modules that use bxslider with Firefox 59.</li>
218
  <li>Fixed incorrect links in Social Buttons Module when added in Themer.</li>
219
  <li>Added <code>$id</code> and <code>$type</code> to <code>fl_builder_render_module_css_settings</code> filter variables.</li>
220
+ >>>>>>> master
221
  </ul>
222
 
223
  <h4>2.0.6.2 - 03/13/2018</h4>
429
  <li>Fixed GeneratePress Premium plugin Blog option overrules the Post modules excerpt setting.</li>
430
  </ul>
431
 
432
+ <h4>2.0.2.2 - 12/06/2017</h4>
433
  <p>Beaver Builder 2.0 is now available for remote update!</p>
434
 
435
+ <h4>2.0.2.1 - 11/27/2017</h4>
436
+ <p><strong>Bug Fixes</strong></p>
437
+ <ul>
438
+ <li>Fixed responsive editing mode not working correctly.</li>
439
+ <li>Fixed white labeling not working correctly on the updates page.</li>
440
  </ul>
441
 
442
  <h4>2.0.2 - 11/16/2017</h4>
443
+ <p><strong>Enhancements</strong></p>
444
+ <ul>
445
+ <li>Added <code>fl_builder_cache_cleared</code> action.</li>
446
+ </ul>
447
+ <p><strong>Bug Fixes</strong></p>
448
+ <ul>
449
+ <li>Fixed settings config not loading when query strings are removed from script URLs.</li>
450
+ <li>Fixed widgets not showing when site language is not in English.</li>
451
+ <li>Fixed error when using namespaced widgets.</li>
452
+ <li>Fixed JS errors in IE.</li>
453
+ <li>Fixed keyboard shortcut formatting in IE.</li>
454
+ <li>Fixed capitalization issues with translations.</li>
455
+ <li>Fixed character encoding issues with strtolower.</li>
456
+ </ul>
457
+
458
+ <h4>2.0.1.1 - 11/07/2017</h4>
459
+ <p><strong>Bug Fixes</strong></p>
460
+ <ul>
461
+ <li>Hotfix for a change in 2.0.1 that broke loading of the settings for the Subscribe Form module.</li>
462
+ </ul>
463
+
464
+ <h4>2.0.1 - 11/06/2017</h4>
465
+ <p><strong>Bug Fixes</strong></p>
466
+ <ul>
467
+ <li>Fixed errors caused by settings config not completely loading on certain server setups.</li>
468
+ <li>Fixed PHP warnings when attachment meta doesn't have a width or height set.</li>
469
+ </ul>
470
+
471
+ <h4>2.0 - 11/01/2017</h4>
472
  <p><strong>Beaver Builder 2.0 is here!</strong></p>
473
  <p>Please note that 2.0 is currently only available from your My Account page or via remote update if you already have 2.0 installed. We'll be releasing remote updates for older versions of Beaver Builder within the next few weeks.</p>
474
 
475
+ <h4>2.0-beta.3 - 10/31/2017</h4>
476
+ <p><strong>Enhancements</strong></p>
477
+ <ul>
478
+ <li>Updated the help video for 2.0.</li>
479
+ <li>Added fl_row_resize_settings filter.</li>
480
+ </ul>
481
+ <p><strong>Bug Fixes</strong></p>
482
+ <ul>
483
+ <li>Fixed various UI styling issues.</li>
484
+ <li>Fixed editing global rows not working properly.</li>
485
+ <li>Fixed template override settings not working on multisite.</li>
486
+ <li>Fixed repeater fields in nested forms not working.</li>
487
+ <li>Fixed stylesheets in the body tag not being parsed for responsive preview.</li>
488
+ <li>Fixed content panel showing during preview or unpinning during preview when not expected.</li>
489
+ <li>Fixed anchor links in the layout causing the builder to launch again after publish.</li>
490
+ </ul>
491
+
492
+ <h4>2.0-beta.2 - 10/12/2017</h4>
493
+ <p><strong>Enhancements</strong></p>
494
+ <ul>
495
+ <li>Publish button now says 'Submit for Review' if a user doesn't have permission to publish.</li>
496
+ <li>Pinned settings are now responsive for smaller devices.</li>
497
+ <li>Moved WordPress widgets into their own group.</li>
498
+ <li>Moved Themer modules into their own group (coming in Themer 1.0.3).</li>
499
+ </ul>
500
+ <p><strong>Bug Fixes</strong></p>
501
+ <ul>
502
+ <li>Fixed row actions being covered by modules when the row has no padding.</li>
503
+ <li>Fixed values in text inputs not being escaped which breaks the markup.</li>
504
+ <li>Fixed settings being dragged or resized so you can't access the drag handle anymore.</li>
505
+ <li>Fixed browser zoom triggering the action overflow menu when it shouldn't.</li>
506
+ <li>Fixed multiple issues with saving new templates.</li>
507
+ <li>Fixed styling issues with dark mode.</li>
508
+ <li>Fixed module aliases not showing in the content panel.</li>
509
+ <li>Fixed widgets not showing in the content panel.</li>
510
+ </ul>
511
+
512
+ <h4>2.0-beta.1 - 10/04/2017</h4>
513
+ <p><strong>Enhancements</strong></p>
514
+ <ul>
515
+ <li>Added keyboard shortcut UI to the builder menu.</li>
516
+ <li>Reworked keyboard shortcut system to support displaying shortcuts with labels and modifier key symbols.</li>
517
+ </ul>
518
+ <p><strong>Bug Fixes</strong></p>
519
+ <ul>
520
+ <li>Fixed various styling issues.</li>
521
+ <li>Fixed photo and video fields that aren't in node settings not showing saved data when opened again after the page is refreshed.</li>
522
+ <li>Fixed error when saving a template with no category set.</li>
523
+ <li>Fixed saved values for medium and responsive in dimension fields not showing when going back to edit a node.</li>
524
+ <li>Fixed module templates not showing in the content panel.</li>
525
+ <li>Fixed issue with module hover in the content panel being covered by siblings.</li>
526
+ <li>Fixed a major issue with secondary loops triggering the builder's content filter when they shouldn't. This caused a number of issues including an infinite loop in Themer and the incorrect posts being displayed on standard builder pages.</li>
527
+ <li>Fixed FLBuilder::render_query so it doesn't have to override $wp_query which was causing incorrect connection data for Themer layouts.</li>
528
+ </ul>
529
+
530
+ <h4>2.0-alpha.7 - 09/21/2017</h4>
531
+ <p><strong>Enhancements</strong></p>
532
+ <ul>
533
+ <li>Added the ability to match posts in the loop settings by related taxonomy terms.</li>
534
+ </ul>
535
+ <p><strong>Bug Fixes</strong></p>
536
+ <ul>
537
+ <li>Fixed page scrolling breaking when opening the main menu.</li>
538
+ <li>Fixed field connections not rendering in nested settings forms.</li>
539
+ </ul>
540
+
541
+ <h4>2.0-alpha.6.1 - 09/19/2017</h4>
542
+ <p><strong>Bug Fixes</strong></p>
543
+ <ul>
544
+ <li>Fixed a bug with the option labels in select option groups not showing.</li>
545
+ </ul>
546
+
547
+ <h4>2.0-alpha.6 - 09/19/2017</h4>
548
+ <p><strong>Bug Fixes</strong></p>
549
+ <ul>
550
+ <li>Fixed a bug breaking the Pods integration.</li>
551
+ <li>Fixed an issue causing the builder UI to break on SiteGround servers.</li>
552
+ </ul>
553
+
554
+ <h4>2.0-alpha.5 - 09/06/2017</h4>
555
+ <p><strong>Enhancements</strong></p>
556
+ <ul>
557
+ <li>Settings panel tabs no longer become a drop-down menu when slim. Tabs that cannot fit into the available space are pushed into a menu.</li>
558
+ <li>You can now move between settings tabs with the keyboard shortcuts "CMD + Left Arrow" or "CMD + Right Arrow" (CTRL on Windows).</li>
559
+ <li>You can now reset row or column widths from the module overlay.</li>
560
+ <li>"CMD + i" (CTRL on Windows) shortcut will take you directly to module search.</li>
561
+ <li>Module search is now case-insensitive.</li>
562
+ <li>Duplicated items that appear off screen will now scroll into view.</li>
563
+ </ul>
564
+ <p><strong>Bug Fixes</strong></p>
565
+ <ul>
566
+ <li>Fixed scrolling not working when hovering over the content panel and then back into the layout.</li>
567
+ <li>Hovering over the content panel should no longer cause screen jitter in Windows browsers.</li>
568
+ <li>Icon selector search/filter has been restored.</li>
569
+ <li>J, K, L, and ; keys now show content panel tabs even when the panel has been collapsed.</li>
570
+ <li>Dropping a row template into the layout immediately loads fonts.</li>
571
+ <li>Overriding core templates now works again when applying a template.<li>
572
+ <li>Fixed ACE editor resize causing incorrect cursor position.</li>
573
+ <li>Fixed multiple issues with pinning in Safari and Firefox.</li>
574
+ </ul>
575
+
576
+ <h4>2.0-alpha.4 - 08/29/2017</h4>
577
+ <ul>
578
+ <li>A new slimmer version of the settings panels now opens when clicking to edit content.</li>
579
+ <li>Settings panels can now be resized to any size that you desire.</li>
580
+ <li>We'll remember the size and position you set for the settings panels even after reloading the page.</li>
581
+ <li>The content panel and settings can now be pinned together on either the left or right side of the screen. You can resize the pinned sidebar when you need a little more room.</li>
582
+ <li>You can now work with the toolbar or in the layout even when settings are open.</li>
583
+ <li>If settings are open and you take action anywhere else in the builder, we'll save and close them for you. This means you can edit one module and click to edit another without ever needing to click save in between.</li>
584
+ <li>Module search has been moved into the modules tab for more intuitive access.</li>
585
+ </ul>
586
+
587
+ <h4>2.0-alpha.3 - 08/07/2017</h4>
588
+ <ul>
589
+ <li>Settings forms now load instantly! We've completely rewritten the settings forms in JavaScript so they don’t need to be loaded from the server anymore. The only time something needs to load is if you’re using a third party add-on that introduces legacy PHP fields. We’ll have docs on the new JavaScript settings APIs when 2.0 is released and hope that all major add-on authors will convert their fields to JavaScript so everything loads instantly! :)</li>
590
+ <li>Added an initial set of core row templates.</li>
591
+ <li>Various bug fixes and style tweaks.</li>
592
+ </ul>
593
+
594
+ <h4>2.0-alpha.2 - 07/24/2017</h4>
595
+ <ul>
596
+ <li>Added the ability to duplicate columns.</li>
597
+ <li>Increased contrast to light and dark UI modes.</li>
598
+ <li>Added module icons.</li>
599
+ <li>Restyled content group selector.</li>
600
+ <li>Reworked how group labels are displayed in search results.</li>
601
+ <li>Style hardening for GeneratePress theme.</li>
602
+ <li>Publishing out of the builder now moves the history state and updates the url. Re-entering will move back.</li>
603
+ </ul>
604
+
605
  <h4>1.11.1 11/29/17</h4>
606
  <p><strong>Hot Fix</strong></p>
607
  <ul>
793
  </ul>
794
  <p><strong>Bug Fixes</strong></p>
795
  <ul>
796
+ <li>Removed the new core media widgets from the builder since they don’t work in the builder and we have modules that do the same thing.</li>
797
+ <li>Fixed the core text widget form in the builder so the legacy form loads since the new form in 4.8 doesn’t. The text widget is also removed from the module list in favor of the Text Editor and HTML modules. Sites previously using the text widget will still render and they can still be edited, they just won’t be able to add new text widgets.</li>
798
  <li>Fixed Slideshow module not showing in the Tabs module.</li>
799
  <li>Fixed JS error in Row > Background > Slideshow on touch-enabled devices.</li>
800
  <li>Increased the video ratio to 16:9 to fix the top/bottom black border on responsive layout.</li>
944
  </ul>
945
  <p><strong>Post Module Enhancements</strong></p>
946
  <ul>
947
+ <li>Added “columns” layout to the layout setting.</li>
948
  <li>Added more layout and styling settings.</li>
949
+ <li>The “no results” message is now shown when no posts are found.</li>
950
  <li>Added a setting to show a search form if no posts are found.</li>
951
  <li>Added the ability to exclude posts in the content filter for the query.</li>
952
  </ul>
953
  <p><strong>Menu Module Enhancements</strong></p>
954
  <ul>
955
+ <li>Added “below row" option for mobile menu position.</li>
956
  <li>Added font family setting.</li>
957
  <li>Misc CSS improvements.</li>
958
  </ul>
996
  <h4>1.9.5.1 - 3/21/2017</h4>
997
  <p><strong>Bug Fixes</strong></p>
998
  <ul>
999
+ <li>Rolled back change in 1.9.5 that fixed some photos not going full width on mobile. That was causing all photos to go full width on mobile even when not intended. We’ll revisit that fix in 1.10.</li>
1000
  </ul>
1001
 
1002
  <h4>1.9.5 - 3/20/2017</h4>
2732
  <h4>0.8.2</h4>
2733
  <p>Responsive module margins now only reset if negative or greater than the default.</p>
2734
 
2735
+ <h4>0.8.1</h4>
2736
  <p>Initial beta release.</p>
classes/class-fl-builder-admin-pointers.php ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Class that handles showing admin pointers.
5
+ *
6
+ * @since 1.10.3
7
+ */
8
+ final class FLBuilderAdminPointers {
9
+
10
+ /**
11
+ * @since 1.10.3
12
+ * @var array $pointers
13
+ */
14
+ static private $pointers = array();
15
+
16
+ /**
17
+ * Initialize.
18
+ *
19
+ * @since 1.10.3
20
+ * @return void
21
+ */
22
+ static public function init() {
23
+
24
+ add_action( 'admin_enqueue_scripts', __CLASS__ . '::enqueue_scripts' );
25
+ }
26
+
27
+ /**
28
+ * Register a pointer.
29
+ *
30
+ * @since 1.10.3
31
+ * @param array $pointer
32
+ * @return void
33
+ */
34
+ static public function register_pointer( $pointer ) {
35
+
36
+ self::$pointers[] = $pointer;
37
+ }
38
+
39
+ /**
40
+ * Enqueue scripts for showing pointers.
41
+ *
42
+ * @since 1.10.3
43
+ * @return void
44
+ */
45
+ static public function enqueue_scripts() {
46
+
47
+ $pointers = array();
48
+
49
+ foreach ( self::$pointers as $pointer ) {
50
+
51
+ if ( ! current_user_can( $pointer['cap'] ) || self::is_dismissed( $pointer['id'] ) ) {
52
+ continue;
53
+ }
54
+
55
+ $pointers[] = $pointer;
56
+ }
57
+
58
+ if ( empty( $pointers ) ) {
59
+ return;
60
+ }
61
+
62
+ wp_enqueue_style( 'wp-pointer' );
63
+ wp_enqueue_script( 'wp-pointer' );
64
+
65
+ wp_enqueue_script(
66
+ 'fl-builder-admin-pointers',
67
+ FL_BUILDER_URL . '/js/fl-builder-admin-pointers.js',
68
+ array( 'jquery', 'wp-pointer' ),
69
+ FL_BUILDER_VERSION,
70
+ true
71
+ );
72
+
73
+ wp_localize_script( 'fl-builder-admin-pointers', 'FLBuilderAdminPointersConfig', array(
74
+ 'pointers' => $pointers,
75
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
76
+ ) );
77
+ }
78
+
79
+ /**
80
+ * Check if a pointer has been dismissed by the current user.
81
+ *
82
+ * @since 1.10.3
83
+ * @param string $pointer_id
84
+ * @return bool
85
+ */
86
+ static private function is_dismissed( $pointer_id ) {
87
+
88
+ $dismissed = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );
89
+
90
+ return in_array( $pointer_id, $dismissed );
91
+ }
92
+ }
93
+
94
+ FLBuilderAdminPointers::init();
classes/class-fl-builder-admin-posts.php CHANGED
@@ -23,6 +23,30 @@ final class FLBuilderAdminPosts {
23
  add_filter( 'post_row_actions', __CLASS__ . '::render_row_actions_link' );
24
  }
25
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  /**
27
  * Sets the body class, loads assets and renders the UI
28
  * if we are on a post type that supports the builder.
@@ -37,9 +61,8 @@ final class FLBuilderAdminPosts {
37
 
38
  $render_ui = apply_filters( 'fl_builder_render_admin_edit_ui', true );
39
  $post_types = FLBuilderModel::get_post_types();
40
- $screen = get_current_screen();
41
 
42
- if ( $render_ui && in_array( $screen->post_type, $post_types ) ) {
43
  add_filter( 'admin_body_class', __CLASS__ . '::body_class', 99 );
44
  add_action( 'admin_enqueue_scripts', __CLASS__ . '::styles_scripts' );
45
  add_action( 'edit_form_after_title', __CLASS__ . '::render' );
@@ -121,10 +144,10 @@ final class FLBuilderAdminPosts {
121
  if ( 'trash' != $post->post_status && current_user_can( 'edit_post', $post->ID ) && wp_check_post_lock( $post->ID ) === false ) {
122
 
123
  $is_post_editable = (bool) apply_filters( 'fl_builder_is_post_editable', true, $post );
124
-
125
  $post_types = FLBuilderModel::get_post_types();
126
 
127
- if ( in_array( $post->post_type, $post_types ) && $is_post_editable ) {
128
  $enabled = get_post_meta( $post->ID, '_fl_builder_enabled', true );
129
  $dot = ' <span style="color:' . ( $enabled ? '#6bc373' : '#d9d9d9' ) . '; font-size:18px;">&bull;</span>';
130
  $actions['fl-builder'] = '<a href="' . FLBuilderModel::get_edit_url() . '">' . FLBuilderModel::get_branding() . $dot . '</a>';
@@ -143,7 +166,7 @@ final class FLBuilderAdminPosts {
143
  */
144
  static public function redirect_post_location( $location ) {
145
  if ( isset( $_POST['fl-builder-redirect'] ) ) {
146
- $location = $_POST['fl-builder-redirect'];
147
  }
148
 
149
  return $location;
23
  add_filter( 'post_row_actions', __CLASS__ . '::render_row_actions_link' );
24
  }
25
 
26
+ /**
27
+ * WordPress doesn't have a "right way" to get the current
28
+ * post type being edited and the new editor doesn't make
29
+ * this any easier. This method attempts to fix that.
30
+ *
31
+ * @since 2.1
32
+ * @return void
33
+ */
34
+ static public function get_post_type() {
35
+ global $post, $typenow, $current_screen;
36
+
37
+ if ( is_object( $post ) && $post->post_type ) {
38
+ return $post->post_type;
39
+ } elseif ( $typenow ) {
40
+ return $typenow;
41
+ } elseif ( is_object( $current_screen ) && $current_screen->post_type ) {
42
+ return $current_screen->post_type;
43
+ } elseif ( isset( $_REQUEST['post_type'] ) ) {
44
+ return sanitize_key( $_REQUEST['post_type'] );
45
+ }
46
+
47
+ return null;
48
+ }
49
+
50
  /**
51
  * Sets the body class, loads assets and renders the UI
52
  * if we are on a post type that supports the builder.
61
 
62
  $render_ui = apply_filters( 'fl_builder_render_admin_edit_ui', true );
63
  $post_types = FLBuilderModel::get_post_types();
 
64
 
65
+ if ( $render_ui && in_array( self::get_post_type(), $post_types ) ) {
66
  add_filter( 'admin_body_class', __CLASS__ . '::body_class', 99 );
67
  add_action( 'admin_enqueue_scripts', __CLASS__ . '::styles_scripts' );
68
  add_action( 'edit_form_after_title', __CLASS__ . '::render' );
144
  if ( 'trash' != $post->post_status && current_user_can( 'edit_post', $post->ID ) && wp_check_post_lock( $post->ID ) === false ) {
145
 
146
  $is_post_editable = (bool) apply_filters( 'fl_builder_is_post_editable', true, $post );
147
+ $user_access = FLBuilderUserAccess::current_user_can( 'builder_access' );
148
  $post_types = FLBuilderModel::get_post_types();
149
 
150
+ if ( in_array( $post->post_type, $post_types ) && $is_post_editable && $user_access ) {
151
  $enabled = get_post_meta( $post->ID, '_fl_builder_enabled', true );
152
  $dot = ' <span style="color:' . ( $enabled ? '#6bc373' : '#d9d9d9' ) . '; font-size:18px;">&bull;</span>';
153
  $actions['fl-builder'] = '<a href="' . FLBuilderModel::get_edit_url() . '">' . FLBuilderModel::get_branding() . $dot . '</a>';
166
  */
167
  static public function redirect_post_location( $location ) {
168
  if ( isset( $_POST['fl-builder-redirect'] ) ) {
169
+ $location = FLBuilderModel::get_edit_url( absint( $_POST['fl-builder-redirect'] ) );
170
  }
171
 
172
  return $location;
classes/class-fl-builder-admin-settings.php CHANGED
@@ -155,7 +155,7 @@ final class FLBuilderAdminSettings {
155
  $item_data = apply_filters( 'fl_builder_admin_settings_nav_items', array(
156
  'welcome' => array(
157
  'title' => __( 'Welcome', 'fl-builder' ),
158
- 'show' => FLBuilderModel::get_branding() == __( 'Page Builder', 'fl-builder' ) && ( is_network_admin() || ! self::multisite_support() ),
159
  'priority' => 50,
160
  ),
161
  'license' => array(
@@ -219,7 +219,7 @@ final class FLBuilderAdminSettings {
219
  */
220
  static public function render_forms() {
221
  // Welcome
222
- if ( FLBuilderModel::get_branding() == __( 'Page Builder', 'fl-builder' ) && ( is_network_admin() || ! self::multisite_support() ) ) {
223
  self::render_form( 'welcome' );
224
  }
225
 
@@ -421,6 +421,12 @@ final class FLBuilderAdminSettings {
421
  $enabled_icons = array_map( 'sanitize_text_field', $_POST['fl-enabled-icons'] );
422
  }
423
 
 
 
 
 
 
 
424
  // Update the enabled sets.
425
  self::update_enabled_icons( $enabled_icons );
426
 
@@ -507,11 +513,11 @@ final class FLBuilderAdminSettings {
507
  $key = FLBuilderIcons::get_key_from_path( $new_path );
508
  $enabled_icons[] = $key;
509
  }
510
- }// End if().
511
 
512
  // Update the enabled sets again in case they have changed.
513
  self::update_enabled_icons( $enabled_icons );
514
- }// End if().
515
  }
516
 
517
  /**
155
  $item_data = apply_filters( 'fl_builder_admin_settings_nav_items', array(
156
  'welcome' => array(
157
  'title' => __( 'Welcome', 'fl-builder' ),
158
+ 'show' => ! FLBuilderModel::is_white_labeled() && ( is_network_admin() || ! self::multisite_support() ),
159
  'priority' => 50,
160
  ),
161
  'license' => array(
219
  */
220
  static public function render_forms() {
221
  // Welcome
222
+ if ( ! FLBuilderModel::is_white_labeled() && ( is_network_admin() || ! self::multisite_support() ) ) {
223
  self::render_form( 'welcome' );
224
  }
225
 
421
  $enabled_icons = array_map( 'sanitize_text_field', $_POST['fl-enabled-icons'] );
422
  }
423
 
424
+ // we cant have fa4 and fa5 active at same time.
425
+ if ( in_array( 'font-awesome', $enabled_icons ) && (bool) array_intersect( array( 'font-awesome-5-brands', 'font-awesome-5-regular', 'font-awesome-5-solid' ), $enabled_icons ) ) {
426
+ self::add_error( __( 'Use either Font Awesome 4 or Font Awesome 5. They are not compatible. Modules already in use will continue to use Font Awesome 4 regardless of your choice here.', 'fl-builder' ) );
427
+ return;
428
+ }
429
+
430
  // Update the enabled sets.
431
  self::update_enabled_icons( $enabled_icons );
432
 
513
  $key = FLBuilderIcons::get_key_from_path( $new_path );
514
  $enabled_icons[] = $key;
515
  }
516
+ }
517
 
518
  // Update the enabled sets again in case they have changed.
519
  self::update_enabled_icons( $enabled_icons );
520
+ }
521
  }
522
 
523
  /**
classes/class-fl-builder-ajax-layout.php CHANGED
@@ -53,7 +53,7 @@ final class FLBuilderAJAXLayout {
53
  do_action( 'fl_builder_after_render_ajax_layout' );
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'],
@@ -62,7 +62,7 @@ final class FLBuilderAJAXLayout {
62
  'scriptsStyles' => $scripts_styles,
63
  'css' => $assets['css'],
64
  'js' => $assets['js'],
65
- );
66
  }
67
 
68
  /**
@@ -91,8 +91,7 @@ final class FLBuilderAJAXLayout {
91
  'layout' => self::render( $row->node ),
92
  'config' => FLBuilderUISettingsForms::get_node_js_config(),
93
  );
94
- } // End if().
95
- else {
96
 
97
  // Add the row.
98
  $row = FLBuilderModel::add_row( $cols, $position );
@@ -180,6 +179,44 @@ final class FLBuilderAJAXLayout {
180
  return self::render( $group->node );
181
  }
182
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
  /**
184
  * Renders the layout data for a copied column.
185
  *
@@ -217,8 +254,7 @@ final class FLBuilderAJAXLayout {
217
  } else {
218
  $module = FLBuilderModel::apply_node_template( $template_id, $parent_id, $position );
219
  }
220
- } // End if().
221
- else {
222
  $defaults = FLBuilderModel::get_module_alias_settings( $alias );
223
  $module = FLBuilderModel::add_default_module( $parent_id, $type, $position, $defaults );
224
  }
@@ -297,8 +333,7 @@ final class FLBuilderAJAXLayout {
297
  $node = FLBuilderModel::get_module( $node_id );
298
  $node_type = 'module';
299
  $partial_refresh = $node->partial_refresh;
300
- } // End if().
301
- elseif ( $node ) {
302
  $node_type = $node->type;
303
  $partial_refresh = self::node_modules_support_partial_refresh( $node );
304
  }
@@ -315,7 +350,7 @@ final class FLBuilderAJAXLayout {
315
  'node' => $node,
316
  'node_type' => $node_type,
317
  );
318
- }// End if().
319
 
320
  // Return the data.
321
  return self::$partial_refresh_data;
@@ -371,7 +406,7 @@ final class FLBuilderAJAXLayout {
371
  }
372
  }
373
  }
374
- }// End if().
375
 
376
  return true;
377
  }
@@ -413,8 +448,7 @@ final class FLBuilderAJAXLayout {
413
  FLBuilder::render_module( $partial_refresh_data['node'] );
414
  break;
415
  }
416
- } // End if().
417
- else {
418
  FLBuilder::render_nodes();
419
  }
420
 
@@ -489,7 +523,7 @@ final class FLBuilderAJAXLayout {
489
  } else {
490
  FLBuilder::render_js();
491
  $assets['js'] = $asset_info['js_url'] . '?ver=' . $asset_ver;
492
- }// End if().
493
 
494
  // Render the CSS.
495
  FLBuilder::render_css();
53
  do_action( 'fl_builder_after_render_ajax_layout' );
54
 
55
  // Return the response.
56
+ return apply_filters( 'fl_builder_ajax_layout_response', array(
57
  'partial' => $partial_refresh_data['is_partial_refresh'],
58
  'nodeId' => $partial_refresh_data['node_id'],
59
  'nodeType' => $partial_refresh_data['node_type'],
62
  'scriptsStyles' => $scripts_styles,
63
  'css' => $assets['css'],
64
  'js' => $assets['js'],
65
+ ) );
66
  }
67
 
68
  /**
91
  'layout' => self::render( $row->node ),
92
  'config' => FLBuilderUISettingsForms::get_node_js_config(),
93
  );
94
+ } else {
 
95
 
96
  // Add the row.
97
  $row = FLBuilderModel::add_row( $cols, $position );
179
  return self::render( $group->node );
180
  }
181
 
182
+ /**
183
+ * Renders a new column template.
184
+ *
185
+ * @since 2.1
186
+ * @param string $template_id The ID of a column template to render.
187
+ * @param string $parent_id A column node ID.
188
+ * @param int $position The new column position.
189
+ * @param string $template_type The type of template. Either "user" or "core".
190
+ * @return array
191
+ */
192
+ static public function render_new_col_template( $template_id, $parent_id = null, $position = false, $template_type = 'user' ) {
193
+ if ( 'core' == $template_type ) {
194
+ $template = FLBuilderModel::get_template( $template_id, 'column' );
195
+ $column = FLBuilderModel::apply_node_template( $template_id, $parent_id, $position, $template );
196
+ } else {
197
+ $column = FLBuilderModel::apply_node_template( $template_id, $parent_id, $position );
198
+ }
199
+
200
+ // Get the new column parent.
201
+ $parent = ! $parent_id ? null : FLBuilderModel::get_node( $parent_id );
202
+
203
+ // Get the node to render.
204
+ if ( ! $parent ) {
205
+ $row = FLBuilderModel::get_col_parent( 'row', $column );
206
+ $render_id = $row->node;
207
+ } elseif ( 'row' == $parent->type ) {
208
+ $group = FLBuilderModel::get_col_parent( 'column-group', $column );
209
+ $render_id = $group->node;
210
+ } elseif ( 'column-group' == $parent->type ) {
211
+ $render_id = $parent->node;
212
+ } else {
213
+ $render_id = $column->node;
214
+ }
215
+
216
+ // Return the response.
217
+ return self::render( $render_id );
218
+ }
219
+
220
  /**
221
  * Renders the layout data for a copied column.
222
  *
254
  } else {
255
  $module = FLBuilderModel::apply_node_template( $template_id, $parent_id, $position );
256
  }
257
+ } else {
 
258
  $defaults = FLBuilderModel::get_module_alias_settings( $alias );
259
  $module = FLBuilderModel::add_default_module( $parent_id, $type, $position, $defaults );
260
  }
333
  $node = FLBuilderModel::get_module( $node_id );
334
  $node_type = 'module';
335
  $partial_refresh = $node->partial_refresh;
336
+ } elseif ( $node ) {
 
337
  $node_type = $node->type;
338
  $partial_refresh = self::node_modules_support_partial_refresh( $node );
339
  }
350
  'node' => $node,
351
  'node_type' => $node_type,
352
  );
353
+ }
354
 
355
  // Return the data.
356
  return self::$partial_refresh_data;
406
  }
407
  }
408
  }
409
+ }
410
 
411
  return true;
412
  }
448
  FLBuilder::render_module( $partial_refresh_data['node'] );
449
  break;
450
  }
451
+ } else {
 
452
  FLBuilder::render_nodes();
453
  }
454
 
523
  } else {
524
  FLBuilder::render_js();
525
  $assets['js'] = $asset_info['js_url'] . '?ver=' . $asset_ver;
526
+ }
527
 
528
  // Render the CSS.
529
  FLBuilder::render_css();
classes/class-fl-builder-ajax.php CHANGED
@@ -113,6 +113,7 @@ final class FLBuilderAJAX {
113
  self::add_action( 'copy_row', 'FLBuilderAJAXLayout::copy_row', array( 'node_id', 'settings', 'settings_id' ) );
114
  self::add_action( 'render_new_column_group', 'FLBuilderAJAXLayout::render_new_column_group', array( 'node_id', 'cols', 'position' ) );
115
  self::add_action( 'render_new_columns', 'FLBuilderAJAXLayout::render_new_columns', array( 'node_id', 'insert', 'type', 'nested' ) );
 
116
  self::add_action( 'copy_col', 'FLBuilderAJAXLayout::copy_col', array( 'node_id', 'settings', 'settings_id' ) );
117
  self::add_action( 'render_new_module', 'FLBuilderAJAXLayout::render_new_module', array( 'parent_id', 'position', 'type', 'alias', 'template_id', 'template_type' ) );
118
  self::add_action( 'copy_module', 'FLBuilderAJAXLayout::copy_module', array( 'node_id', 'settings' ) );
113
  self::add_action( 'copy_row', 'FLBuilderAJAXLayout::copy_row', array( 'node_id', 'settings', 'settings_id' ) );
114
  self::add_action( 'render_new_column_group', 'FLBuilderAJAXLayout::render_new_column_group', array( 'node_id', 'cols', 'position' ) );
115
  self::add_action( 'render_new_columns', 'FLBuilderAJAXLayout::render_new_columns', array( 'node_id', 'insert', 'type', 'nested' ) );
116
+ self::add_action( 'render_new_col_template', 'FLBuilderAJAXLayout::render_new_col_template', array( 'template_id', 'parent_id', 'position', 'template_type' ) );
117
  self::add_action( 'copy_col', 'FLBuilderAJAXLayout::copy_col', array( 'node_id', 'settings', 'settings_id' ) );
118
  self::add_action( 'render_new_module', 'FLBuilderAJAXLayout::render_new_module', array( 'parent_id', 'position', 'type', 'alias', 'template_id', 'template_type' ) );
119
  self::add_action( 'copy_module', 'FLBuilderAJAXLayout::copy_module', array( 'node_id', 'settings' ) );
classes/class-fl-builder-debug.php CHANGED
@@ -6,8 +6,7 @@ final class FL_Debug {
6
 
7
  public static function init() {
8
  if ( isset( $_GET['fldebug'] ) && get_option( 'fl_debug_mode', false ) === $_GET['fldebug'] ) {
9
- self::prepare_tests();
10
- self::display_tests();
11
  }
12
 
13
  if ( get_option( 'fl_debug_mode', false ) ) {
@@ -21,7 +20,9 @@ final class FL_Debug {
21
  @error_reporting( E_ALL ); // @codingStandardsIgnoreLine
22
  }
23
 
24
- private static function display_tests() {
 
 
25
 
26
  header( 'Content-Type:text/plain' );
27
 
@@ -337,7 +338,7 @@ final class FL_Debug {
337
  );
338
  self::register( 'bb_sub_lite', $args );
339
 
340
- } else {
341
  $subscription = FLUpdater::get_subscription_info();
342
  $args = array(
343
  'name' => 'Beaver Builder License',
@@ -379,6 +380,38 @@ final class FL_Debug {
379
  'data' => $_SERVER['SERVER_SOFTWARE'],
380
  );
381
  self::register( 'server', $args );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
382
  }
383
  }
384
  add_action( 'plugins_loaded', array( 'FL_Debug', 'init' ) );
6
 
7
  public static function init() {
8
  if ( isset( $_GET['fldebug'] ) && get_option( 'fl_debug_mode', false ) === $_GET['fldebug'] ) {
9
+ add_action( 'init', array( 'FL_Debug', 'display_tests' ) );
 
10
  }
11
 
12
  if ( get_option( 'fl_debug_mode', false ) ) {
20
  @error_reporting( E_ALL ); // @codingStandardsIgnoreLine
21
  }
22
 
23
+ public static function display_tests() {
24
+
25
+ self::prepare_tests();
26
 
27
  header( 'Content-Type:text/plain' );
28
 
338
  );
339
  self::register( 'bb_sub_lite', $args );
340
 
341
+ } elseif ( class_exists( 'FLUpdater' ) ) {
342
  $subscription = FLUpdater::get_subscription_info();
343
  $args = array(
344
  'name' => 'Beaver Builder License',
380
  'data' => $_SERVER['SERVER_SOFTWARE'],
381
  );
382
  self::register( 'server', $args );
383
+
384
+ $args = array(
385
+ 'name' => 'htaccess files',
386
+ 'data' => self::divider(),
387
+ );
388
+ self::register( 'up_htaccess', $args );
389
+
390
+ // detect uploads folder .htaccess file and display it if found.
391
+ $uploads = wp_upload_dir();
392
+ $uploads_htaccess = trailingslashit( $uploads['basedir'] ) . '.htaccess';
393
+ $root_htaccess = trailingslashit( ABSPATH ) . '.htaccess';
394
+
395
+ if ( file_exists( $root_htaccess ) ) {
396
+ ob_start();
397
+ readfile( $root_htaccess );
398
+ $htaccess = ob_get_clean();
399
+ $args = array(
400
+ 'name' => $root_htaccess . "\n",
401
+ 'data' => $htaccess,
402
+ );
403
+ self::register( 'up_htaccess_root', $args );
404
+ }
405
+ if ( file_exists( $uploads_htaccess ) ) {
406
+ ob_start();
407
+ readfile( $uploads_htaccess );
408
+ $htaccess = ob_get_clean();
409
+ $args = array(
410
+ 'name' => $uploads_htaccess . "\n",
411
+ 'data' => $htaccess,
412
+ );
413
+ self::register( 'up_htaccess_uploads', $args );
414
+ }
415
  }
416
  }
417
  add_action( 'plugins_loaded', array( 'FL_Debug', 'init' ) );
classes/class-fl-builder-filesystem.php CHANGED
@@ -9,7 +9,8 @@ class FL_Filesystem {
9
 
10
  public static function instance() {
11
  if ( is_null( self::$_instance ) ) {
12
- self::$_instance = new self();
 
13
  }
14
  return self::$_instance;
15
  }
@@ -98,7 +99,8 @@ class FL_Filesystem {
98
  * @since 2.0.6
99
  */
100
  function file_exists( $path ) {
101
- return file_exists( $path );
 
102
  }
103
 
104
  /**
@@ -106,7 +108,8 @@ class FL_Filesystem {
106
  * @since 2.0.6
107
  */
108
  function filesize( $path ) {
109
- return filesize( $path );
 
110
  }
111
 
112
  /**
@@ -131,6 +134,14 @@ class FL_Filesystem {
131
  remove_filter( 'request_filesystem_credentials', array( $this, 'FLBuilderUtils::request_filesystem_credentials' ) );
132
  }
133
 
 
 
 
 
 
 
 
 
134
  return $wp_filesystem;
135
  }
136
 
9
 
10
  public static function instance() {
11
  if ( is_null( self::$_instance ) ) {
12
+ $filtered = apply_filters( 'fl_filesystem_instance', null );
13
+ self::$_instance = $filtered instanceof FL_Filesystem ? $filtered : new self();
14
  }
15
  return self::$_instance;
16
  }
99
  * @since 2.0.6
100
  */
101
  function file_exists( $path ) {
102
+ $wp_filesystem = $this->get_filesystem();
103
+ return $wp_filesystem->exists( $path );
104
  }
105
 
106
  /**
108
  * @since 2.0.6
109
  */
110
  function filesize( $path ) {
111
+ $wp_filesystem = $this->get_filesystem();
112
+ return $wp_filesystem->size( $path );
113
  }
114
 
115
  /**
134
  remove_filter( 'request_filesystem_credentials', array( $this, 'FLBuilderUtils::request_filesystem_credentials' ) );
135
  }
136
 
137
+ // Set the permission constants if not already set.
138
+ if ( ! defined( 'FS_CHMOD_DIR' ) ) {
139
+ define( 'FS_CHMOD_DIR', 0755 );
140
+ }
141
+ if ( ! defined( 'FS_CHMOD_FILE' ) ) {
142
+ define( 'FS_CHMOD_FILE', 0644 );
143
+ }
144
+
145
  return $wp_filesystem;
146
  }
147
 
classes/class-fl-builder-fonts.php CHANGED
@@ -319,9 +319,9 @@ final class FLBuilderFonts {
319
  }
320
  }
321
  }
322
- }// End if().
323
- }// End if().
324
- }// End foreach().
325
 
326
  // Start combining all enqueued google fonts
327
  if ( count( $enqueued_google_fonts ) > 0 ) {
@@ -355,7 +355,7 @@ final class FLBuilderFonts {
355
  $enqueued_google_fonts = array();
356
  }
357
  }
358
- }// End if().
359
  }
360
 
361
  }
319
  }
320
  }
321
  }
322
+ }
323
+ }
324
+ }
325
 
326
  // Start combining all enqueued google fonts
327
  if ( count( $enqueued_google_fonts ) > 0 ) {
355
  $enqueued_google_fonts = array();
356
  }
357
  }
358
+ }
359
  }
360
 
361
  }
classes/class-fl-builder-icons.php CHANGED
@@ -128,9 +128,25 @@ final class FLBuilderIcons {
128
  $enabled_icons = FLBuilderModel::get_enabled_icons();
129
  $core_sets = apply_filters( 'fl_builder_core_icon_sets', array(
130
  'font-awesome' => array(
131
- 'name' => 'Font Awesome',
132
  'prefix' => 'fa',
133
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
  'foundation-icons' => array(
135
  'name' => 'Foundation Icons',
136
  'prefix' => '',
@@ -141,6 +157,10 @@ final class FLBuilderIcons {
141
  ),
142
  ) );
143
 
 
 
 
 
144
  // Add the core sets.
145
  foreach ( $core_sets as $set_key => $set_data ) {
146
  if ( is_admin() || in_array( $set_key, $enabled_icons ) ) {
@@ -160,7 +180,26 @@ final class FLBuilderIcons {
160
  // Loop through core sets and add icons.
161
  foreach ( self::$sets as $set_key => $set_data ) {
162
  if ( 'core' == $set_data['type'] ) {
163
- $config_path = apply_filters( 'fl_builder_core_icon_set_config', FL_BUILDER_DIR . 'json/' . $set_key . '.json', $set_data );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
164
 
165
  $icons = json_decode( file_get_contents( $config_path ) );
166
  self::$sets[ $set_key ]['icons'] = $icons;
@@ -233,8 +272,7 @@ final class FLBuilderIcons {
233
  }
234
  }
235
  }
236
- } // End if().
237
- elseif ( fl_builder_filesystem()->file_exists( $folder . 'config.json' ) ) {
238
 
239
  $data = json_decode( fl_builder_filesystem()->file_get_contents( $folder . 'config.json' ) );
240
  $key = basename( $folder );
@@ -275,7 +313,7 @@ final class FLBuilderIcons {
275
  }
276
  }
277
  }
278
- }// End foreach().
279
  }
280
 
281
  /**
@@ -287,7 +325,7 @@ final class FLBuilderIcons {
287
  static public function enqueue_all_custom_icons_styles() {
288
  $sets = self::get_sets();
289
 
290
- foreach ( $sets as $key => $data ) {
291
 
292
  // Don't enqueue core icons.
293
  if ( 'core' == $data['type'] ) {
@@ -357,14 +395,15 @@ final class FLBuilderIcons {
357
  do_action( 'fl_builder_enqueue_styles_for_icon', $icon );
358
 
359
  // Is this a core icon?
360
- if ( stristr( $icon, 'fa-' ) ) {
361
  wp_enqueue_style( 'font-awesome' );
 
 
362
  } elseif ( stristr( $icon, 'fi-' ) ) {
363
  wp_enqueue_style( 'foundation-icons' );
364
  } elseif ( stristr( $icon, 'dashicon' ) ) {
365
  wp_enqueue_style( 'dashicons' );
366
- } // End if().
367
- else {
368
 
369
  $sets = self::get_sets();
370
 
128
  $enabled_icons = FLBuilderModel::get_enabled_icons();
129
  $core_sets = apply_filters( 'fl_builder_core_icon_sets', array(
130
  'font-awesome' => array(
131
+ 'name' => 'Font Awesome 4',
132
  'prefix' => 'fa',
133
  ),
134
+ 'font-awesome-5-solid' => array(
135
+ 'name' => 'Font Awesome 5 Solid',
136
+ 'prefix' => 'fas',
137
+ ),
138
+ 'font-awesome-5-regular' => array(
139
+ 'name' => 'Font Awesome 5 Regular',
140
+ 'prefix' => 'far',
141
+ ),
142
+ 'font-awesome-5-light' => array(
143
+ 'name' => 'Font Awesome 5 Light (pro only)',
144
+ 'prefix' => 'fal',
145
+ ),
146
+ 'font-awesome-5-brands' => array(
147
+ 'name' => 'Font Awesome 5 Brands',
148
+ 'prefix' => 'fab',
149
+ ),
150
  'foundation-icons' => array(
151
  'name' => 'Foundation Icons',
152
  'prefix' => '',
157
  ),
158
  ) );
159
 
160
+ if ( ! apply_filters( 'fl_enable_fa5_pro', false ) ) {
161
+ unset( $core_sets['font-awesome-5-light'] );
162
+ }
163
+
164
  // Add the core sets.
165
  foreach ( $core_sets as $set_key => $set_data ) {
166
  if ( is_admin() || in_array( $set_key, $enabled_icons ) ) {
180
  // Loop through core sets and add icons.
181
  foreach ( self::$sets as $set_key => $set_data ) {
182
  if ( 'core' == $set_data['type'] ) {
183
+
184
+ $key = $set_key;
185
+
186
+ if ( apply_filters( 'fl_enable_fa5_pro', false ) ) {
187
+ switch ( $set_key ) {
188
+ case 'font-awesome-5-light' :
189
+ $key = 'font-awesome-5-light-pro';
190
+ break;
191
+
192
+ case 'font-awesome-5-regular' :
193
+ $key = 'font-awesome-5-regular-pro';
194
+ break;
195
+
196
+ case 'font-awesome-5-solid' :
197
+ $key = 'font-awesome-5-solid-pro';
198
+ break;
199
+ }
200
+ }
201
+
202
+ $config_path = apply_filters( 'fl_builder_core_icon_set_config', FL_BUILDER_DIR . 'json/' . $key . '.json', $set_data );
203
 
204
  $icons = json_decode( file_get_contents( $config_path ) );
205
  self::$sets[ $set_key ]['icons'] = $icons;
272
  }
273
  }
274
  }
275
+ } elseif ( fl_builder_filesystem()->file_exists( $folder . 'config.json' ) ) {
 
276
 
277
  $data = json_decode( fl_builder_filesystem()->file_get_contents( $folder . 'config.json' ) );
278
  $key = basename( $folder );
313
  }
314
  }
315
  }
316
+ }
317
  }
318
 
319
  /**
325
  static public function enqueue_all_custom_icons_styles() {
326
  $sets = self::get_sets();
327
 
328
+ foreach ( (array) $sets as $key => $data ) {
329
 
330
  // Don't enqueue core icons.
331
  if ( 'core' == $data['type'] ) {
395
  do_action( 'fl_builder_enqueue_styles_for_icon', $icon );
396
 
397
  // Is this a core icon?
398
+ if ( stristr( $icon, 'fa fa-' ) ) {
399
  wp_enqueue_style( 'font-awesome' );
400
+ } elseif ( stristr( $icon, 'far fa-' ) || stristr( $icon, 'fas fa-' ) || stristr( $icon, 'fab fa-' ) || stristr( $icon, 'fal fa-' ) ) {
401
+ wp_enqueue_style( 'font-awesome-5' );
402
  } elseif ( stristr( $icon, 'fi-' ) ) {
403
  wp_enqueue_style( 'foundation-icons' );
404
  } elseif ( stristr( $icon, 'dashicon' ) ) {
405
  wp_enqueue_style( 'dashicons' );
406
+ } else {
 
407
 
408
  $sets = self::get_sets();
409
 
classes/class-fl-builder-iframe-preview.php CHANGED
@@ -8,13 +8,23 @@
8
  final class FLBuilderIframePreview {
9
 
10
  /**
11
- * Initialize hooks.
12
  *
13
  * @since 2.0.6
14
  * @return void
15
  */
16
  static public function init() {
17
- if ( ! isset( $_GET['fl_builder_preview'] ) ) {
 
 
 
 
 
 
 
 
 
 
18
  return;
19
  }
20
 
8
  final class FLBuilderIframePreview {
9
 
10
  /**
11
+ * Initialize on plugins loaded.
12
  *
13
  * @since 2.0.6
14
  * @return void
15
  */
16
  static public function init() {
17
+ add_action( 'plugins_loaded', __CLASS__ . '::hook' );
18
+ }
19
+
20
+ /**
21
+ * Setup hooks.
22
+ *
23
+ * @since 2.1
24
+ * @return void
25
+ */
26
+ static public function hook() {
27
+ if ( ! FLBuilderModel::is_builder_draft_preview() ) {
28
  return;
29
  }
30
 
classes/class-fl-builder-importer.php CHANGED
@@ -98,7 +98,7 @@ class FLBuilderImportParserRegex extends WXR_Parser_Regex {
98
  if ( $in_post ) {
99
  $post .= $importline;
100
  }
101
- }// End while().
102
 
103
  $this->fclose( $fp );
104
 
@@ -113,7 +113,7 @@ class FLBuilderImportParserRegex extends WXR_Parser_Regex {
113
  }
114
  }
115
  }
116
- }// End if().
117
 
118
  if ( ! $wxr_version ) {
119
  return new WP_Error( 'WXR_parse_error', __( 'This does not appear to be a WXR file, missing/invalid WXR version number', 'fl-builder' ) );
98
  if ( $in_post ) {
99
  $post .= $importline;
100
  }
101
+ }
102
 
103
  $this->fclose( $fp );
104
 
113
  }
114
  }
115
  }
116
+ }
117
 
118
  if ( ! $wxr_version ) {
119
  return new WP_Error( 'WXR_parse_error', __( 'This does not appear to be a WXR file, missing/invalid WXR version number', 'fl-builder' ) );
classes/class-fl-builder-loader.php CHANGED
@@ -46,7 +46,7 @@ if ( ! class_exists( 'FLBuilderLoader' ) ) {
46
  * @return void
47
  */
48
  static private function define_constants() {
49
- define( 'FL_BUILDER_VERSION', '2.0.6.4' );
50
  define( 'FL_BUILDER_FILE', trailingslashit( dirname( dirname( __FILE__ ) ) ) . 'fl-builder.php' );
51
  define( 'FL_BUILDER_DIR', plugin_dir_path( FL_BUILDER_FILE ) );
52
  define( 'FL_BUILDER_URL', plugins_url( '/', FL_BUILDER_FILE ) );
@@ -70,6 +70,7 @@ if ( ! class_exists( 'FLBuilderLoader' ) ) {
70
  require_once FL_BUILDER_DIR . 'classes/class-fl-builder-filesystem.php';
71
  require_once FL_BUILDER_DIR . 'classes/class-fl-builder.php';
72
  require_once FL_BUILDER_DIR . 'classes/class-fl-builder-admin.php';
 
73
  require_once FL_BUILDER_DIR . 'classes/class-fl-builder-admin-posts.php';
74
  require_once FL_BUILDER_DIR . 'classes/class-fl-builder-admin-settings.php';
75
  require_once FL_BUILDER_DIR . 'classes/class-fl-builder-ajax.php';
@@ -80,6 +81,7 @@ if ( ! class_exists( 'FLBuilderLoader' ) ) {
80
  require_once FL_BUILDER_DIR . 'classes/class-fl-builder-extensions.php';
81
  require_once FL_BUILDER_DIR . 'classes/class-fl-builder-fonts.php';
82
  require_once FL_BUILDER_DIR . 'classes/class-fl-builder-debug.php';
 
83
  require_once FL_BUILDER_DIR . 'classes/class-fl-builder-icons.php';
84
  require_once FL_BUILDER_DIR . 'classes/class-fl-builder-iframe-preview.php';
85
  require_once FL_BUILDER_DIR . 'classes/class-fl-builder-import.php';
@@ -93,6 +95,7 @@ if ( ! class_exists( 'FLBuilderLoader' ) ) {
93
  require_once FL_BUILDER_DIR . 'classes/class-fl-builder-timezones.php';
94
  require_once FL_BUILDER_DIR . 'classes/class-fl-builder-ui-content-panel.php';
95
  require_once FL_BUILDER_DIR . 'classes/class-fl-builder-ui-settings-forms.php';
 
96
  require_once FL_BUILDER_DIR . 'classes/class-fl-builder-update.php';
97
  require_once FL_BUILDER_DIR . 'classes/class-fl-builder-user-access.php';
98
  require_once FL_BUILDER_DIR . 'classes/class-fl-builder-user-settings.php';
@@ -101,12 +104,19 @@ if ( ! class_exists( 'FLBuilderLoader' ) ) {
101
 
102
  /* WP CLI Commands */
103
  if ( defined( 'WP_CLI' ) ) {
104
- require __DIR__ . '/class-fl-builder-wpcli-command.php';
105
  }
106
 
 
 
 
107
  /* Includes */
108
  require_once FL_BUILDER_DIR . 'includes/compatibility.php';
109
- require_once FL_BUILDER_DIR . 'includes/updater/updater.php';
 
 
 
 
110
  }
111
 
112
  /**
@@ -178,6 +188,6 @@ if ( ! class_exists( 'FLBuilderLoader' ) ) {
178
  echo '</div>';
179
  }
180
  }
181
- }// End if().
182
 
183
  FLBuilderLoader::init();
46
  * @return void
47
  */
48
  static private function define_constants() {
49
+ define( 'FL_BUILDER_VERSION', '2.1.1.2' );
50
  define( 'FL_BUILDER_FILE', trailingslashit( dirname( dirname( __FILE__ ) ) ) . 'fl-builder.php' );
51
  define( 'FL_BUILDER_DIR', plugin_dir_path( FL_BUILDER_FILE ) );
52
  define( 'FL_BUILDER_URL', plugins_url( '/', FL_BUILDER_FILE ) );
70
  require_once FL_BUILDER_DIR . 'classes/class-fl-builder-filesystem.php';
71
  require_once FL_BUILDER_DIR . 'classes/class-fl-builder.php';
72
  require_once FL_BUILDER_DIR . 'classes/class-fl-builder-admin.php';
73
+ require_once FL_BUILDER_DIR . 'classes/class-fl-builder-admin-pointers.php';
74
  require_once FL_BUILDER_DIR . 'classes/class-fl-builder-admin-posts.php';
75
  require_once FL_BUILDER_DIR . 'classes/class-fl-builder-admin-settings.php';
76
  require_once FL_BUILDER_DIR . 'classes/class-fl-builder-ajax.php';
81
  require_once FL_BUILDER_DIR . 'classes/class-fl-builder-extensions.php';
82
  require_once FL_BUILDER_DIR . 'classes/class-fl-builder-fonts.php';
83
  require_once FL_BUILDER_DIR . 'classes/class-fl-builder-debug.php';
84
+ require_once FL_BUILDER_DIR . 'classes/class-fl-builder-usage.php';
85
  require_once FL_BUILDER_DIR . 'classes/class-fl-builder-icons.php';
86
  require_once FL_BUILDER_DIR . 'classes/class-fl-builder-iframe-preview.php';
87
  require_once FL_BUILDER_DIR . 'classes/class-fl-builder-import.php';
95
  require_once FL_BUILDER_DIR . 'classes/class-fl-builder-timezones.php';
96
  require_once FL_BUILDER_DIR . 'classes/class-fl-builder-ui-content-panel.php';
97
  require_once FL_BUILDER_DIR . 'classes/class-fl-builder-ui-settings-forms.php';
98
+ require_once FL_BUILDER_DIR . 'classes/class-fl-builder-notifications.php';
99
  require_once FL_BUILDER_DIR . 'classes/class-fl-builder-update.php';
100
  require_once FL_BUILDER_DIR . 'classes/class-fl-builder-user-access.php';
101
  require_once FL_BUILDER_DIR . 'classes/class-fl-builder-user-settings.php';
104
 
105
  /* WP CLI Commands */
106
  if ( defined( 'WP_CLI' ) ) {
107
+ require_once FL_BUILDER_DIR . 'classes/class-fl-builder-wpcli-command.php';
108
  }
109
 
110
+ /* WP Blocks Support */
111
+ require_once FL_BUILDER_DIR . 'classes/class-fl-builder-wp-blocks.php';
112
+
113
  /* Includes */
114
  require_once FL_BUILDER_DIR . 'includes/compatibility.php';
115
+
116
+ /* Updater */
117
+ if ( file_exists( FL_BUILDER_DIR . 'includes/updater/updater.php' ) ) {
118
+ require_once FL_BUILDER_DIR . 'includes/updater/updater.php';
119
+ }
120
  }
121
 
122
  /**
188
  echo '</div>';
189
  }
190
  }
191
+ }
192
 
193
  FLBuilderLoader::init();
classes/class-fl-builder-loop.php CHANGED
@@ -140,12 +140,17 @@ final class FLBuilderLoop {
140
  * @return object A WP_Query instance.
141
  */
142
  static public function custom_query( $settings ) {
 
143
  $posts_per_page = empty( $settings->posts_per_page ) ? 10 : $settings->posts_per_page;
144
- $post_type = empty( $settings->post_type ) ? 'post' : $settings->post_type;
145
- $order_by = empty( $settings->order_by ) ? 'date' : $settings->order_by;
146
- $order = empty( $settings->order ) ? 'DESC' : $settings->order;
147
- $users = empty( $settings->users ) ? '' : $settings->users;
148
- $fields = empty( $settings->fields ) ? '' : $settings->fields;
 
 
 
 
149
 
150
  $paged = self::get_paged();
151
 
@@ -271,7 +276,7 @@ final class FLBuilderLoop {
271
  $term_ids = $related;
272
  }
273
  }
274
- }// End if().
275
 
276
  if ( ! empty( $term_ids ) ) {
277
 
@@ -282,7 +287,7 @@ final class FLBuilderLoop {
282
  'operator' => $operator,
283
  );
284
  }
285
- }// End foreach().
286
 
287
  // Post in/not in query.
288
  if ( isset( $settings->{'posts_' . $post_type} ) ) {
@@ -303,6 +308,10 @@ final class FLBuilderLoop {
303
  }
304
  }
305
 
 
 
 
 
306
  $args = apply_filters( 'fl_builder_loop_query_args', $args );
307
 
308
  // Build the query.
@@ -695,7 +704,7 @@ final class FLBuilderLoop {
695
  $total_pages = $query->max_num_pages;
696
  $permalink_structure = get_option( 'permalink_structure' );
697
  $paged = self::get_paged();
698
- $base = untrailingslashit( html_entity_decode( get_pagenum_link() ) );
699
 
700
  if ( $total_pages > 1 ) {
701
 
@@ -773,8 +782,12 @@ final class FLBuilderLoop {
773
  $base = strtok( $base, '?' );
774
  }
775
 
776
- $base = untrailingslashit( $base );
777
-
 
 
 
 
778
  } else {
779
  $url_params = wp_parse_url( $base, PHP_URL_QUERY );
780
 
@@ -802,7 +815,8 @@ final class FLBuilderLoop {
802
  }
803
 
804
  if ( ! empty( $permalink_structure ) ) {
805
- $format = ! empty( $page_prefix ) ? '/' . $page_prefix . '/' : '/';
 
806
  $format .= '%#%';
807
  $format .= substr( $permalink_structure, -1 ) == '/' ? '/' : '';
808
  } elseif ( empty( $permalink_structure ) || is_search() ) {
140
  * @return object A WP_Query instance.
141
  */
142
  static public function custom_query( $settings ) {
143
+ global $post;
144
  $posts_per_page = empty( $settings->posts_per_page ) ? 10 : $settings->posts_per_page;
145
+ $post_type = empty( $settings->post_type ) ? 'post' : $settings->post_type;
146
+ $order_by = empty( $settings->order_by ) ? 'date' : $settings->order_by;
147
+ $order = empty( $settings->order ) ? 'DESC' : $settings->order;
148
+ $users = empty( $settings->users ) ? '' : $settings->users;
149
+ $fields = empty( $settings->fields ) ? '' : $settings->fields;
150
+ $exclude_self = '';
151
+ if ( isset( $settings->exclude_self ) && 'yes' == $settings->exclude_self ) {
152
+ $exclude_self = $post->ID;
153
+ }
154
 
155
  $paged = self::get_paged();
156
 
276
  $term_ids = $related;
277
  }
278
  }
279
+ }
280
 
281
  if ( ! empty( $term_ids ) ) {
282
 
287
  'operator' => $operator,
288
  );
289
  }
290
+ }
291
 
292
  // Post in/not in query.
293
  if ( isset( $settings->{'posts_' . $post_type} ) ) {
308
  }
309
  }
310
 
311
+ if ( $exclude_self ) {
312
+ $args['post__not_in'][] = $exclude_self;
313
+ }
314
+
315
  $args = apply_filters( 'fl_builder_loop_query_args', $args );
316
 
317
  // Build the query.
704
  $total_pages = $query->max_num_pages;
705
  $permalink_structure = get_option( 'permalink_structure' );
706
  $paged = self::get_paged();
707
+ $base = html_entity_decode( get_pagenum_link() );
708
 
709
  if ( $total_pages > 1 ) {
710
 
782
  $base = strtok( $base, '?' );
783
  }
784
 
785
+ // Add trailing slash when necessary.
786
+ if ( '/' == substr( $permalink_structure, -1 ) ) {
787
+ $base = trailingslashit( $base );
788
+ } else {
789
+ $base = untrailingslashit( $base );
790
+ }
791
  } else {
792
  $url_params = wp_parse_url( $base, PHP_URL_QUERY );
793
 
815
  }
816
 
817
  if ( ! empty( $permalink_structure ) ) {
818
+ $format = substr( $base, -1 ) != '/' ? '/' : '';
819
+ $format .= $page_prefix . '/';
820
  $format .= '%#%';
821
  $format .= substr( $permalink_structure, -1 ) == '/' ? '/' : '';
822
  } elseif ( empty( $permalink_structure ) || is_search() ) {
classes/class-fl-builder-model.php CHANGED
@@ -433,11 +433,12 @@ final class FLBuilderModel {
433
 
434
  if ( is_singular() && isset( $wp_the_query->post ) ) {
435
 
436
- $post = $wp_the_query->post;
437
- $post_types = self::get_post_types();
438
- $user_can = current_user_can( 'edit_post', $post->ID );
 
439
 
440
- if ( in_array( $post->post_type, $post_types ) && $user_can ) {
441
  $editable = true;
442
  }
443
  }
@@ -473,7 +474,7 @@ final class FLBuilderModel {
473
  global $wp_the_query;
474
 
475
  // If in iframe preview return true as the post might not be a draft yet.
476
- if ( isset( $_GET['fl_builder_preview'] ) ) {
477
  return true;
478
  }
479
 
@@ -524,6 +525,16 @@ final class FLBuilderModel {
524
  return self::$active;
525
  }
526
 
 
 
 
 
 
 
 
 
 
 
527
  /**
528
  * Checks to see if this is the first time
529
  * a user has launched the builder.
@@ -593,15 +604,16 @@ final class FLBuilderModel {
593
  $post = $wp_the_query->post;
594
  $published = self::get_layout_data( 'published' );
595
  $draft = self::get_layout_data( 'draft' );
 
596
 
597
  // Migrate existing post content to the builder?
598
- if ( empty( $published ) && empty( $draft ) && ! empty( $post->post_content ) ) {
599
 
600
  $row = self::add_row();
601
  $cols = self::get_nodes( 'column' );
602
  $col = array_shift( $cols );
603
  $settings = self::get_module_defaults( 'rich-text' );
604
- $settings->text = apply_filters( 'fl_builder_migrated_post_content', wpautop( $post->post_content ) );
605
 
606
  self::add_module( 'rich-text', $settings, $col->node );
607
  } elseif ( empty( $draft ) ) {
@@ -709,8 +721,9 @@ final class FLBuilderModel {
709
  static public function get_asset_version() {
710
  $post_id = self::get_post_id();
711
  $active = self::is_builder_active();
 
712
 
713
- if ( $active ) {
714
  return md5( uniqid() );
715
  } else {
716
  return md5( get_post_modified_time( 'U', false, $post_id ) );
@@ -728,10 +741,12 @@ final class FLBuilderModel {
728
  $post_data = self::get_post_data();
729
  $post_id = self::get_post_id();
730
  $cache_dir = self::get_cache_dir();
 
 
731
 
732
  if ( isset( $post_data['node_preview'] ) ) {
733
  $suffix = '-layout-preview';
734
- } elseif ( self::is_builder_active() ) {
735
  $suffix = '-layout-draft';
736
  } else {
737
  $suffix = '-layout';
@@ -1170,6 +1185,37 @@ final class FLBuilderModel {
1170
 
1171
  if ( self::is_post_user_template( 'module' ) ) {
1172
  $nodes['modules'] = self::get_all_modules();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1173
  } else {
1174
  $rows = self::get_nodes( 'row' );
1175
 
@@ -1214,9 +1260,9 @@ final class FLBuilderModel {
1214
  }
1215
  }
1216
  }
1217
- }// End foreach().
1218
- }// End foreach().
1219
- }// End if().
1220
 
1221
  return $nodes;
1222
  }
@@ -1236,10 +1282,25 @@ final class FLBuilderModel {
1236
 
1237
  // Get the node settings for a node template's root node?
1238
  if ( self::is_node_template_root( $node ) && ! self::is_post_node_template() ) {
1239
- $template_post_id = self::get_node_template_post_id( $node->template_id );
1240
- $template_data = self::get_layout_data( 'published', $template_post_id );
1241
- $template_node = $template_data[ $node->template_node_id ];
1242
- $node->settings = $template_node->settings;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1243
  }
1244
 
1245
  // Get either the preview settings or saved node settings merged with the defaults.
@@ -1259,6 +1320,10 @@ final class FLBuilderModel {
1259
 
1260
  if ( 'module' == $node->type ) {
1261
  $settings = self::merge_nested_module_defaults( $node->settings->type, $settings );
 
 
 
 
1262
  }
1263
  }
1264
 
@@ -1572,6 +1637,7 @@ final class FLBuilderModel {
1572
  $new_row_id = self::generate_node_id();
1573
  $col_groups = self::get_nodes( 'column-group', $row );
1574
  $new_nodes = array();
 
1575
 
1576
  // Add the new row.
1577
  $layout_data[ $new_row_id ] = clone $row;
@@ -1621,7 +1687,7 @@ final class FLBuilderModel {
1621
  }
1622
  }
1623
  }
1624
- }// End foreach().
1625
 
1626
  // Apply settings that were passed if we have them.
1627
  if ( $settings && $settings_id ) {
@@ -1637,11 +1703,21 @@ final class FLBuilderModel {
1637
 
1638
  // Set col group parent ids to the new row id and unset template data.
1639
  foreach ( $new_nodes as $child_node_id => $child ) {
 
 
 
 
 
1640
  if ( 'column-group' == $child->type ) {
1641
  if ( $child->parent == $row->node || ( isset( $row->template_node_id ) && $child->parent == $row->template_node_id ) ) {
1642
  $new_nodes[ $child_node_id ]->parent = $new_row_id;
1643
  }
 
 
 
 
1644
  }
 
1645
  if ( isset( $new_nodes[ $child_node_id ]->template_id ) ) {
1646
  unset( $new_nodes[ $child_node_id ]->template_id );
1647
  unset( $new_nodes[ $child_node_id ]->template_node_id );
@@ -1668,7 +1744,9 @@ final class FLBuilderModel {
1668
  * @return object
1669
  */
1670
  static public function get_row_defaults() {
1671
- return self::get_settings_form_defaults( 'row' );
 
 
1672
  }
1673
 
1674
  /**
@@ -1896,7 +1974,7 @@ final class FLBuilderModel {
1896
  $data[ $col_node_id ]->template_node_id = $col_node_id;
1897
  }
1898
  }
1899
- } else {
1900
 
1901
  $old_group = $data[ $cols ]->parent;
1902
  $siblings = self::get_nodes( 'column', $old_group );
@@ -1920,7 +1998,7 @@ final class FLBuilderModel {
1920
  $data[ $sibling->node ]->position = $sibling_pos;
1921
  $sibling_pos++;
1922
  }
1923
- }// End if().
1924
 
1925
  // Update the layout data.
1926
  self::update_layout_data( $data );
@@ -2349,6 +2427,66 @@ final class FLBuilderModel {
2349
  return $parent;
2350
  }
2351
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2352
  /**
2353
  * Copys a column and adds it to the current layout.
2354
  *
@@ -2374,8 +2512,14 @@ final class FLBuilderModel {
2374
  // Unset column template data.
2375
  if ( isset( $layout_data[ $new_col_id ]->template_id ) ) {
2376
 
 
 
 
 
 
2377
  // Check if parent is a global node.
2378
  if ( self::is_node_global( $parent ) ) {
 
2379
  $layout_data[ $new_col_id ]->template_node_id = $new_col_id;
2380
  } else {
2381
  unset( $layout_data[ $new_col_id ]->template_id );
@@ -2429,7 +2573,8 @@ final class FLBuilderModel {
2429
  }
2430
  if ( isset( $new_nodes[ $child_node_id ]->template_id ) ) {
2431
  // Check if the column is global.
2432
- if ( $layout_data[ $new_col_id ]->template_node_id ) {
 
2433
  $new_nodes[ $child_node_id ]->template_node_id = $child_node_id;
2434
  } else {
2435
  unset( $new_nodes[ $child_node_id ]->template_id );
@@ -2461,7 +2606,9 @@ final class FLBuilderModel {
2461
  * @return object
2462
  */
2463
  static public function get_col_defaults() {