class-fl-builder-admin-settings.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693
  1. <?php
  2. /**
  3. * Handles logic for the admin settings page.
  4. *
  5. * @since 1.0
  6. */
  7. final class FLBuilderAdminSettings {
  8. /**
  9. * Holds any errors that may arise from
  10. * saving admin settings.
  11. *
  12. * @since 1.0
  13. * @var array $errors
  14. */
  15. static public $errors = array();
  16. /**
  17. * Initializes the admin settings.
  18. *
  19. * @since 1.0
  20. * @return void
  21. */
  22. static public function init() {
  23. add_action( 'after_setup_theme', __CLASS__ . '::init_hooks', 11 );
  24. }
  25. /**
  26. * Adds the admin menu and enqueues CSS/JS if we are on
  27. * the builder admin settings page.
  28. *
  29. * @since 1.0
  30. * @return void
  31. */
  32. static public function init_hooks() {
  33. if ( ! is_admin() ) {
  34. return;
  35. }
  36. add_action( 'admin_menu', __CLASS__ . '::menu' );
  37. if ( isset( $_REQUEST['page'] ) && 'fl-builder-settings' == $_REQUEST['page'] ) {
  38. add_action( 'admin_enqueue_scripts', __CLASS__ . '::styles_scripts' );
  39. add_filter( 'admin_footer_text', array( __CLASS__, '_filter_admin_footer_text' ) );
  40. self::save();
  41. }
  42. }
  43. /**
  44. * Enqueues the needed CSS/JS for the builder's admin settings page.
  45. *
  46. * @since 1.0
  47. * @return void
  48. */
  49. static public function styles_scripts() {
  50. // Styles
  51. wp_enqueue_style( 'fl-builder-admin-settings', FL_BUILDER_URL . 'css/fl-builder-admin-settings.css', array(), FL_BUILDER_VERSION );
  52. wp_enqueue_style( 'jquery-multiselect', FL_BUILDER_URL . 'css/jquery.multiselect.css', array(), FL_BUILDER_VERSION );
  53. wp_enqueue_style( 'jquery-tiptip', FL_BUILDER_URL . 'css/jquery.tiptip.css', array(), FL_BUILDER_VERSION );
  54. // Scripts
  55. wp_enqueue_script( 'fl-builder-admin-settings', FL_BUILDER_URL . 'js/fl-builder-admin-settings.js', array(), FL_BUILDER_VERSION );
  56. wp_enqueue_script( 'jquery-actual', FL_BUILDER_URL . 'js/jquery.actual.min.js', array( 'jquery' ), FL_BUILDER_VERSION );
  57. wp_enqueue_script( 'jquery-multiselect', FL_BUILDER_URL . 'js/jquery.multiselect.js', array( 'jquery' ), FL_BUILDER_VERSION );
  58. wp_enqueue_script( 'jquery-tiptip', FL_BUILDER_URL . 'js/jquery.tiptip.min.js', array( 'jquery' ), FL_BUILDER_VERSION, true );
  59. // Media Uploader
  60. wp_enqueue_media();
  61. }
  62. /**
  63. * Renders the admin settings menu.
  64. *
  65. * @since 1.0
  66. * @return void
  67. */
  68. static public function menu() {
  69. if ( current_user_can( 'delete_users' ) ) {
  70. $title = FLBuilderModel::get_branding();
  71. $cap = 'delete_users';
  72. $slug = 'fl-builder-settings';
  73. $func = __CLASS__ . '::render';
  74. add_submenu_page( 'options-general.php', $title, $title, $cap, $slug, $func );
  75. }
  76. }
  77. /**
  78. * Renders the admin settings.
  79. *
  80. * @since 1.0
  81. * @return void
  82. */
  83. static public function render() {
  84. include FL_BUILDER_DIR . 'includes/admin-settings-js-config.php';
  85. include FL_BUILDER_DIR . 'includes/admin-settings.php';
  86. }
  87. /**
  88. * Renders the page class for network installs and single site installs.
  89. *
  90. * @since 1.0
  91. * @return void
  92. */
  93. static public function render_page_class() {
  94. if ( self::multisite_support() ) {
  95. echo 'fl-settings-network-admin';
  96. } else {
  97. echo 'fl-settings-single-install';
  98. }
  99. }
  100. /**
  101. * Renders the admin settings page heading.
  102. *
  103. * @since 1.0
  104. * @return void
  105. */
  106. static public function render_page_heading() {
  107. $icon = FLBuilderModel::get_branding_icon();
  108. $name = FLBuilderModel::get_branding();
  109. if ( ! empty( $icon ) ) {
  110. echo '<img role="presentation" src="' . $icon . '" />';
  111. }
  112. echo '<span>' . sprintf( _x( '%s Settings', '%s stands for custom branded "Page Builder" name.', 'fl-builder' ), FLBuilderModel::get_branding() ) . '</span>';
  113. }
  114. /**
  115. * Renders the update message.
  116. *
  117. * @since 1.0
  118. * @return void
  119. */
  120. static public function render_update_message() {
  121. if ( ! empty( self::$errors ) ) {
  122. foreach ( self::$errors as $message ) {
  123. echo '<div class="error"><p>' . $message . '</p></div>';
  124. }
  125. } elseif ( ! empty( $_POST ) && ! isset( $_POST['email'] ) ) {
  126. echo '<div class="updated"><p>' . __( 'Settings updated!', 'fl-builder' ) . '</p></div>';
  127. }
  128. }
  129. /**
  130. * Renders the nav items for the admin settings menu.
  131. *
  132. * @since 1.0
  133. * @return void
  134. */
  135. static public function render_nav_items() {
  136. $item_data = apply_filters( 'fl_builder_admin_settings_nav_items', array(
  137. 'welcome' => array(
  138. 'title' => __( 'Welcome', 'fl-builder' ),
  139. 'show' => ! FLBuilderModel::is_white_labeled() && ( is_network_admin() || ! self::multisite_support() ),
  140. 'priority' => 50,
  141. ),
  142. 'license' => array(
  143. 'title' => __( 'License', 'fl-builder' ),
  144. 'show' => FL_BUILDER_LITE !== true && ( is_network_admin() || ! self::multisite_support() ),
  145. 'priority' => 100,
  146. ),
  147. 'upgrade' => array(
  148. 'title' => __( 'Upgrade', 'fl-builder' ),
  149. 'show' => FL_BUILDER_LITE === true,
  150. 'priority' => 200,
  151. ),
  152. 'modules' => array(
  153. 'title' => __( 'Modules', 'fl-builder' ),
  154. 'show' => true,
  155. 'priority' => 300,
  156. ),
  157. 'post-types' => array(
  158. 'title' => __( 'Post Types', 'fl-builder' ),
  159. 'show' => true,
  160. 'priority' => 400,
  161. ),
  162. 'user-access' => array(
  163. 'title' => __( 'User Access', 'fl-builder' ),
  164. 'show' => true,
  165. 'priority' => 500,
  166. ),
  167. 'icons' => array(
  168. 'title' => __( 'Icons', 'fl-builder' ),
  169. 'show' => FL_BUILDER_LITE !== true,
  170. 'priority' => 600,
  171. ),
  172. 'tools' => array(
  173. 'title' => __( 'Tools', 'fl-builder' ),
  174. 'show' => true,
  175. 'priority' => 700,
  176. ),
  177. ) );
  178. $sorted_data = array();
  179. foreach ( $item_data as $key => $data ) {
  180. $data['key'] = $key;
  181. $sorted_data[ $data['priority'] ] = $data;
  182. }
  183. ksort( $sorted_data );
  184. foreach ( $sorted_data as $data ) {
  185. if ( $data['show'] ) {
  186. echo '<li><a href="#' . $data['key'] . '">' . $data['title'] . '</a></li>';
  187. }
  188. }
  189. }
  190. /**
  191. * Renders the admin settings forms.
  192. *
  193. * @since 1.0
  194. * @return void
  195. */
  196. static public function render_forms() {
  197. // Welcome
  198. if ( ! FLBuilderModel::is_white_labeled() && ( is_network_admin() || ! self::multisite_support() ) ) {
  199. self::render_form( 'welcome' );
  200. }
  201. // License
  202. if ( is_network_admin() || ! self::multisite_support() ) {
  203. self::render_form( 'license' );
  204. }
  205. // Upgrade
  206. if ( FL_BUILDER_LITE === true ) {
  207. self::render_form( 'upgrade' );
  208. }
  209. // Modules
  210. self::render_form( 'modules' );
  211. // Post Types
  212. self::render_form( 'post-types' );
  213. // Icons
  214. self::render_form( 'icons' );
  215. // User Access
  216. self::render_form( 'user-access' );
  217. // Tools
  218. self::render_form( 'tools' );
  219. // Let extensions hook into form rendering.
  220. do_action( 'fl_builder_admin_settings_render_forms' );
  221. }
  222. /**
  223. * Renders an admin settings form based on the type specified.
  224. *
  225. * @since 1.0
  226. * @param string $type The type of form to render.
  227. * @return void
  228. */
  229. static public function render_form( $type ) {
  230. if ( self::has_support( $type ) ) {
  231. include FL_BUILDER_DIR . 'includes/admin-settings-' . $type . '.php';
  232. }
  233. }
  234. /**
  235. * Renders the action for a form.
  236. *
  237. * @since 1.0
  238. * @param string $type The type of form being rendered.
  239. * @return void
  240. */
  241. static public function render_form_action( $type = '' ) {
  242. if ( is_network_admin() ) {
  243. echo network_admin_url( '/settings.php?page=fl-builder-multisite-settings#' . $type );
  244. } else {
  245. echo admin_url( '/options-general.php?page=fl-builder-settings#' . $type );
  246. }
  247. }
  248. /**
  249. * Returns the action for a form.
  250. *
  251. * @since 1.0
  252. * @param string $type The type of form being rendered.
  253. * @return string The URL for the form action.
  254. */
  255. static public function get_form_action( $type = '' ) {
  256. if ( is_network_admin() ) {
  257. return network_admin_url( '/settings.php?page=fl-builder-multisite-settings#' . $type );
  258. } else {
  259. return admin_url( '/options-general.php?page=fl-builder-settings#' . $type );
  260. }
  261. }
  262. /**
  263. * Checks to see if a settings form is supported.
  264. *
  265. * @since 1.0
  266. * @param string $type The type of form to check.
  267. * @return bool
  268. */
  269. static public function has_support( $type ) {
  270. return file_exists( FL_BUILDER_DIR . 'includes/admin-settings-' . $type . '.php' );
  271. }
  272. /**
  273. * Checks to see if multisite is supported.
  274. *
  275. * @since 1.0
  276. * @return bool
  277. */
  278. static public function multisite_support() {
  279. return is_multisite() && class_exists( 'FLBuilderMultisiteSettings' );
  280. }
  281. /**
  282. * Adds an error message to be rendered.
  283. *
  284. * @since 1.0
  285. * @param string $message The error message to add.
  286. * @return void
  287. */
  288. static public function add_error( $message ) {
  289. self::$errors[] = $message;
  290. }
  291. /**
  292. * Saves the admin settings.
  293. *
  294. * @since 1.0
  295. * @return void
  296. */
  297. static public function save() {
  298. // Only admins can save settings.
  299. if ( ! current_user_can( 'delete_users' ) ) {
  300. return;
  301. }
  302. self::save_enabled_modules();
  303. self::save_enabled_post_types();
  304. self::save_enabled_icons();
  305. self::save_user_access();
  306. self::clear_cache();
  307. self::debug();
  308. self::uninstall();
  309. // Let extensions hook into saving.
  310. do_action( 'fl_builder_admin_settings_save' );
  311. }
  312. /**
  313. * Saves the enabled modules.
  314. *
  315. * @since 1.0
  316. * @access private
  317. * @return void
  318. */
  319. static private function save_enabled_modules() {
  320. if ( isset( $_POST['fl-modules-nonce'] ) && wp_verify_nonce( $_POST['fl-modules-nonce'], 'modules' ) ) {
  321. $modules = array();
  322. if ( isset( $_POST['fl-modules'] ) && is_array( $_POST['fl-modules'] ) ) {
  323. $modules = array_map( 'sanitize_text_field', $_POST['fl-modules'] );
  324. }
  325. if ( empty( $modules ) ) {
  326. self::add_error( __( 'Error! You must have at least one module enabled.', 'fl-builder' ) );
  327. return;
  328. }
  329. FLBuilderModel::update_admin_settings_option( '_fl_builder_enabled_modules', $modules, true );
  330. }
  331. }
  332. /**
  333. * Saves the enabled post types.
  334. *
  335. * @since 1.0
  336. * @access private
  337. * @return void
  338. */
  339. static private function save_enabled_post_types() {
  340. if ( isset( $_POST['fl-post-types-nonce'] ) && wp_verify_nonce( $_POST['fl-post-types-nonce'], 'post-types' ) ) {
  341. if ( is_network_admin() ) {
  342. $post_types = sanitize_text_field( $_POST['fl-post-types'] );
  343. $post_types = str_replace( ' ', '', $post_types );
  344. $post_types = explode( ',', $post_types );
  345. } else {
  346. $post_types = array();
  347. if ( isset( $_POST['fl-post-types'] ) && is_array( $_POST['fl-post-types'] ) ) {
  348. $post_types = array_map( 'sanitize_text_field', $_POST['fl-post-types'] );
  349. }
  350. }
  351. FLBuilderModel::update_admin_settings_option( '_fl_builder_post_types', $post_types, true );
  352. }
  353. }
  354. /**
  355. * Saves the enabled icons.
  356. *
  357. * @since 1.0
  358. * @access private
  359. * @return void
  360. */
  361. static private function save_enabled_icons() {
  362. if ( isset( $_POST['fl-icons-nonce'] ) && wp_verify_nonce( $_POST['fl-icons-nonce'], 'icons' ) ) {
  363. // Make sure we have at least one enabled icon set.
  364. if ( ! isset( $_POST['fl-enabled-icons'] ) && empty( $_POST['fl-new-icon-set'] ) ) {
  365. self::add_error( __( 'Error! You must have at least one icon set enabled.', 'fl-builder' ) );
  366. return;
  367. }
  368. $enabled_icons = array();
  369. // Sanitize the enabled icons.
  370. if ( isset( $_POST['fl-enabled-icons'] ) && is_array( $_POST['fl-enabled-icons'] ) ) {
  371. $enabled_icons = array_map( 'sanitize_text_field', $_POST['fl-enabled-icons'] );
  372. }
  373. // we cant have fa4 and fa5 active at same time.
  374. 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 ) ) {
  375. 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' ) );
  376. return;
  377. }
  378. // Update the enabled sets.
  379. self::update_enabled_icons( $enabled_icons );
  380. // Delete a set?
  381. if ( ! empty( $_POST['fl-delete-icon-set'] ) ) {
  382. $sets = FLBuilderIcons::get_sets();
  383. $key = sanitize_text_field( $_POST['fl-delete-icon-set'] );
  384. $index = array_search( $key, $enabled_icons );
  385. if ( false !== $index ) {
  386. unset( $enabled_icons[ $index ] );
  387. }
  388. if ( isset( $sets[ $key ] ) ) {
  389. fl_builder_filesystem()->rmdir( $sets[ $key ]['path'], true );
  390. FLBuilderIcons::remove_set( $key );
  391. }
  392. }
  393. // Upload a new set?
  394. if ( ! empty( $_POST['fl-new-icon-set'] ) ) {
  395. $dir = FLBuilderModel::get_cache_dir( 'icons' );
  396. $id = (int) $_POST['fl-new-icon-set'];
  397. $path = get_attached_file( $id );
  398. $new_path = $dir['path'] . 'icon-' . time() . '/';
  399. fl_builder_filesystem()->get_filesystem();
  400. $unzipped = unzip_file( $path, $new_path );
  401. // Unzip failed.
  402. if ( ! $unzipped ) {
  403. self::add_error( __( 'Error! Could not unzip file.', 'fl-builder' ) );
  404. return;
  405. }
  406. // Move files if unzipped into a subfolder.
  407. $files = fl_builder_filesystem()->dirlist( $new_path );
  408. if ( 1 == count( $files ) ) {
  409. $values = array_values( $files );
  410. $subfolder_info = array_shift( $values );
  411. $subfolder = $new_path . $subfolder_info['name'] . '/';
  412. if ( fl_builder_filesystem()->file_exists( $subfolder ) && fl_builder_filesystem()->is_dir( $subfolder ) ) {
  413. $files = fl_builder_filesystem()->dirlist( $subfolder );
  414. if ( $files ) {
  415. foreach ( $files as $file ) {
  416. fl_builder_filesystem()->move( $subfolder . $file['name'], $new_path . $file['name'] );
  417. }
  418. }
  419. fl_builder_filesystem()->rmdir( $subfolder );
  420. }
  421. }
  422. // Check for supported sets.
  423. $is_icomoon = fl_builder_filesystem()->file_exists( $new_path . 'selection.json' );
  424. $is_fontello = fl_builder_filesystem()->file_exists( $new_path . 'config.json' );
  425. // Show an error if we don't have a supported icon set.
  426. if ( ! $is_icomoon && ! $is_fontello ) {
  427. fl_builder_filesystem()->rmdir( $new_path, true );
  428. self::add_error( __( 'Error! Please upload an icon set from either Icomoon or Fontello.', 'fl-builder' ) );
  429. return;
  430. }
  431. // check for valid Icomoon
  432. if ( $is_icomoon ) {
  433. $data = json_decode( fl_builder_filesystem()->file_get_contents( $new_path . 'selection.json' ) );
  434. if ( ! isset( $data->metadata ) ) {
  435. fl_builder_filesystem()->rmdir( $new_path, true );
  436. self::add_error( __( 'Error! When downloading from Icomoon, be sure to click the Download Font button and not Generate SVG.', 'fl-builder' ) );
  437. return;
  438. }
  439. }
  440. // Enable the new set.
  441. if ( is_array( $enabled_icons ) ) {
  442. $key = FLBuilderIcons::get_key_from_path( $new_path );
  443. $enabled_icons[] = $key;
  444. }
  445. }
  446. // Update the enabled sets again in case they have changed.
  447. self::update_enabled_icons( $enabled_icons );
  448. }
  449. }
  450. /**
  451. * Updates the enabled icons in the database.
  452. *
  453. * @since 1.0
  454. * @access private
  455. * @return void
  456. */
  457. static private function update_enabled_icons( $enabled_icons = array() ) {
  458. FLBuilderModel::update_admin_settings_option( '_fl_builder_enabled_icons', $enabled_icons, true );
  459. }
  460. /**
  461. * Saves the user access settings
  462. *
  463. * @since 1.10
  464. * @access private
  465. * @return void
  466. */
  467. static private function save_user_access() {
  468. if ( isset( $_POST['fl-user-access-nonce'] ) && wp_verify_nonce( $_POST['fl-user-access-nonce'], 'user-access' ) ) {
  469. FLBuilderUserAccess::save_settings( isset( $_POST['fl_user_access'] ) ? $_POST['fl_user_access'] : array() );
  470. }
  471. }
  472. /**
  473. * Clears the builder cache.
  474. *
  475. * @since 1.5.3
  476. * @access private
  477. * @return void
  478. */
  479. static private function clear_cache() {
  480. if ( ! current_user_can( 'delete_users' ) ) {
  481. return;
  482. } elseif ( isset( $_POST['fl-cache-nonce'] ) && wp_verify_nonce( $_POST['fl-cache-nonce'], 'cache' ) ) {
  483. if ( is_network_admin() ) {
  484. self::clear_cache_for_all_sites();
  485. } else {
  486. // Clear builder cache.
  487. FLBuilderModel::delete_asset_cache_for_all_posts();
  488. // Clear theme cache.
  489. if ( class_exists( 'FLCustomizer' ) && method_exists( 'FLCustomizer', 'clear_all_css_cache' ) ) {
  490. FLCustomizer::clear_all_css_cache();
  491. }
  492. }
  493. do_action( 'fl_builder_cache_cleared' );
  494. }
  495. }
  496. /**
  497. * Enable/disable debug
  498. *
  499. * @since 1.10.7
  500. * @access private
  501. * @return void
  502. */
  503. static private function debug() {
  504. if ( ! current_user_can( 'delete_users' ) ) {
  505. return;
  506. } elseif ( isset( $_POST['fl-debug-nonce'] ) && wp_verify_nonce( $_POST['fl-debug-nonce'], 'debug' ) ) {
  507. $debugmode = get_option( 'fl_debug_mode', false );
  508. if ( ! $debugmode ) {
  509. update_option( 'fl_debug_mode', md5( rand() ) );
  510. } else {
  511. delete_option( 'fl_debug_mode' );
  512. }
  513. }
  514. }
  515. /**
  516. * Clears the builder cache for all sites on a network.
  517. *
  518. * @since 1.5.3
  519. * @access private
  520. * @return void
  521. */
  522. static private function clear_cache_for_all_sites() {
  523. global $blog_id;
  524. global $wpdb;
  525. // Save the original blog id.
  526. $original_blog_id = $blog_id;
  527. // Get all blog ids.
  528. $blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
  529. // Loop through the blog ids and clear the cache.
  530. foreach ( $blog_ids as $id ) {
  531. // Switch to the blog.
  532. switch_to_blog( $id );
  533. // Clear builder cache.
  534. FLBuilderModel::delete_asset_cache_for_all_posts();
  535. // Clear theme cache.
  536. if ( class_exists( 'FLCustomizer' ) && method_exists( 'FLCustomizer', 'clear_all_css_cache' ) ) {
  537. FLCustomizer::clear_all_css_cache();
  538. }
  539. }
  540. // Revert to the original blog.
  541. switch_to_blog( $original_blog_id );
  542. }
  543. /**
  544. * Uninstalls the builder and all of its data.
  545. *
  546. * @since 1.0
  547. * @access private
  548. * @return void
  549. */
  550. static private function uninstall() {
  551. if ( ! current_user_can( 'delete_plugins' ) ) {
  552. return;
  553. } elseif ( isset( $_POST['fl-uninstall'] ) && wp_verify_nonce( $_POST['fl-uninstall'], 'uninstall' ) ) {
  554. $uninstall = apply_filters( 'fl_builder_uninstall', true );
  555. if ( $uninstall ) {
  556. FLBuilderAdmin::uninstall();
  557. }
  558. }
  559. }
  560. /**
  561. * @since 1.0
  562. * @deprecated 1.8
  563. */
  564. static private function save_help_button() {
  565. _deprecated_function( __METHOD__, '1.8', 'FLBuilderWhiteLabel::save_help_button_settings()' );
  566. }
  567. /**
  568. * @since 1.0
  569. * @deprecated 1.8
  570. */
  571. static private function save_branding() {
  572. _deprecated_function( __METHOD__, '1.8', 'FLBuilderWhiteLabel::save_branding_settings()' );
  573. }
  574. /**
  575. * @since 1.0
  576. * @deprecated 1.8
  577. */
  578. static private function save_enabled_templates() {
  579. _deprecated_function( __METHOD__, '1.8', 'FLBuilderUserTemplatesAdmin::save_settings()' );
  580. }
  581. /**
  582. * @since 1.10.6
  583. */
  584. static function _filter_admin_footer_text( $text ) {
  585. $stars = '<a target="_blank" href="https://wordpress.org/support/plugin/beaver-builder-lite-version/reviews/#new-post" >&#9733;&#9733;&#9733;&#9733;&#9733;</a>';
  586. $wporg = '<a target="_blank" href="https://wordpress.org/plugins/beaver-builder-lite-version/">wordpress.org</a>';
  587. return sprintf( __( 'Add your %1$s on %2$s to spread the love.', 'fl-builder' ), $stars, $wporg );
  588. }
  589. }
  590. FLBuilderAdminSettings::init();