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

Add Before Cached File Purged Action #263

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions admin/class-purger.php
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,16 @@ protected function delete_cache_file_for( $url ) {
* @param string $cached_file Cached file name.
*/
$cached_file = apply_filters( 'rt_nginx_helper_purge_cached_file', $cached_file );

/**
* Fire an action before purging cached file.
*
* @since 2.2.3
*
* @param string $url URL to be purged.
* @param string $cached_file Cached file name.
*/
do_action( 'rt_nginx_helper_before_purge_cached_file', $url, $cached_file );

// Verify cached file exists.
if ( ! file_exists( $cached_file ) ) {
Expand Down