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 two actions after custom_purge_url unlink_files and get_request #310

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

janvitos
Copy link

@janvitos janvitos commented Sep 1, 2023

Added actions rt_nginx_helper_after_unlink_purge_urls and rt_nginx_helper_after_get_purge_urls to fire after custom_purge_url unlink_files and get_request has been completed.

Added actions rt_nginx_helper_after_unlink_purge_urls and rt_nginx_helper_after_get_purge_urls to fire after custom_purge_url unlink_files and get_request has been completed.
@yashhhYB
Copy link

Hello @janvitos,

Thank you for your proposed improvement! I've reviewed the request and implemented the actions rt_nginx_helper_after_unlink_purge_urls and rt_nginx_helper_after_get_purge_urls into the custom_purge_url function. These actions fire at appropriate points, allowing developers to hook into the process seamlessly.

Key Changes:
Action: rt_nginx_helper_after_unlink_purge_urls

Triggered after the unlink_files operation in custom_purge_url.
Parameters passed:
$unlink_files: Result of the unlink_files operation.
$purge_urls: Array of URLs processed.
Action: rt_nginx_helper_after_get_purge_urls

Triggered after the get_request operation in custom_purge_url.
Parameters passed:
$get_request: Result of the GET request operation.
$purge_urls: Array of URLs processed.
Example Usage:
Developers can now hook into these actions as follows:

php

add_action( 'rt_nginx_helper_after_unlink_purge_urls', function( $unlink_files, $purge_urls ) {
// Custom logic after unlinking files
}, 10, 2 );
add_action( 'rt_nginx_helper_after_get_purge_urls', function( $get_request, $purge_urls ) {
// Custom logic after making GET requests
}, 10, 2 );

Let me know if further refinements are needed. I’m happy to contribute!

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