PluginProbe
Elementor Website Builder – more than just a page builder / 3.23.0-beta5
Elementor Website Builder – more than just a page builder v3.23.0-beta5
4.3.2 4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 All 455 releases
← All changes | includes/frontend.php +105 -166 4.1.5 → 3.23.0-beta5 View file →
@@ -1,12 +1,11 @@
1 1 <?php
2 2 namespace Elementor;
3 3
4 4 use Elementor\Core\Base\App;
5 -use Elementor\Core\Base\Elements_Iteration_Actions\Assets;
6 -use Elementor\Core\Files\Fonts\Google_Font;
7 5 use Elementor\Core\Frontend\Render_Mode_Manager;
8 6 use Elementor\Core\Responsive\Files\Frontend as FrontendFile;
7 +use Elementor\Core\Files\CSS\Global_CSS;
9 8 use Elementor\Core\Files\CSS\Post as Post_CSS;
10 9 use Elementor\Core\Files\CSS\Post_Preview;
11 10 use Elementor\Core\Responsive\Responsive;
12 11 use Elementor\Core\Settings\Manager as SettingsManager;
@@ -32,13 +31,8 @@
32 31 */
33 32 const THE_CONTENT_FILTER_PRIORITY = 9;
34 33
35 34 /**
36 - * The priority of the frontend enqueued styles.
37 - */
38 - const ENQUEUED_STYLES_PRIORITY = 20;
39 -
40 - /**
41 35 * Post ID.
42 36 *
43 37 * Holds the ID of the current post.
44 38 *
@@ -146,9 +140,21 @@
146 140 private $body_classes = [
147 141 'elementor-default',
148 142 ];
149 143
144 + private $google_fonts_index = 0;
145 +
150 146 /**
147 + * @var string
148 + */
149 + private $e_swiper_asset_path;
150 +
151 + /**
152 + * @var string
153 + */
154 + private $e_swiper_version;
155 +
156 + /**
151 157 * Front End constructor.
152 158 *
153 159 * Initializing Elementor front end. Make sure we are not in admin, not and
154 160 * redirect from old URL structure of Elementor editor.
@@ -167,16 +173,13 @@
167 173 add_action( 'wp_enqueue_scripts', [ $this, 'register_scripts' ], 5 );
168 174 add_action( 'wp_enqueue_scripts', [ $this, 'register_styles' ], 5 );
169 175
170 176 $this->add_content_filter();
177 + $this->init_swiper_settings();
171 178
172 179 // Hack to avoid enqueue post CSS while it's a `the_excerpt` call.
173 180 add_filter( 'get_the_excerpt', [ $this, 'start_excerpt_flag' ], 1 );
174 181 add_filter( 'get_the_excerpt', [ $this, 'end_excerpt_flag' ], 20 );
175 -
176 - if ( version_compare( get_bloginfo( 'version' ), '6.9', '>=' ) ) {
177 - add_filter( 'wp_should_output_buffer_template_for_enhancement', '__return_false', 1 );
178 - }
179 182 }
180 183
181 184 /**
182 185 * Get module name.
@@ -233,27 +236,36 @@
233 236
234 237 $document = Plugin::$instance->documents->get( $this->post_id );
235 238
236 239 if ( is_singular() && $document && $document->is_built_with_elementor() ) {
237 - add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_styles' ], self::ENQUEUED_STYLES_PRIORITY );
240 + add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_styles' ] );
238 241 }
239 242
240 243 // Priority 7 to allow google fonts in header template to load in <head> tag
241 244 add_action( 'wp_head', [ $this, 'print_fonts_links' ], 7 );
245 + add_action( 'wp_head', [ $this, 'print_google_fonts_preconnect_tag' ], 8 );
242 246 add_action( 'wp_head', [ $this, 'add_theme_color_meta_tag' ] );
243 247 add_action( 'wp_footer', [ $this, 'wp_footer' ] );
244 248 }
245 249
250 + public function print_google_fonts_preconnect_tag() {
251 + if ( 0 >= $this->google_fonts_index ) {
252 + return;
253 + }
254 +
255 + echo '<link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin>';
256 + }
257 +
246 258 /**
247 259 * @since 2.0.12
248 260 * @access public
249 - * @param string|array $class_name
261 + * @param string|array $class
250 262 */
251 - public function add_body_class( $class_name ) {
252 - if ( is_array( $class_name ) ) {
253 - $this->body_classes = array_merge( $this->body_classes, $class_name );
263 + public function add_body_class( $class ) {
264 + if ( is_array( $class ) ) {
265 + $this->body_classes = array_merge( $this->body_classes, $class );
254 266 } else {
255 - $this->body_classes[] = $class_name;
267 + $this->body_classes[] = $class;
256 268 }
257 269 }
258 270
259 271 /**
@@ -323,8 +335,14 @@
323 335 public function add_content_filter() {
324 336 add_filter( 'the_content', [ $this, 'apply_builder_in_content' ], self::THE_CONTENT_FILTER_PRIORITY );
325 337 }
326 338
339 + public function init_swiper_settings() {
340 + $e_swiper_latest = Plugin::$instance->experiments->is_feature_active( 'e_swiper_latest' );
341 + $this->e_swiper_asset_path = $e_swiper_latest ? 'assets/lib/swiper/v8/' : 'assets/lib/swiper/';
342 + $this->e_swiper_version = $e_swiper_latest ? '8.4.5' : '5.3.6';
343 + }
344 +
327 345 /**
328 346 * Remove content filter.
329 347 *
330 348 * When the Elementor generated content rendered, we remove the filter to prevent multiple
@@ -376,12 +394,14 @@
376 394 true
377 395 );
378 396
379 397 wp_register_script(
380 - 'swiper',
381 - $this->get_js_assets_url( 'swiper', 'assets/lib/swiper/v8/' ),
382 - [],
383 - '8.4.5',
398 + 'elementor-waypoints',
399 + $this->get_js_assets_url( 'waypoints', 'assets/lib/waypoints/' ),
400 + [
401 + 'jquery',
402 + ],
403 + '4.0.2',
384 404 true
385 405 );
386 406
387 407 wp_register_script(
@@ -389,9 +409,9 @@
389 409 $this->get_js_assets_url( 'flatpickr', 'assets/lib/flatpickr/' ),
390 410 [
391 411 'jquery',
392 412 ],
393 - '4.6.13',
413 + '4.1.4',
394 414 true
395 415 );
396 416
397 417 wp_register_script(
@@ -419,9 +439,9 @@
419 439 $this->get_js_assets_url( 'dialog', 'assets/lib/dialog/' ),
420 440 [
421 441 'jquery-ui-position',
422 442 ],
423 - '4.9.4',
443 + '4.9.0',
424 444 true
425 445 );
426 446
427 447 wp_register_script(
@@ -448,8 +468,9 @@
448 468 'elementor-frontend',
449 469 $this->get_js_assets_url( 'frontend' ),
450 470 [
451 471 'elementor-frontend-modules',
472 + 'elementor-waypoints',
452 473 'jquery-ui-position',
453 474 ],
454 475 ELEMENTOR_VERSION,
455 476 true
@@ -454,10 +475,8 @@
454 475 ELEMENTOR_VERSION,
455 476 true
456 477 );
457 478
458 - $this->register_frontend_handlers();
459 -
460 479 /**
461 480 * After frontend register scripts.
462 481 *
463 482 * Fires after Elementor frontend scripts are registered.
@@ -477,12 +496,8 @@
477 496 * @since 1.2.0
478 497 * @access public
479 498 */
480 499 public function register_styles() {
481 - $min_suffix = Utils::is_script_debug() ? '' : '.min';
482 - $direction_suffix = is_rtl() ? '-rtl' : '';
483 - $has_custom_breakpoints = Plugin::$instance->breakpoints->has_custom_breakpoints();
484 -
485 500 /**
486 501 * Before frontend register styles.
487 502 *
488 503 * Fires before Elementor frontend styles are registered.
@@ -508,9 +523,9 @@
508 523 wp_register_style(
509 524 'flatpickr',
510 525 $this->get_css_assets_url( 'flatpickr', 'assets/lib/flatpickr/' ),
511 526 [],
512 - '4.6.13'
527 + '4.1.4'
513 528 );
514 529
515 530 wp_register_style(
516 531 'elementor-gallery',
@@ -518,70 +533,32 @@
518 533 [],
519 534 '1.2.0'
520 535 );
521 536
522 - wp_register_style(
523 - 'e-apple-webkit',
524 - $this->get_frontend_file_url( 'apple-webkit.min.css', $has_custom_breakpoints, 'conditionals/' ),
525 - [],
526 - $has_custom_breakpoints ? null : ELEMENTOR_VERSION
527 - );
537 + $min_suffix = Utils::is_script_debug() ? '' : '.min';
528 538
529 - wp_register_style(
530 - 'e-swiper',
531 - $this->get_css_assets_url( 'e-swiper', 'assets/css/conditionals/' ),
532 - [ 'swiper' ],
533 - ELEMENTOR_VERSION
534 - );
539 + $direction_suffix = is_rtl() ? '-rtl' : '';
535 540
536 - wp_register_style(
537 - 'swiper',
538 - $this->get_css_assets_url( 'swiper', 'assets/lib/swiper/v8/css/' ),
539 - [],
540 - '8.4.5'
541 - );
541 + $frontend_base_file_name = $this->is_optimized_css_mode() ? 'frontend-lite' : 'frontend';
542 542
543 - wp_register_style(
544 - 'elementor-wp-admin-bar',
545 - $this->get_css_assets_url( 'admin-bar', 'assets/css/' ),
546 - [],
547 - ELEMENTOR_VERSION
548 - );
543 + $frontend_file_name = $frontend_base_file_name . $direction_suffix . $min_suffix . '.css';
549 544
545 + $has_custom_breakpoints = Plugin::$instance->breakpoints->has_custom_breakpoints();
546 +
550 547 wp_register_style(
551 - 'e-lightbox',
552 - $this->get_frontend_file_url( 'lightbox.min.css', $has_custom_breakpoints, 'conditionals/' ),
548 + 'elementor-frontend',
549 + $this->get_frontend_file_url( $frontend_file_name, $has_custom_breakpoints ),
553 550 [],
554 551 $has_custom_breakpoints ? null : ELEMENTOR_VERSION
555 552 );
556 553
557 554 wp_register_style(
558 - 'elementor-frontend',
559 - $this->get_frontend_file_url( "frontend{$min_suffix}.css", $has_custom_breakpoints ),
555 + 'swiper',
556 + $this->get_css_assets_url( 'swiper', $this->e_swiper_asset_path . 'css/' ),
560 557 [],
561 - $has_custom_breakpoints ? null : ELEMENTOR_VERSION
558 + $this->e_swiper_version
562 559 );
563 560
564 - $widgets_with_styles = Plugin::$instance->widgets_manager->widgets_with_styles();
565 - foreach ( $widgets_with_styles as $widget_name ) {
566 - wp_register_style(
567 - "widget-{$widget_name}",
568 - $this->get_css_assets_url( "widget-{$widget_name}", null, true, true ),
569 - [ 'elementor-frontend' ],
570 - ELEMENTOR_VERSION
571 - );
572 - }
573 -
574 - $widgets_with_responsive_styles = Plugin::$instance->widgets_manager->widgets_with_responsive_styles();
575 - foreach ( $widgets_with_responsive_styles as $widget_name ) {
576 - wp_register_style(
577 - "widget-{$widget_name}",
578 - $this->get_frontend_file_url( "widget-{$widget_name}{$direction_suffix}.min.css", $has_custom_breakpoints ),
579 - [ 'elementor-frontend' ],
580 - $has_custom_breakpoints ? null : ELEMENTOR_VERSION
581 - );
582 - }
583 -
584 561 /**
585 562 * After frontend register styles.
586 563 *
587 564 * Fires after Elementor frontend styles are registered.
@@ -591,23 +568,8 @@
591 568 do_action( 'elementor/frontend/after_register_styles' );
592 569 }
593 570
594 571 /**
595 - * Register frontend handlers.
596 - *
597 - * Registers all the frontend handlers for widgets and elements.
598 - *
599 - * Fired by `wp_enqueue_scripts` action.
600 - *
601 - * @since 3.25.0
602 - * @access public
603 - */
604 - public function register_frontend_handlers() {
605 - Plugin::$instance->widgets_manager->register_frontend_handlers();
606 - Plugin::$instance->elements_manager->register_frontend_handlers();
607 - }
608 -
609 - /**
610 572 * Enqueue scripts.
611 573 *
612 574 * Enqueue all the frontend scripts.
613 575 *
@@ -623,8 +585,10 @@
623 585 * @since 1.0.0
624 586 */
625 587 do_action( 'elementor/frontend/before_enqueue_scripts' );
626 588
589 + wp_enqueue_script( 'elementor-frontend' );
590 +
627 591 $this->print_config();
628 592
629 593 $this->enqueue_conditional_assets();
630 594
@@ -669,11 +633,9 @@
669 633 }
670 634
671 635 wp_enqueue_style( 'elementor-frontend' );
672 636
673 - if ( is_admin_bar_showing() ) {
674 - wp_enqueue_style( 'elementor-wp-admin-bar' );
675 - }
637 + wp_enqueue_style( 'swiper' );
676 638
677 639 /**
678 640 * After frontend styles enqueued.
679 641 *
@@ -683,44 +645,20 @@
683 645 */
684 646 do_action( 'elementor/frontend/after_enqueue_styles' );
685 647
686 648 if ( ! Plugin::$instance->preview->is_preview_mode() ) {
649 + $this->parse_global_css_code();
650 +
687 651 $post_id = get_the_ID();
688 652 // Check $post_id for virtual pages. check is singular because the $post_id is set to the first post on archive pages.
689 653 if ( $post_id && is_singular() ) {
690 - do_action( 'elementor/post/render', $post_id );
691 - $this->handle_page_assets( $post_id );
692 -
693 654 $css_file = Post_CSS::create( get_the_ID() );
694 655 $css_file->enqueue();
695 656 }
696 - } else {
697 - $post_id = Plugin::$instance->preview->get_post_id();
698 - if ( $post_id ) {
699 - do_action( 'elementor/post/render', $post_id );
700 - }
701 657 }
702 -
703 - do_action( 'elementor/frontend/after_enqueue_post_styles' );
704 658 }
705 659 }
706 660
707 - private function handle_page_assets( $post_id ): void {
708 - $page_assets = get_post_meta( $post_id, Assets::ASSETS_META_KEY, true );
709 - if ( ! empty( $page_assets ) ) {
710 - Plugin::$instance->assets_loader->enable_assets( $page_assets );
711 - return;
712 - }
713 -
714 - $document = Plugin::$instance->documents->get( $post_id );
715 -
716 - if ( ! $document ) {
717 - return;
718 - }
719 -
720 - $document->update_runtime_elements();
721 - }
722 -
723 661 /**
724 662 * Get Frontend File URL
725 663 *
726 664 * Returns the URL for the CSS file to be loaded in the front end. If requested via the second parameter, a custom
@@ -729,20 +667,20 @@
729 667 * @since 3.4.5
730 668 *
731 669 * @access public
732 670 *
733 - * @param string $frontend_file_name
671 + * @param string $frontend_file_name
734 672 * @param boolean $custom_file
735 673 *
736 674 * @return string frontend file URL
737 675 */
738 - public function get_frontend_file_url( $frontend_file_name, $custom_file, $css_subfolder = '' ) {
676 + public function get_frontend_file_url( $frontend_file_name, $custom_file ) {
739 677 if ( $custom_file ) {
740 678 $frontend_file = $this->get_frontend_file( $frontend_file_name );
741 679
742 680 $frontend_file_url = $frontend_file->get_url();
743 681 } else {
744 - $frontend_file_url = ELEMENTOR_ASSETS_URL . 'css/' . $css_subfolder . $frontend_file_name;
682 + $frontend_file_url = ELEMENTOR_ASSETS_URL . 'css/' . $frontend_file_name;
745 683 }
746 684
747 685 return $frontend_file_url;
748 686 }
@@ -755,9 +693,9 @@
755 693 *
756 694 * @since 3.5.0
757 695 * @access public
758 696 *
759 - * @param string $frontend_file_name
697 + * @param string $frontend_file_name
760 698 * @param boolean $custom_file
761 699 *
762 700 * @return string frontend file path
763 701 */
@@ -900,20 +838,8 @@
900 838 * @since 1.9.4
901 839 * @access public
902 840 */
903 841 public function print_fonts_links() {
904 - /**
905 - * Register font styles.
906 - *
907 - * Fires before fonts are processed, allowing add-ons to register
908 - * proper stylesheets for their custom font types via the WordPress API.
909 - *
910 - * @since 3.29.0
911 - *
912 - * @param string[] $fonts_to_enqueue List of font families to be enqueued.
913 - */
914 - do_action( 'elementor/fonts/register_styles', $this->fonts_to_enqueue );
915 -
916 842 $google_fonts = $this->get_list_of_google_fonts_by_type();
917 843
918 844 $this->enqueue_google_fonts( $google_fonts );
919 845 $this->enqueue_icon_fonts();
@@ -944,9 +870,9 @@
944 870 wp_enqueue_style( 'elementor-icons-' . $icon_type );
945 871 $this->enqueued_icon_fonts[] = $css_url;
946 872 }
947 873
948 - // Clear enqueued icons.
874 + //clear enqueued icons
949 875 $this->icon_fonts_to_enqueue = [];
950 876 }
951 877
952 878 /**
@@ -1044,21 +970,29 @@
1044 970 if ( ! $print_google_fonts ) {
1045 971 return;
1046 972 }
1047 973
1048 - $force_enqueue_from_cdn = Plugin::$instance->preview->is_preview_mode();
974 + // Print used fonts
975 + if ( ! empty( $google_fonts['google'] ) ) {
976 + $this->google_fonts_index++;
1049 977
1050 - if ( ! empty( $google_fonts['google'] ) ) {
1051 - foreach ( $google_fonts['google'] as $current_font ) {
1052 - Google_Font::enqueue( $current_font, Google_Font::TYPE_DEFAULT, $force_enqueue_from_cdn );
1053 - }
978 + $fonts_url = $this->get_stable_google_fonts_url( $google_fonts['google'] );
979 +
980 + wp_enqueue_style( 'google-fonts-' . $this->google_fonts_index, $fonts_url ); // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion
1054 981 }
1055 982
1056 983 if ( ! empty( $google_fonts['early'] ) ) {
1057 - foreach ( $google_fonts['early'] as $current_font ) {
1058 - Google_Font::enqueue( $current_font, Google_Font::TYPE_EARLYACCESS, $force_enqueue_from_cdn );
984 + $early_access_font_urls = $this->get_early_access_google_font_urls( $google_fonts['early'] );
985 +
986 + foreach ( $early_access_font_urls as $ea_font_url ) {
987 + $this->google_fonts_index++;
988 +
989 + //printf( '<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/earlyaccess/%s.css">', strtolower( str_replace( ' ', '', $current_font ) ) );
990 +
991 + wp_enqueue_style( 'google-earlyaccess-' . $this->google_fonts_index, $ea_font_url ); // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion
1059 992 }
1060 993 }
994 +
1061 995 }
1062 996
1063 997 /**
1064 998 * Enqueue fonts.
@@ -1079,8 +1013,22 @@
1079 1013 $this->registered_fonts[] = $font;
1080 1014 }
1081 1015
1082 1016 /**
1017 + * Parse global CSS.
1018 + *
1019 + * Enqueue the global CSS file.
1020 + *
1021 + * @since 1.2.0
1022 + * @access protected
1023 + */
1024 + protected function parse_global_css_code() {
1025 + $scheme_css_file = Global_CSS::create( 'global.css' );
1026 +
1027 + $scheme_css_file->enqueue();
1028 + }
1029 +
1030 + /**
1083 1031 * Apply builder in content.
1084 1032 *
1085 1033 * Used to apply the Elementor page editor on the post content.
1086 1034 *
@@ -1147,21 +1095,8 @@
1147 1095
1148 1096 $data = $document->get_elements_data();
1149 1097
1150 1098 /**
1151 - * Filters document elements data after loading.
1152 - *
1153 - * Allows modification of elements data when loading (not saving).
1154 - * Useful for migrations, transformations, or data enrichment.
1155 - *
1156 - * @since 4.0.0
1157 - *
1158 - * @param array $data The elements data array.
1159 - * @param \Elementor\Core\Base\Document $document The document instance.
1160 - */
1161 - $data = apply_filters( 'elementor/document/load/data', $data, $document );
1162 -
1163 - /**
1164 1099 * Frontend builder content data.
1165 1100 *
1166 1101 * Filters the builder content in the frontend.
1167 1102 *
@@ -1257,9 +1192,9 @@
1257 1192 *
1258 1193 * @since 1.0.0
1259 1194 * @access public
1260 1195 *
1261 - * @param int $post_id The post ID.
1196 + * @param int $post_id The post ID.
1262 1197 *
1263 1198 * @param bool $with_css Optional. Whether to retrieve the content with CSS
1264 1199 * or not. Default is false.
1265 1200 *
@@ -1436,8 +1371,9 @@
1436 1371 'playVideo' => esc_html__( 'Play Video', 'elementor' ),
1437 1372 'previous' => esc_html__( 'Previous', 'elementor' ),
1438 1373 'next' => esc_html__( 'Next', 'elementor' ),
1439 1374 'close' => esc_html__( 'Close', 'elementor' ),
1375 + 'a11yCarouselWrapperAriaLabel' => __( 'Carousel | Horizontal scrolling: Arrow Left & Right', 'elementor' ),
1440 1376 'a11yCarouselPrevSlideMessage' => __( 'Previous slide', 'elementor' ),
1441 1377 'a11yCarouselNextSlideMessage' => __( 'Next slide', 'elementor' ),
1442 1378 'a11yCarouselFirstSlideMessage' => __( 'This is the first slide', 'elementor' ),
1443 1379 'a11yCarouselLastSlideMessage' => __( 'This is the last slide', 'elementor' ),
@@ -1448,9 +1384,8 @@
1448 1384 'breakpoints' => Responsive::get_breakpoints(),
1449 1385 // 'responsive' contains the custom breakpoints config introduced in Elementor v3.2.0
1450 1386 'responsive' => [
1451 1387 'breakpoints' => Plugin::$instance->breakpoints->get_breakpoints_config(),
1452 - 'hasCustomBreakpoints' => Plugin::$instance->breakpoints->has_custom_breakpoints(),
1453 1388 ],
1454 1389 'version' => ELEMENTOR_VERSION,
1455 1390 'is_static' => $this->is_static_render_mode(),
1456 1391 'experimentalFeatures' => $active_experimental_features,
@@ -1456,15 +1391,13 @@
1456 1391 'experimentalFeatures' => $active_experimental_features,
1457 1392 'urls' => [
1458 1393 'assets' => $assets_url,
1459 1394 'ajaxurl' => admin_url( 'admin-ajax.php' ),
1460 - 'uploadUrl' => wp_upload_dir()['baseurl'],
1461 1395 ],
1462 1396 'nonces' => [
1463 1397 'floatingButtonsClickTracking' => wp_create_nonce( Module::CLICK_TRACKING_NONCE ),
1464 - 'atomicFormsSendForm' => wp_create_nonce( 'elementor_pro_atomic_forms_send_form' ),
1465 1398 ],
1466 - 'swiperClass' => 'swiper',
1399 + 'swiperClass' => Plugin::$instance->experiments->is_feature_active( 'e_swiper_latest' ) ? 'swiper' : 'swiper-container',
1467 1400 ];
1468 1401
1469 1402 $settings['settings'] = SettingsManager::get_settings_frontend_config();
1470 1403
@@ -1546,9 +1479,9 @@
1546 1479 *
1547 1480 * @access private
1548 1481 * @since 2.0.4
1549 1482 *
1550 - * @param string $content
1483 + * @param $content
1551 1484 *
1552 1485 * @return string
1553 1486 */
1554 1487 private function process_more_tag( $content ) {
@@ -1596,6 +1529,12 @@
1596 1529 */
1597 1530 $more_link = apply_filters( 'the_content_more_link', $more_link, $more_link_text );
1598 1531
1599 1532 return force_balance_tags( $parts['main'] ) . $more_link;
1533 + }
1534 +
1535 + private function is_optimized_css_mode() {
1536 + $is_optimized_css_loading = Plugin::$instance->experiments->is_feature_active( 'e_optimized_css_loading' );
1537 +
1538 + return ! Utils::is_script_debug() && $is_optimized_css_loading && ! Plugin::$instance->preview->is_preview_mode();
1600 1539 }
1601 1540 }