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

Need a hook (action) on Clear cache #5281

Closed
AleksBaikalsky opened this issue Jul 26, 2022 · 2 comments
Closed

Need a hook (action) on Clear cache #5281

AleksBaikalsky opened this issue Jul 26, 2022 · 2 comments

Comments

@AleksBaikalsky
Copy link

AleksBaikalsky commented Jul 26, 2022

Is your feature request related to a problem? Please describe.
I need to execute my function when user clicks 'Clear cache' button.

Describe the solution you'd like
Some action hook, e.g. 'after_rocket_clear_cache'.

Describe alternatives you've considered
Workarounds, and that's not an acceptable solution. Looking through WP Rocket codebase in had no results, maybe I looked in the wrong place.

Additional context
The hook I request is handy in cases when some actions should be fired only on cache update, not on every wp init.

@piotrbak
Copy link
Contributor

Hello @AleksBaikalsky there's a hook when the whole cache is getting cleared:

do_action( 'after_rocket_clean_domain', $root, $lang, $url ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals

In the same file you'll see some other hooks related to cache clearing. Does it answer your question?

@AleksBaikalsky
Copy link
Author

AleksBaikalsky commented Jul 26, 2022

Hello,

Does it answer your question?

Yes, thank you @piotrbak

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

No branches or pull requests

2 participants