Skip to content

Commit

Permalink
Merge pull request #29 from newfold-labs/fix/PRESS7-78-clear-cache-ba…
Browse files Browse the repository at this point in the history
…ck-to-the-wpadminbar

put back the caching admin bar item and dynamically set the performance settings link…
  • Loading branch information
arunshenoy99 authored Dec 14, 2024
2 parents e8537e7 + d2577fe commit e082ccc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions includes/Performance.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ public function __construct( Container $container ) {
$cacheManager = new CacheManager( $container );
$cachePurger = new CachePurgingService( $cacheManager->getInstances() );

add_action( 'admin_bar_menu', array( $this, 'adminBarMenu' ), 100 );
new LinkPrefetch( $container );
new RestApi();

// Ensure that purgeable cache types are enabled before showing the UI.
if ( $cachePurger->canPurge() ) {
Expand Down Expand Up @@ -263,7 +263,6 @@ public function adminBarMenu( \WP_Admin_Bar $wp_admin_bar ) {
}

if ( current_user_can( 'manage_options' ) ) {

$wp_admin_bar->add_node(
array(
'id' => 'nfd_purge_menu',
Expand Down Expand Up @@ -291,12 +290,13 @@ public function adminBarMenu( \WP_Admin_Bar $wp_admin_bar ) {
);
}

$brand = $this->container->get( 'plugin' )['id'];
$wp_admin_bar->add_node(
array(
'id' => 'nfd_purge_menu-cache_settings',
'title' => __( 'Cache Settings', 'newfold-module-performance' ),
'parent' => 'nfd_purge_menu',
'href' => admin_url( 'options-general.php#' . self::SETTINGS_ID ),
'href' => admin_url( "admin.php?page=$brand#/performance" ),
)
);
}
Expand Down

0 comments on commit e082ccc

Please sign in to comment.