PluginProbe ʕ •ᴥ•ʔ
Kubio AI Page Builder / 2.4.0
Kubio AI Page Builder v2.4.0
2.9.1 2.9.0 2.8.6 2.8.5 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 / src / Core / Activation.php
kubio / lib / src / Core Last commit date
Background 1 year ago Blocks 1 year ago GlobalElements 3 years ago Layout 4 years ago License 2 years ago Separators 4 years ago StyleManager 1 year ago Styles 4 years ago Activation.php 1 year ago Backup.php 4 years ago CustomizerImporter.php 1 year ago Deactivation.php 4 years ago EditInKubioCustomizerPanel.php 4 years ago Element.php 2 years ago ElementBase.php 4 years ago Importer.php 2 years ago InnerBlocks.php 4 years ago LodashBasic.php 2 years ago Registry.php 3 years ago Utils.php 1 year ago
Activation.php
740 lines
1 <?php
2
3 namespace Kubio\Core;
4
5 use IlluminateAgnostic\Arr\Support\Arr;
6 use Kubio\Flags;
7
8 class Activation {
9
10
11 private static $instance = null;
12
13 private $remote_content = array();
14
15
16 public function __construct() {
17 add_action(
18 'activated_plugin',
19 function ( $plugin ) {
20
21 if ( $plugin === plugin_basename( KUBIO_ENTRY_FILE ) ) {
22
23 $hash = uniqid( 'activate-' );
24 Flags::set( 'activation-hash', $hash );
25
26 $url = add_query_arg(
27 array(
28 'page' => 'kubio-get-started',
29 'kubio-activation-hash' => $hash,
30 ),
31 admin_url( 'admin.php' )
32 );
33
34 if ( ! $this->isCLI() && ! Arr::has( $_REQUEST, 'tgmpa-activate' ) && ! $this->isAJAX() ) {
35 wp_redirect( $url );
36 exit();
37 } else {
38
39 if ( Arr::has( $_REQUEST, 'tgmpa-activate' ) || $this->isAJAX() ) {
40 Flags::set( 'activated_from_tgmpa_or_ajax', true );
41 }
42
43 Flags::set( 'import_design', false );
44 Flags::set( 'start_with_ai', false );
45
46 if ( $this->isCLI() ) {
47 add_filter( 'user_has_cap', array( Importer::class, 'allowImportCaps' ), 10, 2 );
48 $this->activate();
49 }
50 }
51 }
52 }
53 );
54
55 $self = $this;
56
57 // handle direct tgmpa activation
58 add_action(
59 'init',
60 function () {
61
62 if ( ! is_admin() ) {
63 return;
64 }
65
66 if ( Flags::get( 'activated_from_tgmpa_or_ajax' ) ) {
67 Flags::delete( 'activated_from_tgmpa_or_ajax' );
68
69 $hash = uniqid( 'activate-' );
70 Flags::set( 'activation-hash', $hash );
71 $url = add_query_arg(
72 array(
73 'page' => 'kubio-get-started',
74 'kubio-activation-hash' => $hash,
75 ),
76 admin_url( 'admin.php' )
77 );
78
79 wp_redirect( $url );
80 exit();
81 }
82 },
83 5
84 );
85
86 add_action(
87 'init',
88 function () use ( $self ) {
89
90 if ( ! is_admin() ) {
91 return;
92 }
93
94 $hash = sanitize_text_field( Arr::get( $_REQUEST, 'kubio-activation-hash', null ) );
95 $saved_hash = Flags::get( 'activation-hash', false );
96 if ( $saved_hash === $hash ) {
97 Flags::delete( 'activation-hash' );
98 $self->activate();
99 }
100 },
101 500
102 );
103
104 add_action( 'after_switch_theme', array( $this, 'afterSwitchTheme' ) );
105 }
106
107 public function isCLI() {
108 return defined( 'WP_CLI' ) && WP_CLI;
109 }
110
111 public function isAJAX() {
112 return defined( 'DOING_AJAX' ) && DOING_AJAX;
113 }
114
115 public function startWithAI() {
116 return Flags::get( 'start_with_ai', false ) !== false;
117 }
118
119 public function activeWithFrontpage() {
120
121 if ( $this->startWithAI() ) {
122 return true;
123 }
124
125 return apply_filters( 'kubio/activation/activate_with_frontpage', Flags::get( 'import_design', false ) !== false );
126 }
127
128 public function importUnmodifiedTemplates() {
129 return ! CustomizerImporter::themeHasModifiedOptions();
130 }
131
132 public function importCustomizedTemplates() {
133 return CustomizerImporter::themeHasModifiedOptions();
134 }
135
136
137 private function shouldRestoreDeactivationBackup( Backup $backup ) {
138 $template = get_stylesheet();
139 $identifier = Flags::getSetting( "deactivation_backup_key.{$template}", null );
140 return $identifier && $backup->hasBackup( $identifier );
141 }
142
143 private function restoreDeactivationBackup( Backup $backup ) {
144 $template = get_stylesheet();
145 $identifier = Flags::getSetting( "deactivation_backup_key.{$template}", null );
146 $status = $backup->restoreBackup( $identifier );
147
148 if ( ! is_wp_error( $status ) ) {
149 $backup->deleteBackup( $identifier );
150 }
151 Flags::delete( $identifier );
152 }
153
154
155 public function activate() {
156 $backup = new Backup();
157
158 if ( $this->shouldRestoreDeactivationBackup( $backup ) ) {
159 $this->restoreDeactivationBackup( $backup );
160 return;
161 }
162
163 // activate pro
164 if ( kubio_is_pro() && ! Flags::get( 'kubio_pro_activation_time', false ) ) {
165 Flags::set( 'kubio_pro_activation_time', time() );
166 }
167
168 // if free previously activated return
169 if ( Flags::get( 'kubio_activation_time', false ) ) {
170 $stylesheet = Flags::get( 'stylesheet', null );
171 if ( $stylesheet === get_stylesheet() ) {
172 return;
173 }
174 }
175
176 Flags::set( 'kubio_f', get_option( 'fresh_site' ) );
177 Flags::set( 'kubio_activation_time', time() );
178 Flags::set( 'stylesheet', get_stylesheet() );
179
180 $this->addCommonFilters();
181 $this->prepareRemoteData();
182
183 add_filter( 'kubio/importer/page_path', array( $this, 'getDesignPagePath' ), 10, 2 );
184
185 if ( $this->importCustomizedTemplates() ) {
186 add_filter( 'kubio/importer/content', array( $this, 'importCustomizerOptions' ), 20, 3 );
187 }
188
189 if ( $this->activeWithFrontpage() ) {
190 add_filter( 'kubio/activation/force_front_page_creation', '__return_true' );
191 }
192
193 wp_cache_flush();
194 $this->importDesign();
195 $this->importTemplates();
196 $this->importTemplateParts();
197 wp_cache_flush();
198 do_action( 'kubio/after_activation' );
199
200 if ( ! $this->isCLI() ) {
201
202 // make an educated guess about the start source if not set
203 if ( ! Flags::get( 'start_source', false ) ) {
204 $start_source = 'other';
205 if ( $this->startWithAI() ) {
206 $start_source = 'notice-ai';
207 } elseif ( $this->activeWithFrontpage() ) {
208 $start_source = 'notice-homepage';
209 }
210 Flags::set( 'start_source', $start_source );
211 }
212
213 if ( $this->startWithAI() ) {
214 Flags::set( 'start_with_ai', false );
215 $ai_hash = md5( uniqid( 'start-with-ai' ) );
216 Flags::set( 'start_with_ai_hash', $ai_hash );
217 wp_redirect(
218 Utils::kubioGetEditorURL(
219 array(
220 'ai' => $ai_hash,
221 )
222 )
223 );
224 exit();
225 }
226
227 if ( $this->activeWithFrontpage() ) {
228 if ( Flags::get( 'start_source', false ) == 'notice-homepage' ) {
229 $url = add_query_arg(
230 array(
231 'page' => 'kubio-get-started',
232 'kubio-designed-imported' => intval( ! ! Flags::get( 'import_design', false ) ),
233 ),
234 admin_url( 'admin.php' )
235 );
236
237 wp_redirect( $url );
238 } else {
239 wp_redirect(
240 Utils::kubioGetEditorURL()
241 );
242 }
243 exit();
244 }
245
246 $is_unmodified_supported_theme = kubio_theme_has_kubio_block_support() && ! CustomizerImporter::themeHasModifiedOptions();
247 if ( get_option( 'fresh_site' ) || $is_unmodified_supported_theme ) {
248 $url = add_query_arg(
249 array(
250 'page' => 'kubio-get-started',
251 'tab' => 'website-starter',
252 ),
253 admin_url( 'admin.php' )
254 );
255 wp_redirect( $url );
256 exit();
257 }
258 }
259
260 }
261
262 public function addCommonFilters() {
263 add_filter( 'kubio/importer/skip-remote-file-import', '__return_true' );
264 add_filter( 'kubio/importer/content', array( $this, 'getFileContent' ), 1, 3 );
265 add_filter( 'kubio/importer/content', array( $this, 'templateMapPartsTheme' ), 10, 2 );
266 add_filter( 'kubio/importer/content', array( $this, 'updateBlocks' ), 10, 3 );
267 remove_filter( 'theme_mod_nav_menu_locations', 'kubio_nav_menu_locations_from_global_data' );
268 remove_filter( 'wp_insert_post_data', 'kubio_on_post_update', 10, 3 );
269 remove_action( 'wp_insert_post', 'kubio_update_meta', 10, 3 );
270
271 add_filter( 'kubio/importer/available_templates', array( $this, 'getAvailableTemplates' ), 10 );
272 add_filter( 'kubio/importer/available_template_parts', array( $this, 'getAvailableTemplateParts' ), 10 );
273 }
274
275 public function prepareRemoteData() {
276 if ( ! \kubio_theme_has_kubio_block_support() ) {
277 return;
278 }
279
280 $with_front_page = apply_filters( 'kubio/importer/with_front_page', $this->importUnmodifiedTemplates() );
281
282 $base_url = 'https://themes.kubiobuilder.com';
283 $file_name = get_stylesheet() . '__' . get_template() . '__' . ( $with_front_page ? 'with-front' : 'default' ) . '.data';
284
285 $url = apply_filters( 'kubio/remote_data_url', "{$base_url}/{$file_name}" );
286 $response = wp_safe_remote_get( $url );
287
288 if ( ! is_wp_error( $response ) && wp_remote_retrieve_response_code( $response ) === 200 /* && Utils::isProduction() */ ) {
289 $content = wp_remote_retrieve_body( $response );
290 $data = unserialize( $content );
291
292 if ( ! is_array( $data ) || Arr::get( $data, 'error' ) ) {
293 return;
294 }
295
296 $this->remote_content = $data;
297 } else {
298 $content = file_get_contents( KUBIO_ROOT_DIR . '/defaults/default-site.dat' );
299 $this->remote_content = unserialize( $content );
300 }
301
302 $global_data = Arr::get( $this->remote_content, 'global-data' );
303 if ( $global_data ) {
304 $global_data = json_decode( $global_data, true );
305
306 if ( json_last_error() === JSON_ERROR_NONE ) {
307 Arr::forget( $global_data, 'menuLocations' );
308 kubio_replace_global_data_content( $global_data );
309 }
310 }
311
312 $theme = Arr::get( $this->remote_content, 'theme' );
313
314 // if the child theme does not exists use the theme name for assets
315 if ( $theme && $theme !== get_stylesheet() ) {
316 add_filter(
317 'kubio/importer/kubio-url-placeholder-replacement',
318 function () use ( $theme ) {
319
320 return "https://static-assets.kubiobuilder.com/themes/{$theme}/assets/";
321 },
322 10
323 );
324 }
325 }
326
327 public function importDesign() {
328 if ( $this->isCLI() ) {
329 return;
330 }
331
332 $result = $this->setPages();
333
334 // try to set the blog page and menu
335 if ( ! is_wp_error( $result ) ) {
336 static::preparePrimaryMenu();
337 } else {
338 // only set menu location
339 static::preparePrimaryMenu( false );
340 }
341 }
342
343 private function setPages( $data = array() ) {
344
345 if ( ! kubio_theme_has_kubio_block_support() ) {
346 return new \WP_Error( 'not_supported_themes' );
347 }
348
349 $data = array_merge(
350 array(
351 'front_content' => null,
352 'with_blog_page' => true,
353 ),
354 $data
355 );
356
357 $front_page_id = $this->importFrontPage();
358
359 if ( is_wp_error( $front_page_id ) ) {
360 return $front_page_id;
361 }
362
363 update_option( 'show_on_front', 'page' );
364 update_option( 'page_on_front', $front_page_id );
365
366 $posts_page_id = intval( get_option( 'page_for_posts' ) );
367
368 if ( ! $posts_page_id && $data['with_blog_page'] ) {
369 $posts_page_id = wp_insert_post(
370 array(
371 'comment_status' => 'closed',
372 'ping_status' => 'closed',
373 'post_name' => 'blog',
374 'post_title' => __( 'Blog', 'kubio' ),
375 'post_status' => 'publish',
376 'post_type' => 'page',
377 'page_template' => apply_filters(
378 'kubio/front_page_template',
379 'page-templates/homepage.php'
380 ),
381 'post_content' => '',
382 'meta_input' => array(
383 '_kubio_created_at_activation' => 1,
384 ),
385 )
386 );
387
388 if ( ! is_wp_error( $posts_page_id ) ) {
389 update_option( 'page_for_posts', $posts_page_id );
390 }
391 }
392
393 return $posts_page_id;
394 }
395
396 /**
397 *
398 * @return int|WP_Error
399 */
400 private function importFrontPage() {
401 $page_on_front = get_option( 'page_on_front' );
402 $query = new \WP_Query(
403 array(
404 'post__in' => array( $page_on_front ),
405 'post_status' => array( 'publish' ),
406 'fields' => 'ids',
407 'post_type' => 'page',
408 )
409 );
410
411 $content = '';
412
413 if ( $this->activeWithFrontpage() ) {
414 $content = Importer::getTemplateContent( 'page', 'front-page' );
415 }
416
417 if ( $query->have_posts() && ! apply_filters( 'kubio/activation/force_front_page_creation', false ) ) {
418 if ( apply_filters( 'kubio/activation/override_front_page_content', false ) ) {
419 wp_update_post(
420 array(
421 'ID' => intval( $page_on_front ),
422 'post_content' => wp_slash( kubio_serialize_blocks( parse_blocks( $content ) ) ),
423 )
424 );
425 }
426
427 return intval( $page_on_front );
428 }
429
430 if ( ! is_string( $content ) ) {
431 $content = '';
432 }
433
434 return wp_insert_post(
435 array(
436 'comment_status' => 'closed',
437 'ping_status' => 'closed',
438 'post_name' => 'front_page',
439 'post_title' => __( 'Home', 'kubio' ),
440 'post_status' => 'publish',
441 'post_type' => 'page',
442 'page_template' => apply_filters(
443 'kubio/front_page_template',
444 'kubio-full-width'
445 ),
446 'post_content' => wp_slash( kubio_serialize_blocks( parse_blocks( $content ) ) ),
447 'meta_input' => array(
448 '_kubio_created_at_activation' => 1,
449 ),
450 )
451 );
452 }
453
454 public static function preparePrimaryMenu( $create_menu_items = true ) {
455 $theme_menu_locations = array_keys( get_registered_nav_menus() );
456 $common_header_locations = array(
457 'header-menu',
458 'header',
459 'primary',
460 'main',
461 'menu-1',
462 );
463
464 $selected_location = null;
465 /**
466 * Try to make an educated guess and primary menu location
467 */
468 foreach ( $theme_menu_locations as $location ) {
469 foreach ( $common_header_locations as $common_header_location ) {
470 if ( stripos( $location, $common_header_location ) !== false ) {
471 $selected_location = $location;
472 break;
473 }
474 }
475
476 if ( $selected_location ) {
477 break;
478 }
479 }
480
481 $selected_location = apply_filters( 'kubio/primary_menu_location', $selected_location );
482
483 if ( $selected_location ) {
484
485 $current_set_locations = get_nav_menu_locations();
486
487 $primary_menu_id = Arr::get( $current_set_locations, $selected_location, null );
488
489 if ( $create_menu_items ) {
490
491 if ( ! $primary_menu_id ) {
492 $primary_menu_id = wp_create_nav_menu( __( 'Primary menu', 'kubio' ) );
493 }
494
495 if ( is_wp_error( $primary_menu_id ) ) {
496 return;
497 }
498
499 $menu_items = wp_get_nav_menu_items( $primary_menu_id );
500 $has_front_page = false;
501 $has_blog_page = false;
502
503 foreach ( $menu_items as $menu_item ) {
504
505 if ( ! $has_front_page ) {
506 $menu_item_object_is_front_page = $menu_item->type === 'post_type' && $menu_item->object === 'page' && intval( $menu_item->object_id ) === intval( get_option( 'page_on_front' ) );
507 $custom_url = $menu_item->type === 'custom' ? $menu_item->url : '';
508 $menu_item_link_is_front_page = false;
509 $parsed_url = parse_url( $custom_url );
510
511 if ( $parsed_url && $custom_url ) {
512 $site_url = site_url();
513
514 $parsed_url = array_merge(
515 array(
516 'scheme' => '',
517 'host' => '',
518 'path' => '',
519 ),
520 $parsed_url
521 );
522
523 $menu_item_url = "{$parsed_url['scheme']}://{$parsed_url['host']}{$parsed_url['path']}";
524 $menu_item_link_is_front_page = untrailingslashit( $menu_item_url ) === untrailingslashit( $site_url );
525 }
526
527 if ( $menu_item_object_is_front_page || $menu_item_link_is_front_page ) {
528 $has_front_page = true;
529 }
530 }
531
532 if ( $menu_item->type === 'post_type' && $menu_item->object === 'page' && intval( $menu_item->object_id ) === intval( get_option( 'page_for_posts' ) ) ) {
533 $has_blog_page = true;
534 }
535 }
536
537 if ( ! $has_front_page ) {
538 wp_update_nav_menu_item(
539 $primary_menu_id,
540 0,
541 array(
542 'menu-item-title' => __( 'Home', 'kubio' ),
543 'menu-item-object' => 'page',
544 'menu-item-object-id' => get_option( 'page_on_front' ),
545 'menu-item-type' => 'post_type',
546 'menu-item-status' => 'publish',
547 )
548 );
549 }
550
551 if ( ! $has_blog_page && get_option( 'page_for_posts', 0 ) ) {
552 wp_update_nav_menu_item(
553 $primary_menu_id,
554 0,
555 array(
556 'menu-item-title' => __( 'Blog', 'kubio' ),
557 'menu-item-object' => 'page',
558 'menu-item-object-id' => get_option( 'page_for_posts' ),
559 'menu-item-type' => 'post_type',
560 'menu-item-status' => 'publish',
561 )
562 );
563 }
564 }
565
566 if ( ! $primary_menu_id ) {
567 return;
568 }
569
570 $next_nav_menu_locations = array_merge(
571 $current_set_locations,
572 array(
573 $selected_location => $primary_menu_id,
574 )
575 );
576
577 if ( ! isset( $next_nav_menu_locations['header-menu'] ) ) {
578 $next_nav_menu_locations['header-menu'] = $primary_menu_id;
579 }
580
581 set_theme_mod( 'nav_menu_locations', $next_nav_menu_locations );
582 }
583 }
584
585 public function importTemplates() {
586 $entities = array_keys( Importer::getAvailableTemplates() );
587
588 foreach ( $entities as $slug ) {
589 $is_current_kubio_template = apply_filters( 'kubio/template/is_importing_kubio_template', kubio_theme_has_kubio_block_support(), $slug );
590 Importer::createTemplate( $slug, Importer::getTemplateContent( 'wp_template', $slug ), false, $is_current_kubio_template ? 'kubio' : 'theme' );
591 }
592
593 Flags::set( 'kubio_templates_imported', time() );
594 }
595
596 public function importTemplateParts() {
597 $entities = array_keys( Importer::getAvailableTemplateParts() );
598
599 foreach ( $entities as $slug ) {
600 $is_current_kubio_template = apply_filters( 'kubio/template/is_importing_kubio_template', kubio_theme_has_kubio_block_support(), $slug );
601 Importer::createTemplatePart( $slug, Importer::getTemplateContent( 'wp_template_part', $slug ), false, $is_current_kubio_template ? 'kubio' : 'theme' );
602 }
603
604 Flags::set( 'kubio_template_parts_imported', time() );
605 }
606
607 public static function load() {
608 if ( ! self::$instance ) {
609 self::$instance = new self();
610 }
611
612 return self::$instance;
613 }
614
615 public static function skipAfterSwitchTheme() {
616 set_transient( 'kubio_skip_after_theme_switch', true );
617 }
618
619 public function afterSwitchTheme() {
620 $skip = get_transient( 'kubio_skip_after_theme_switch' );
621
622 if ( $skip ) {
623 delete_transient( 'kubio_skip_after_theme_switch' );
624 return;
625 }
626
627 $this->addCommonFilters();
628
629 add_filter( 'kubio/importer/page_path', array( $this, 'getDesignPagePath' ), 10, 2 );
630 $this->prepareRemoteData( true );
631
632 $this->importDesign();
633
634 $this->importTemplates();
635 $this->importTemplateParts();
636
637 do_action( 'kubio/after_switch_theme' );
638 }
639
640 public function getAvailableTemplates( $current_templates = array() ) {
641
642 $templates = $current_templates;
643
644 if ( kubio_theme_has_kubio_block_support() ) {
645 $templates = Arr::get( $this->remote_content, 'block-templates', array() );
646
647 foreach ( array_keys( $templates ) as $template ) {
648 $templates[ $template ] = null;
649 }
650
651 $templates = array_replace( $templates, $templates );
652 }
653
654 return $templates;
655 }
656
657 public function getAvailableTemplateParts( $current_parts = array() ) {
658
659 $templates = $current_parts;
660
661 if ( kubio_theme_has_kubio_block_support() ) {
662 $templates = Arr::get( $this->remote_content, 'block-template-parts', array() );
663
664 foreach ( array_keys( $templates ) as $template ) {
665 $templates[ $template ] = null;
666 }
667
668 $templates = array_replace( $templates, $templates );
669 }
670
671 return $templates;
672 }
673
674 public function getDesignPagePath( $path, $slug ) {
675 if ( $slug === 'front-page' ) {
676 return null;
677 }
678
679 return $path;
680 }
681
682 public function updateBlocks( $content, $type, $slug ) {
683 $blocks = parse_blocks( $content );
684 $blocks = Importer::maybeImportBlockAssets( $blocks );
685
686 if ( $type === 'wp_template_part' && strpos( $slug, 'footer' ) !== false ) {
687 $blocks = Importer::setBlocksLocks( $blocks, null );
688 }
689
690 return kubio_serialize_blocks( $blocks );
691 }
692
693
694
695 public function getFileContent( $content, $type, $slug ) {
696
697 if ( $content !== null ) {
698 return $content;
699 }
700
701 $category = '';
702 switch ( $type ) {
703 case 'wp_template':
704 $category = 'block-templates';
705 break;
706 case 'wp_template_part':
707 $category = 'block-template-parts';
708 break;
709 case 'page':
710 $category = 'pages';
711 break;
712 }
713
714 return Arr::get( $this->remote_content, "{$category}.{$slug}", '' );
715 }
716
717 public function templateMapPartsTheme( $content, $type ) {
718
719 if ( $type === 'wp_template' || $type === 'wp_template_part' ) {
720 $blocks = parse_blocks( $content );
721 $updated_blocks = kubio_blocks_update_template_parts_theme( $blocks, get_stylesheet() );
722
723 return kubio_serialize_blocks( $updated_blocks );
724 }
725
726 return $content;
727 }
728
729 public function importCustomizerOptions( $content, $type, $slug ) {
730
731 if ( ! kubio_theme_has_kubio_block_support() ) {
732 return $content;
733 }
734
735 $customizer_importer = new CustomizerImporter( $content, $type, $slug );
736
737 return $customizer_importer->process();
738 }
739 }
740