Skip to content

Commit 249ae61

Browse files
Allow purge CSS/JS from public function
1 parent 36e1c1d commit 249ae61

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

src/purge.cls.php

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,26 @@ private function _purge_all_localres( $silence = false ) {
348348
}
349349

350350
/**
351-
* Alerts LiteSpeed Web Server to purge pages.
351+
* Alerts LiteSpeed Web Server to purge CSS/JS entries. Public function.
352+
*
353+
* @since 7.6
354+
* @access public
355+
*/
356+
public function purge_all_cssjs( $silence = false, $reason = false ) {
357+
if( $reason ){
358+
self::cls()->_purge_all_cssjs($silence);
359+
360+
if ( $reason ) {
361+
self::debug('Cleared CSS/JS. Reason: ' . $reason);
362+
}
363+
}
364+
else{
365+
self::debug('Cannot clear CSS/JS. Reason is not added.');
366+
}
367+
}
368+
369+
/**
370+
* Alerts LiteSpeed Web Server to purge CSS/JS entries. Private function.
352371
*
353372
* @since 1.2.2
354373
* @access private

thirdparty/elementor.cls.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,6 @@ public static function disable_litespeed_esi() {
5252

5353
public static function regenerate_litespeed_cache() {
5454
do_action('litespeed_purge_all', 'Elementor - Regenerate CSS & Data');
55+
Purge::_purge_all_cssjs(true, 'Elementor - Regenerate CSS & Data');
5556
}
5657
}

0 commit comments

Comments
 (0)