-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PR Redo - Purge actions and filter #776
PR Redo - Purge actions and filter #776
Conversation
Add filters for post purge events Add actions for each major purge event + parameters to some actions
src/purge.cls.php
Outdated
@@ -797,6 +810,7 @@ public function purge_url($url, $purge2 = false, $quite = false) | |||
self::add($hash, $purge2); | |||
|
|||
!$quite && !defined('LITESPEED_PURGE_SILENT') && Admin_Display::success(sprintf(__('Purge url %s', 'litespeed-cache'), $val)); | |||
do_action('litespeed_purged_link'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@timotei-litespeed Maybe add the url as param?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added and looked over other functions and made a few changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good try. There are still some places you may miss. Also some comments added
src/purge.cls.php
Outdated
$recent_comments = $wp_widget_factory->widgets['WP_Widget_Recent_Comments']; | ||
if (!is_null($recent_comments)) { | ||
self::add(Tag::TYPE_WIDGET . $recent_comments->id); | ||
self::add_private(Tag::TYPE_WIDGET . $recent_comments->id); | ||
} | ||
|
||
do_action('litespeed_purged_comment_widget', $recent_comments->id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will result in error if you don't use the way L950 does.
src/purge.cls.php
Outdated
@@ -738,6 +749,7 @@ public function purge_cat($value) | |||
self::add(Tag::TYPE_ARCHIVE_TERM . $cat->term_id); | |||
|
|||
!defined('LITESPEED_PURGE_SILENT') && Admin_Display::success(sprintf(__('Purge category %s', 'litespeed-cache'), $val)); | |||
do_action('litespeed_purged_cat'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here may also need?
Add filters for post purge events
Add actions for each major purge event + parameters to some actions