Skip to content
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

Merged

Conversation

timotei-litespeed
Copy link
Contributor

Add filters for post purge events
Add actions for each major purge event + parameters to some actions

Add filters for post purge events
Add actions for each major purge event + parameters to some actions
@@ -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');
Copy link
Collaborator

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?

Copy link
Contributor Author

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

Copy link
Collaborator

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

$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);
Copy link
Collaborator

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.

@@ -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');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here may also need?

@hi-hai hi-hai merged commit a663f40 into litespeedtech:dev Nov 15, 2024
1 check failed
@timotei-litespeed timotei-litespeed deleted the Purge-events_actions_changes branch November 15, 2024 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants