PluginProbe
BerqWP – All-In-One Optimization for Core Web Vitals, Cache, CDN, Images, CSS & JavaScript / 1.9.7
BerqWP – All-In-One Optimization for Core Web Vitals, Cache, CDN, Images, CSS & JavaScript v1.9.7
4.1.16 4.1.15 4.1.14 4.1.13 4.1.12 4.1.11 4.1.10 4.0.30 4.0.29 4.0.28 4.0.27 4.0.26 4.0.24 4.0.25 4.0.23 4.0.22 4.0.21 4.0.19 4.0.18 4.0.17 4.0.16 1.9.3 1.9.4 1.9.5 1.9.6 All 170 releases
searchpro / inc / photon / integration / theme / salient.php

salient.php in BerqWP – All-In-One Optimization for Core Web Vitals, Cache, CDN, Images, CSS & JavaScript 1.9.7, at inc/photon/integration/theme/salient.php

25 lines 848 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if (!defined('ABSPATH')) exit;
3
4 class Salient {
5 function __construct() {
6 add_filter('berqwp_before_script_optimization', [$this, 'fix_sticky_sidebar']);
7 }
8
9 function fix_sticky_sidebar($buffer) {
10 $achorScript = '/salient/js/build/third-party/stickkit.js';
11 $appendMarkerMatch = '/salient/js/build/init.js';
12
13 if (strpos($buffer, $achorScript) !== false && strpos($buffer, $appendMarkerMatch) !== false) {
14 $scriptSeqManipulate = new scriptSeqManipulate();
15 $scriptSeqManipulate->setBuffer($buffer);
16 $scriptSeqManipulate->appendBefore($achorScript, $appendMarkerMatch);
17 $buffer = $scriptSeqManipulate->getBuffer();
18 $scriptSeqManipulate->clean();
19 unset($scriptSeqManipulate);
20 }
21
22 return $buffer;
23 }
24 }
25 new Salient();