PluginProbe
Gutenify – Visual Site Builder Blocks & Starter Templates / 1.1.0
Gutenify – Visual Site Builder Blocks & Starter Templates v1.1.0
1.9.0 1.8.0 1.7.0 1.6.6 1.6.5 1.6.4 trunk 0.0.1 0.0.2 0.0.3 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 All 74 releases
gutenify / inc / class-block-assets.php

class-block-assets.php in Gutenify – Visual Site Builder Blocks & Starter Templates 1.1.0, at inc/class-block-assets.php

636 lines 19.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Load assets for our blocks.
4 *
5 * @package Gutenify
6 */
7
8 // Exit if accessed directly.
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit;
11 }
12
13 /**
14 * Load general assets for our blocks.
15 *
16 * @since 1.0.0
17 */
18 class Gutenify_Block_Assets {
19 /**
20 * This plugin's instance.
21 *
22 * @var Gutenify_Block_Assets
23 */
24 private static $instance;
25
26 /**
27 * Registers the plugin.
28 *
29 * @return Gutenify_Block_Assets
30 */
31 public static function register() {
32 if ( null === self::$instance ) {
33 self::$instance = new Gutenify_Block_Assets();
34 }
35
36 return self::$instance;
37 }
38
39 /**
40 * The Constructor.
41 */
42 public function __construct() {
43 add_action( 'enqueue_block_assets', array( $this, 'block_assets' ) );
44 add_action( 'init', array( $this, 'editor_assets' ) );
45 add_action( 'wp_enqueue_scripts', array( $this, 'add_block_inline_css' ), 200 );
46 add_action( 'admin_footer', array( $this, 'add_admin_global_inline_css' ), 200 );
47 add_action( 'wp_enqueue_scripts', array( $this, 'frontend_scripts' ), 9 );
48 add_action( 'enqueue_block_editor_assets', array( $this, 'editor_scripts' ) );
49 add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) );
50 }
51
52 /**
53 * Loads the asset file for the given script or style.
54 * Returns a default if the asset file is not found.
55 *
56 * @param string $filepath The name of the file without the extension.
57 *
58 * @return array The asset file contents.
59 */
60 public function get_asset_file( $filepath ) {
61 $asset_path = GUTENIFY_PLUGIN_DIR . $filepath . '.asset.php';
62
63 return file_exists( $asset_path )
64 ? include $asset_path
65 : array(
66 'dependencies' => array(),
67 'version' => GUTENIFY_VERSION,
68 );
69 }
70
71 /**
72 * Enqueue block assets for use within Gutenberg.
73 *
74 * @access public
75 */
76 public function block_assets() {
77 if ( is_admin() ) {
78 return false;
79 }
80 global $post;
81
82 // Only load the front end CSS if a Gutenify is in use.
83 $has_gutenify = ! is_singular();
84
85 if ( ! is_admin() && is_singular() ) {
86 $wp_post = get_post( $post );
87
88 // This is similar to has_block() in core, but will match anything
89 // in the gutenify/* namespace.
90 if ( $wp_post instanceof WP_Post ) {
91 $has_gutenify = ! empty(
92 array_filter(
93 array(
94 false !== strpos( $wp_post->post_content, '<!-- wp:gutenify/' ),
95 has_block( 'core/block', $wp_post ),
96 has_block( 'core/button', $wp_post ),
97 has_block( 'core/cover', $wp_post ),
98 has_block( 'core/heading', $wp_post ),
99 has_block( 'core/image', $wp_post ),
100 has_block( 'core/gallery', $wp_post ),
101 has_block( 'core/list', $wp_post ),
102 has_block( 'core/paragraph', $wp_post ),
103 has_block( 'core/pullquote', $wp_post ),
104 has_block( 'core/quote', $wp_post ),
105 )
106 )
107 );
108 }
109 }
110
111 // if ( ! $has_gutenify && ! $this->is_page_gutenberg() ) {
112 // return;
113 // }
114
115 $fonts_url = gutenify_fonts_url();
116 wp_enqueue_style( 'gutenify-fonts', $fonts_url, array(), null );
117
118 // Styles.
119 $name = 'gutenify-style';
120 $filepath = 'dist/' . $name;
121 $asset_file = $this->get_asset_file( $filepath );
122 $rtl = ! is_rtl() ? '' : '-rtl';
123
124 $deps = array( 'gutenify-fontawesome-style' );
125
126 if ( $fonts_url ) {
127 $deps[] = 'gutenify-fonts';
128 }
129
130 global $wp_styles;
131 if ( in_array( 'global-styles', $wp_styles->queue ) ) {
132 $deps[] = 'global-styles';
133 }
134 if ( in_array( 'woocommerce-layout', $wp_styles->queue ) ) {
135 $deps[] = 'woocommerce-layout';
136 }
137
138 wp_enqueue_style( 'gutenify-frontend', GUTENIFY_PLUGIN_URL . $filepath . $rtl . '.css', $deps, $asset_file['version'] );
139
140 }
141
142 /**
143 * Enqueue block assets for use within Gutenberg.
144 *
145 * @access public
146 */
147 public function editor_assets() {
148
149 // Styles.
150 $name = 'gutenify-editor';
151 $filepath = 'dist/' . $name;
152 $asset_file = $this->get_asset_file( $filepath );
153 $rtl = ! is_rtl() ? '' : '-rtl';
154
155 wp_register_style( 'gutenify-fontawesome-style', GUTENIFY_PLUGIN_URL . '/assets/fontawesome/css/all.css', array(), 'v4' );
156
157 $fonts_url = gutenify_fonts_url();
158 wp_enqueue_style( 'gutenify-fonts', $fonts_url, array(), null );
159
160 $deps = array( 'gutenify-fontawesome-style' );
161
162 if ( $fonts_url ) {
163 $deps[] = 'gutenify-fonts';
164 }
165
166 if ( class_exists( 'woocommerce' ) ) {
167 $deps[] = 'wc-blocks-editor-style';
168 }
169
170 wp_register_style(
171 'gutenify-editor',
172 GUTENIFY_PLUGIN_URL . $filepath . $rtl . '.css',
173 $deps,
174 $asset_file['version']
175 );
176
177 // Scripts.
178 $name = 'gutenify'; // gutenify.js.
179 $filepath = 'dist/' . $name;
180 $asset_file = $this->get_asset_file( $filepath );
181
182 wp_register_script(
183 'gutenify-editor',
184 GUTENIFY_PLUGIN_URL . $filepath . '.js',
185 array_merge( $asset_file['dependencies'], array( 'wp-api', 'gutenify-global' ) ),
186 $asset_file['version'],
187 true
188 );
189
190 $post_id = filter_input( INPUT_GET, 'post', FILTER_SANITIZE_NUMBER_INT );
191
192 wp_localize_script(
193 'gutenify-editor',
194 'gutenify_block_data',
195 array(
196 'plugin_directory_url' => esc_url( GUTENIFY_PLUGIN_URL ),
197 'site_url' => esc_url( site_url() ),
198 'settings_url' => esc_url( admin_url( 'edit.php?post_type=gutenify_template&page=gutenify-settings' ) ),
199 'add_template_url' => esc_url( admin_url( 'post-new.php?post_type=gutenify_template' ) ),
200 'is_woocommerce_activated' => class_exists( 'woocommerce' ),
201 )
202 );
203
204 $localized_values = array(
205 'font_families' => gutenify_font_families(),
206 'plugin_directory_url' => esc_url( GUTENIFY_PLUGIN_URL ),
207 'site_url' => esc_url( site_url() ),
208 );
209 wp_localize_script(
210 'gutenify-editor',
211 '_gutenify',
212 apply_filters( 'gutenify-admin-localized-values', $localized_values ),
213 );
214
215 wp_localize_script(
216 'gutenify-editor',
217 '_gutenify_vars',
218 array(
219 'site_url' => esc_url( site_url() ),
220 'plugin_directory_url' => esc_url( GUTENIFY_PLUGIN_URL ),
221 'gutenify_version' => GUTENIFY_VERSION,
222 'pro_license_status' => apply_filters( 'gutenify_pro_license_status', false ),
223 'is_pro_activated' => apply_filters( 'gutenify_pro_activation_status', false ),
224 )
225 );
226 }
227
228 /**
229 * Enqueue front-end assets for blocks.
230 *
231 * @access public
232 * @since 1.9.5
233 */
234 public function frontend_scripts() {
235
236 // Scripts.
237 $name = 'swiper-bundle'; // swiper.js.
238 $filepath = 'assets/js/lib/' . $name;
239
240 wp_register_script(
241 'gutenify-swiper',
242 GUTENIFY_PLUGIN_URL . $filepath . '.js',
243 array( 'jquery' ),
244 '6.8.2',
245 false
246 );
247
248 // Scripts.
249 $name = 'gutenify-frontend'; // gutenify.js.
250 $filepath = 'dist/js/' . $name;
251 $asset_file = $this->get_asset_file( $filepath );
252
253 $deps = array( 'jquery', 'gutenify-swiper' );
254
255 // Enqueue for gutenify animations.
256 wp_enqueue_script(
257 'gutenify-frontend',
258 GUTENIFY_PLUGIN_URL . $filepath . '.js',
259 $deps,
260 GUTENIFY_VERSION,
261 false
262 );
263
264
265 /**
266 * Add: Isotope JS
267 */
268
269 // Scripts.
270 $name = 'gutenify-isotope'; // swiper.js.
271 $filepath = 'assets/js/lib/isotope.pkgd';
272 wp_register_script( $name, GUTENIFY_PLUGIN_URL . $filepath . '.js', array( 'jquery' ), '3.0.6', false );
273
274 /**
275 * END: Isotope JS
276 */
277
278
279 /**
280 * Add: marquee JS
281 */
282
283 // Scripts.
284 $name = 'jquery-marquee';
285 $filepath = 'assets/js/lib/jquery.marquee';
286 wp_register_script( $name, GUTENIFY_PLUGIN_URL . $filepath . '.js', array( 'jquery' ), '1.6.0', false );
287
288 /**
289 * END: marquee JS
290 */
291
292 // Styles.
293 $name = 'swiper-bundle.min'; // swiper.js.
294 $filepath = 'assets/css/lib/' . $name;
295 $asset_file = $this->get_asset_file( $filepath );
296 wp_enqueue_style(
297 'gutenify-swiper-style',
298 GUTENIFY_PLUGIN_URL . $filepath . '.css',
299 array(),
300 '6.8.2'
301 );
302
303 }
304
305 /**
306 * Enqueue editor scripts for blocks.
307 *
308 * @access public
309 * @since 1.9.5
310 */
311 public function editor_scripts() {
312 }
313
314 /**
315 * Return whether a post type should display the Block Editor.
316 *
317 * @param string $post_type The post_type slug to check.
318 */
319 protected function is_post_type_gutenberg( $post_type ) {
320 return use_block_editor_for_post_type( $post_type );
321 }
322
323 /**
324 * Return whether the page we are on is loading the Block Editor.
325 */
326 protected function is_page_gutenberg() {
327 if ( ! is_admin() ) {
328 return false;
329 }
330
331 $admin_page = wp_basename( esc_url( $_SERVER['REQUEST_URI'] ) );
332
333 if ( false !== strpos( $admin_page, 'post-new.php' ) && empty( $_GET['post_type'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
334 return true;
335 }
336
337 if ( false !== strpos( $admin_page, 'post-new.php' ) && isset( $_GET['post_type'] ) && $this->is_post_type_gutenberg( $_GET['post_type'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
338 return true;
339 }
340
341 if ( false !== strpos( $admin_page, 'post.php' ) ) {
342 $wp_post = get_post( $_GET['post'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
343 if ( isset( $wp_post ) && isset( $wp_post->post_type ) && $this->is_post_type_gutenberg( $wp_post->post_type ) ) {
344 return true;
345 }
346 }
347
348 if ( false !== strpos( $admin_page, 'revision.php' ) ) {
349 $wp_post = get_post( $_GET['revision'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
350 $post_parent = get_post( $wp_post->post_parent );
351 if ( isset( $post_parent ) && isset( $post_parent->post_type ) && $this->is_post_type_gutenberg( $post_parent->post_type ) ) {
352 return true;
353 }
354 }
355 return false;
356 }
357
358 /**
359 * Add inline css
360 *
361 * @return void
362 */
363 public static function add_block_inline_css() {
364 if ( is_singular() ) {
365 global $post;
366 // $style_file = trailingslashit( wp_upload_dir()['basedir'] ) . 'gutenify/styles/style-' . 'post-' . $post->ID . '.css';
367
368 // if ( file_exists( $style_file ) ) {
369 // $style_file_url = trailingslashit( wp_upload_dir()['baseurl'] ) . 'gutenify/styles/style-' . 'post-' . $post->ID . '.css';
370
371 // wp_enqueue_style( 'gutenify-frontend-post', $style_file_url, array( 'gutenify-frontend' ), GUTENIFY_VERSION );
372 // } else {
373 // }
374 $post_meta = get_post_meta( $post->ID );
375 $gutenify_custom_css = ! empty( $post_meta['gutenify_custom_css'][0] ) ? $post_meta['gutenify_custom_css'][0] : '';
376 wp_add_inline_style( 'gutenify-frontend', $gutenify_custom_css );
377 }
378 $gutenify_global_style = get_option( 'gutenify_global_style' );
379
380 $deps = array();
381 wp_register_style( 'gutenify-global-inline-handle', false, $deps );
382 wp_enqueue_style( 'gutenify-global-inline-handle' );
383
384 if ( $gutenify_global_style ) {
385 $handle = 'gutenify-global-inline-handle';
386 wp_add_inline_style( $handle, $gutenify_global_style );
387 }
388 }
389
390 /**
391 * Add Global inline css
392 *
393 * @return void
394 */
395 public static function add_admin_global_inline_css() {
396
397 $gutenify_admin_global_style = get_option( 'gutenify_admin_global_style' );
398 $deps = array();
399 wp_register_style( 'gutenify-global-inline-handle', false, $deps );
400 wp_enqueue_style( 'gutenify-global-inline-handle' );
401
402 if ( $gutenify_admin_global_style ) {
403 wp_add_inline_style( 'gutenify-global-inline-handle', $gutenify_admin_global_style );
404 }
405 }
406
407 /**
408 * Admin scripts.
409 *
410 * @return mixed
411 */
412 public function admin_scripts() {
413 // Scripts.
414 $name = 'gutenify-global'; // gutenify.js.
415 $filepath = 'dist/' . $name;
416 $asset_file = $this->get_asset_file( $filepath );
417
418 // Enqueue for gutenify animations.
419 wp_register_script(
420 $name,
421 GUTENIFY_PLUGIN_URL . $filepath . '.js',
422 $asset_file['dependencies'],
423 $asset_file['version'],
424 true
425 );
426
427 // Getting Started.
428 if ( ( ! empty( $_GET['page'] ) && 'gutenify' === $_GET['page'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
429 // Scripts.
430 $name = 'gutenify-getting-started-admin'; // gutenify.js.
431 $filepath = 'dist/' . $name;
432 $asset_file = $this->get_asset_file( $filepath );
433
434 // Enqueue for gutenify animations.
435 wp_enqueue_script(
436 'gutenify-getting-started-admin',
437 GUTENIFY_PLUGIN_URL . $filepath . '.js',
438 $asset_file['dependencies'],
439 $asset_file['version'],
440 true
441 );
442
443 // Styles.
444 $name = 'gutenify-getting-started-admin-style';
445 $filepath = 'dist/' . $name;
446 $asset_file = $this->get_asset_file( $filepath );
447 $rtl = ! is_rtl() ? '' : '-rtl';
448
449 wp_enqueue_style(
450 $name,
451 GUTENIFY_PLUGIN_URL . $filepath . $rtl . '.css',
452 array( 'gutenify-fontawesome-style', 'wp-components' ),
453 $asset_file['version']
454 );
455
456 wp_localize_script(
457 'gutenify-getting-started-admin',
458 '_gutenify_vars',
459 array(
460 'site_url' => esc_url( site_url() ),
461 'plugin_directory_url' => esc_url( GUTENIFY_PLUGIN_URL ),
462 'gutenify_version' => GUTENIFY_VERSION,
463 // 'gutenify_com_server_url' => defined( 'GUTENIFY_COM_SERVER_URL' ) ? trailingslashit( GUTENIFY_COM_SERVER_URL ) : trailingslashit( 'https://api.gutenify.com/' ),
464 // 'is_block_theme' => function_exists( 'wp_get_theme' ) && ! empty( wp_get_theme()->is_block_theme() ),
465 // 'is_woocommerce_activated' => class_exists( 'woocommerce' ),
466 'pro_license_status' => apply_filters( 'gutenify_pro_license_status', false ),
467 'is_pro_activated' => apply_filters( 'gutenify_pro_activation_status', false ),
468 )
469 );
470 }
471
472 // Site options
473 if ( ( ! empty( $_GET['page'] ) && 'gutenify-site-options' === $_GET['page'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
474 // Scripts.
475 $name = 'gutenify-site-options-admin'; // gutenify.js.
476 $filepath = 'dist/' . $name;
477 $asset_file = $this->get_asset_file( $filepath );
478
479 // Enqueue for gutenify animations.
480 wp_enqueue_script(
481 'gutenify-site-options-admin',
482 GUTENIFY_PLUGIN_URL . $filepath . '.js',
483 $asset_file['dependencies'],
484 $asset_file['version'],
485 true
486 );
487
488 // Styles.
489 $name = 'gutenify-site-options-admin-style';
490 $filepath = 'dist/' . $name;
491 $asset_file = $this->get_asset_file( $filepath );
492 $rtl = ! is_rtl() ? '' : '-rtl';
493
494 wp_enqueue_style(
495 $name,
496 GUTENIFY_PLUGIN_URL . $filepath . $rtl . '.css',
497 array( 'gutenify-fontawesome-style', 'wp-components' ),
498 $asset_file['version']
499 );
500
501 wp_localize_script(
502 'gutenify-site-options-admin',
503 '_gutenify_site_options',
504 array(
505 'site_url' => esc_url( site_url() ),
506 'gutenify_com_server_url' => defined( 'GUTENIFY_COM_SERVER_URL' ) ? trailingslashit( GUTENIFY_COM_SERVER_URL ) : trailingslashit( 'https://api.gutenify.com/' ),
507 'is_block_theme' => function_exists( 'wp_get_theme' ) && ! empty( wp_get_theme()->is_block_theme() ),
508 'is_woocommerce_activated' => class_exists( 'woocommerce' ),
509 'pro_license_status' => apply_filters( 'gutenify_pro_license_status', false ),
510 )
511 );
512 }
513
514 // if ( ! empty( $_GET['post_type'] ) && 'gutenify_kit' === $_GET['post_type'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
515 if ( ( ! empty( $_GET['page'] ) && 'gutenify-template-kits' === $_GET['page'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
516 // Scripts.
517 $name = 'gutenify-kit-admin'; // gutenify.js.
518 $filepath = 'dist/' . $name;
519 $asset_file = $this->get_asset_file( $filepath );
520
521 // Enqueue for gutenify animations.
522 wp_enqueue_script(
523 'gutenify-kit-admin',
524 GUTENIFY_PLUGIN_URL . $filepath . '.js',
525 $asset_file['dependencies'],
526 $asset_file['version'],
527 true
528 );
529
530 // Styles.
531 $name = 'gutenify-kit-admin-style';
532 $filepath = 'dist/' . $name;
533 $asset_file = $this->get_asset_file( $filepath );
534 $rtl = ! is_rtl() ? '' : '-rtl';
535
536 wp_enqueue_style(
537 $name,
538 GUTENIFY_PLUGIN_URL . $filepath . $rtl . '.css',
539 array( 'gutenify-fontawesome-style', 'wp-components' ),
540 $asset_file['version']
541 );
542
543 wp_localize_script(
544 'gutenify-kit-admin',
545 '_gutenify_kit',
546 array(
547 'plugin_directory_url' => esc_url( GUTENIFY_PLUGIN_URL ),
548 'site_url' => esc_url( site_url() ),
549 'gutenify_com_server_url' => defined( 'GUTENIFY_COM_SERVER_URL' ) ? trailingslashit( GUTENIFY_COM_SERVER_URL ) : trailingslashit( 'https://api.gutenify.com/' ),
550 'is_block_theme' => wp_is_block_theme(), // function_exists( 'wp_get_theme' ) && ! empty( wp_get_theme()->is_block_theme() ),
551 'is_woocommerce_activated' => class_exists( 'woocommerce' ),
552 'pro_license_status' => apply_filters( 'gutenify_pro_license_status', false ),
553 )
554 );
555
556 wp_localize_script(
557 'gutenify-kit-admin',
558 '_gutenify_vars',
559 array(
560 'plugin_directory_url' => esc_url( GUTENIFY_PLUGIN_URL ),
561 'site_url' => esc_url( site_url() ),
562 'gutenify_com_server_url' => defined( 'GUTENIFY_COM_SERVER_URL' ) ? trailingslashit( GUTENIFY_COM_SERVER_URL ) : trailingslashit( 'https://api.gutenify.com/' ),
563 'is_block_theme' => wp_is_block_theme(), // function_exists( 'wp_get_theme' ) && ! empty( wp_get_theme()->is_block_theme() ),
564 'is_woocommerce_activated' => class_exists( 'woocommerce' ),
565 'pro_license_status' => apply_filters( 'gutenify_pro_license_status', false ),
566 'font_families' => gutenify_font_families(),
567 'is_pro_activated' => apply_filters( 'gutenify_pro_activation_status', false ),
568 )
569 );
570 }
571
572 if ( ( ! empty( $_GET['page'] ) && 'gutenify-settings' !== $_GET['page'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
573 return false;
574 }
575 // Scripts.
576 $name = 'gutenify-admin-settings'; // gutenify.js.
577 $filepath = 'dist/' . $name;
578 $asset_file = $this->get_asset_file( $filepath );
579
580 $asset_file['dependencies'][] = 'gutenify-global';
581
582 // Enqueue for gutenify animations.
583 wp_enqueue_script(
584 'gutenify-admin-settings',
585 GUTENIFY_PLUGIN_URL . $filepath . '.js',
586 $asset_file['dependencies'],
587 $asset_file['version'],
588 true
589 );
590
591 wp_localize_script(
592 'gutenify-admin-settings',
593 '_gutenify',
594 array(
595 'site_url' => esc_url( site_url() ),
596 'pro_account_url' => esc_url( admin_url( 'admin.php?page=gutenify-pro-license' ) ),
597 'gutenify_com_server_url' => defined( 'GUTENIFY_COM_SERVER_URL' ) ? trailingslashit( GUTENIFY_COM_SERVER_URL ) : trailingslashit( 'https://api.gutenify.com/' ),
598 'gutenify_hub_server_url' => defined( 'GUTENIFY_HUB_SERVER_URL' ) ? trailingslashit( GUTENIFY_COM_SERVER_URL ) : trailingslashit( 'https://hub.gutenify.com/' ),
599 'pro_license_status' => apply_filters( 'gutenify_pro_license_status', false ),
600 'font_families' => gutenify_font_families(),
601 'global_settings' => wp_get_global_settings(),
602 )
603 );
604
605 wp_localize_script(
606 'gutenify-admin-settings',
607 '_gutenify_vars',
608 array(
609 'plugin_directory_url' => esc_url( GUTENIFY_PLUGIN_URL ),
610 'site_url' => esc_url( site_url() ),
611 'gutenify_com_server_url' => defined( 'GUTENIFY_COM_SERVER_URL' ) ? trailingslashit( GUTENIFY_COM_SERVER_URL ) : trailingslashit( 'https://api.gutenify.com/' ),
612 'is_block_theme' => wp_is_block_theme(), // function_exists( 'wp_get_theme' ) && ! empty( wp_get_theme()->is_block_theme() ),
613 'is_woocommerce_activated' => class_exists( 'woocommerce' ),
614 'pro_license_status' => apply_filters( 'gutenify_pro_license_status', false ),
615 'font_families' => gutenify_font_families(),
616 'is_pro_activated' => apply_filters( 'gutenify_pro_activation_status', false ),
617 )
618 );
619
620 // Styles.
621 $name = 'gutenify-admin-settings-style';
622 $filepath = 'dist/' . $name;
623 $asset_file = $this->get_asset_file( $filepath );
624 $rtl = ! is_rtl() ? '' : '-rtl';
625
626 wp_enqueue_style(
627 $name,
628 GUTENIFY_PLUGIN_URL . $filepath . $rtl . '.css',
629 array( 'gutenify-fontawesome-style', 'wp-components' ),
630 $asset_file['version']
631 );
632 }
633 }
634
635 Gutenify_Block_Assets::register();
636