Skip to content

Commit

Permalink
Add nginx helper flush
Browse files Browse the repository at this point in the history
  • Loading branch information
ronilaukkarinen committed Oct 8, 2024
1 parent 61023ec commit 7a79d0b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion inc/admin/adminbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ function air_helper_adminbar_flush_all_caches( $wp_admin_bar ) {
'cache_enabler_clear_cache',
'redis-cache',
'wp-super-cache',
'nginx-helper',
'nginx-helper-purge-all',
];

foreach ( $remove_items as $item ) {
Expand Down Expand Up @@ -250,6 +250,14 @@ function air_helper_flush_all_caches() {
$r = $fs->rmdir( WP_CONTENT_DIR . '/cache/surge/', true );
}

// Flush nginx fastcgi cache
if ( is_plugin_active( 'nginx-helper/nginx-helper.php' ) ) {
// phpcs:disable
// Use: $this->loader->add_action( 'rt_nginx_helper_purge_all', $nginx_purger, 'purge_all' );
// phpcs:enable
do_action( 'rt_nginx_helper_purge_all' );
}

// Redirect back with parameters to show notice
wp_safe_redirect( add_query_arg( 'action', 'flush_all_caches', wp_get_referer() ) );
exit;
Expand Down

0 comments on commit 7a79d0b

Please sign in to comment.