Skip to content

Commit 80e57f7

Browse files
Allow purge CSS/JS from public function
1 parent 36e1c1d commit 80e57f7

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-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

0 commit comments

Comments
 (0)