PluginProbe ʕ •ᴥ•ʔ
Kubio AI Page Builder / 2.3.0
Kubio AI Page Builder v2.3.0
2.8.1 trunk 1.0.0 1.0.1 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 1.3.1 1.3.2 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.7.0 1.7.1 1.7.2 1.7.3 1.8.0 1.8.1 1.8.2 1.9.0 2.0.0 2.1.1 2.1.2 2.1.3 2.2.0 2.2.3 2.2.4 2.2.5 2.3.0 2.3.1 2.3.3 2.3.4 2.4.0 2.4.1 2.4.2 2.4.3 2.4.5 2.5.0 2.5.1 2.5.2 2.5.3 2.6.0 2.6.1 2.6.2 2.6.3 2.6.5 2.6.6 2.6.7 2.7.0 2.7.1 2.7.2 2.7.3 2.8.0
kubio / lib / frontend.php
kubio / lib Last commit date
AI 2 years ago admin-pages 2 years ago api 2 years ago blog 3 years ago customizer 2 years ago filters 2 years ago full-site-editing 2 years ago importer 4 years ago integrations 1 year ago menu 3 years ago polyfills 3 years ago preview 2 years ago shapes 2 years ago shortcodes 1 year ago src 1 year ago add-edit-in-kubio.php 1 year ago editor-assets.php 2 years ago env.php 2 years ago filters.php 2 years ago frontend.php 4 years ago global-data.php 2 years ago init.php 2 years ago kubio-block-library.php 2 years ago kubio-editor.php 1 year ago load.php 2 years ago
frontend.php
70 lines
1 <?php
2
3 use IlluminateAgnostic\Arr\Support\Arr;
4
5 function kubio_enqueue_frontend_assets() {
6
7 if ( kubio_is_hybdrid_theme_iframe_preview() ) {
8 return;
9 }
10
11 kubio_enqueue_frontend_scripts();
12 wp_enqueue_style( 'kubio-block-library' );
13
14 $style = array();
15
16 //when we are inside the editor and render the content inside a post or a woo product. We don't want to add a new instance
17 //of global colors or aditional css. Because it will overwrite the css from the editor
18 if ( ! Arr::has( $_REQUEST, '__kubio-rendered-styles' ) ) {
19 $style = array(
20 // shapes
21 kubio_get_shapes_css(),
22 // colors
23 kubio_render_global_colors(),
24 // global
25 kubio_get_global_data( 'additional_css' ),
26 );
27 }
28 //page css
29 $style[] = kubio_get_page_css();
30
31 wp_add_inline_style( 'kubio-block-library', implode( "\n\n", $style ) );
32 }
33
34 add_action( 'wp_enqueue_scripts', 'kubio_enqueue_frontend_assets' );
35
36 function kubio_get_page_css() {
37 return Kubio\Core\StyleManager\StyleManager::getInstance()->render();
38 }
39
40 function kubio_render_page_css() {
41
42 if ( wp_doing_ajax() || defined( 'REST_REQUEST' ) ) {
43 return;
44 }
45
46 $content = '<style type="text/css" data-name="kubio-style">' . kubio_get_page_css() . '</style>';
47
48 return $content;
49
50 }
51
52 add_filter(
53 'style_loader_tag',
54 function( $tag, $handle ) {
55 $asynced_styles = array( 'kubio-google-fonts' );
56
57 if ( in_array( $handle, $asynced_styles, true ) ) {
58 if ( strpos( $tag, ' async' ) === false ) {
59 $tag = str_replace( '<link', '<link async', $tag );
60 }
61 }
62
63 return $tag;
64 },
65 PHP_INT_MAX,
66 4
67 );
68
69 require_once __DIR__ . '/polyfills/polyfills.php';
70