PluginProbe ʕ •ᴥ•ʔ
Kubio AI Page Builder / 1.0.0
Kubio AI Page Builder v1.0.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
admin-pages 4 years ago api 4 years ago blog 4 years ago full-site-editing 4 years ago importer 4 years ago integrations 4 years ago menu 4 years ago polyfills 4 years ago preview 4 years ago shapes 4 years ago shortcodes 4 years ago src 4 years ago add-edit-in-kubio.php 4 years ago editor-assets.php 4 years ago env.php 4 years ago filters.php 4 years ago frontend.php 4 years ago global-data.php 4 years ago kubio-block-library.php 4 years ago kubio-editor.php 4 years ago load.php 4 years ago shared-style.php 4 years ago
frontend.php
57 lines
1 <?php
2
3 function kubio_enqueue_frontend_assets() {
4 wp_enqueue_script( 'kubio-frontend' );
5 wp_enqueue_style( 'kubio-block-library' );
6
7 $style = array(
8 // shapes
9 kubio_get_shapes_css(),
10 // colors
11 kubio_render_global_colors(),
12 // global
13 kubio_get_global_data( 'additional_css' ),
14 // page css
15 kubio_get_page_css(),
16 );
17
18 wp_add_inline_style( 'kubio-block-library', implode( "\n\n", $style ) );
19 }
20
21 add_action( 'wp_enqueue_scripts', 'kubio_enqueue_frontend_assets' );
22
23 function kubio_get_page_css() {
24 return Kubio\Core\StyleManager\StyleManager::getInstance()->render();
25 }
26
27 function kubio_render_page_css() {
28
29 if ( wp_doing_ajax() || defined( 'REST_REQUEST' ) ) {
30 return;
31 }
32
33 $content = '<style type="text/css" data-name="kubio-style">' . kubio_get_page_css() . '</style>';
34
35 return $content;
36
37 }
38
39 add_filter(
40 'style_loader_tag',
41 function( $tag, $handle ) {
42 $asynced_styles = array( 'kubio-google-fonts' );
43
44 if ( in_array( $handle, $asynced_styles, true ) ) {
45 if ( strpos( $tag, ' async' ) === false ) {
46 $tag = str_replace( '<link', '<link async', $tag );
47 }
48 }
49
50 return $tag;
51 },
52 PHP_INT_MAX,
53 4
54 );
55
56 require_once __DIR__ . '/polyfills/polyfills.php';
57