From 9847effc93a33c33a5d741215c6ab047b993e2a2 Mon Sep 17 00:00:00 2001 From: Tim LSC Date: Wed, 17 Sep 2025 14:18:20 +0300 Subject: [PATCH] Allow purge CSS/JS from public function --- src/purge.cls.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/purge.cls.php b/src/purge.cls.php index 96d8db805..c8a937e97 100644 --- a/src/purge.cls.php +++ b/src/purge.cls.php @@ -348,7 +348,26 @@ private function _purge_all_localres( $silence = false ) { } /** - * Alerts LiteSpeed Web Server to purge pages. + * Alerts LiteSpeed Web Server to purge CSS/JS entries. Public function. + * + * @since 7.6 + * @access public + */ + public function purge_all_cssjs( $silence = false, $reason = false ) { + if( $reason ){ + self::cls()->_purge_all_cssjs($silence); + + if ( $reason ) { + self::debug('Cleared CSS/JS. Reason: ' . $reason); + } + } + else{ + self::debug('Cannot clear CSS/JS. Reason is not added.'); + } + } + + /** + * Alerts LiteSpeed Web Server to purge CSS/JS entries. Private function. * * @since 1.2.2 * @access private