Add two actions after custom_purge_url unlink_files and get_request
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.
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!