Skip to content

Commit

Permalink
Remove extra menu bar items for cache plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
ronilaukkarinen committed Oct 8, 2024
1 parent 5d6385b commit 98d35bc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions inc/admin/adminbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ),
Expand Down

0 comments on commit 98d35bc

Please sign in to comment.