PluginProbe ʕ •ᴥ•ʔ
Kubio AI Page Builder / 2.8.3
Kubio AI Page Builder v2.8.3
2.8.4 2.8.3 2.8.2 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 / integrations / third-party-themes / fallback-compatibility.php
kubio / lib / integrations / third-party-themes Last commit date
block-based-templates 1 month ago styles 4 years ago customizer-options.php 1 year ago editor-hooks.php 1 year ago fallback-compatibility.php 4 years ago front-page.html 2 years ago frontend-hooks.php 1 year ago preview.php 4 years ago templates-importer.php 1 year ago templates.php 1 year ago third-party-themes.php 1 year ago
fallback-compatibility.php
60 lines
1 <?php
2
3 use Kubio\Flags;
4
5 function kubio_mark_supported_themes_templates_fallback() {
6
7 if ( ! kubio_theme_has_kubio_block_support() ) {
8 return;
9 }
10
11 if ( ! is_admin() ) {
12 return;
13 }
14
15 $kubio_default_templates = array( '404', 'archive-product', 'front-page', 'full-width', 'index', 'page', 'search', 'single-product', 'single' );
16 $kubio_default_template_parts = array( 'header', 'sidebar', 'footer', 'front-header' );
17
18 if ( Flags::get( 'kubio_activation_time' ) !== null ) {
19
20 if ( Flags::get( 'kubio_templates_imported' ) === null ) {
21
22 $templates = get_posts(
23 array(
24 'post_type' => 'wp_template',
25 'post_name__in' => $kubio_default_templates,
26 'posts_per_page' => -1,
27 'fields' => 'ids',
28 )
29 );
30
31 foreach ( $templates as $template ) {
32 update_post_meta( intval( $template ), '_kubio_template_source', 'kubio' );
33 }
34
35 Flags::touch( 'kubio_templates_imported' );
36
37 }
38
39 if ( Flags::get( 'kubio_template_parts_imported' ) === null ) {
40
41 $template_parts = get_posts(
42 array(
43 'post_type' => 'wp_template_parts',
44 'post_name__in' => $kubio_default_template_parts,
45 'posts_per_page' => -1,
46 'fields' => 'ids',
47 )
48 );
49
50 foreach ( $template_parts as $part ) {
51 update_post_meta( intval( $part ), '_kubio_template_source', 'kubio' );
52 }
53
54 Flags::touch( 'kubio_template_parts_imported' );
55 }
56 }
57 }
58
59 add_action( 'after_setup_theme', 'kubio_mark_supported_themes_templates_fallback' );
60