Diff: STRATO-apps/wordpress_03/app/wp-content/plugins/wp-rocket/inc/Engine/Support/CommentTrait.php
Keine Baseline-Datei – Diff nur gegen leer.
1
-
1
+
<?php
2
+
declare(strict_types=1);
3
+
4
+
namespace WP_Rocket\Engine\Support;
5
+
6
+
trait CommentTrait {
7
+
/**
8
+
* Add a comment to the HTML
9
+
*
10
+
* @param string $feature The feature name.
11
+
* @param string $html The HTML content.
12
+
*
13
+
* @return string
14
+
*/
15
+
public function add_meta_comment( $feature, $html ) {
16
+
// This filter is documented in inc/Engine/Support/Meta.php.
17
+
if ( wpm_apply_filters_typed( 'boolean', 'rocket_disable_meta_generator', false ) ) {
18
+
return $html;
19
+
}
20
+
21
+
$result = preg_replace( '#</html>#', '</html><!-- wpr_' . $feature . ' -->', $html, 1 );
22
+
23
+
if ( null === $result ) {
24
+
return $html;
25
+
}
26
+
27
+
return $result;
28
+
}
29
+
}
30
+