From 98d35bc1676659393346079cad1eaf97982b47b0 Mon Sep 17 00:00:00 2001 From: Roni Laukkarinen Date: Tue, 8 Oct 2024 16:31:04 +0300 Subject: [PATCH] Remove extra menu bar items for cache plugins --- inc/admin/adminbar.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/inc/admin/adminbar.php b/inc/admin/adminbar.php index 9dbd55b..22aaf9f 100755 --- a/inc/admin/adminbar.php +++ b/inc/admin/adminbar.php @@ -138,6 +138,18 @@ function air_helper_adminbar_flush_all_caches( $wp_admin_bar ) { return; } + $remove_items = apply_filters( 'air_helper_helper_remove_admin_bar_links', [ + 'autoptimize', + 'cache_enabler_clear_cache', + 'redis-cache', + 'wp-super-cache', + 'nginx-helper', + ] ); + + foreach ( $remove_items as $item ) { + $wp_admin_bar->remove_menu( $item ); + } + $wp_admin_bar->add_node( [ 'id' => 'flushallcaches', 'title' => __( 'Flush all caches', 'air-helper' ),