Diff: STRATO-apps/wordpress_03/app/wp-content/plugins/wp-rocket/inc/ThirdParty/Themes/Flatsome.php

Keine Baseline-Datei – Diff nur gegen leer.
Zur Liste
1 -
1 + <?php
2 + declare(strict_types=1);
3 +
4 + namespace WP_Rocket\ThirdParty\Themes;
5 +
6 + use WP_Rocket\Event_Management\Subscriber_Interface;
7 +
8 + class Flatsome implements Subscriber_Interface {
9 + /**
10 + * Return an array of events that this subscriber wants to listen to.
11 + *
12 + * @return array
13 + */
14 + public static function get_subscribed_events() {
15 + return [
16 + 'rocket_rucss_inline_content_exclusions' => 'preserve_patterns',
17 + ];
18 + }
19 +
20 + /**
21 + * Preserves the CSS patterns when adding the used CSS to the page
22 + *
23 + * @since 3.11
24 + *
25 + * @param array $patterns Array of patterns to preserve.
26 + *
27 + * @return array
28 + */
29 + public function preserve_patterns( $patterns ): array {
30 +
31 + $preserve = [
32 + '#section_',
33 + '#text-box-',
34 + '#banner-',
35 + '#slider-',
36 + '#gap-',
37 + '#image_',
38 + '#row-',
39 + '#text-',
40 + '#banner-grid-',
41 + '#cats-',
42 + '#col-',
43 + '#gallery-',
44 + '#instagram-',
45 + '#map-',
46 + '#page-header-',
47 + '#pages-',
48 + '#panel-',
49 + '#portfolio-',
50 + '#product-flip-',
51 + '#product-grid-',
52 + '#stack-',
53 + '#timer-',
54 + '#title-',
55 + ];
56 +
57 + return array_merge( $patterns, $preserve );
58 + }
59 + }
60 +