Forum Replies Created

Viewing 1 replies (of 1 total)
  • Can you try this:

    function custom_toolbar_link($wp_admin_bar) {
        $wp_admin_bar->add_node(array(
            'id'    => 'clear-all-caches',
            'title' => 'Clear All Caches',
            'href'  => false,
        ));
    
        // Try 'debloat-delete-cache' as the action (matching the page slug)
        $urlDebloat = wp_nonce_url(
            admin_url('admin.php?page=debloat-delete-cache'), 
            'debloat-delete-cache'
        );
        
        $wp_admin_bar->add_node(array(
            'parent' => 'clear-all-caches',
            'id'     => 'clear_debloat_cache',
            'title'  => 'Clear Debloat Cache',
            'href'   => $urlDebloat,
            'meta'   => array('title' => 'Clear Debloat Cache'),
        ));
    }
    add_action('admin_bar_menu', 'custom_toolbar_link', 999);
Viewing 1 replies (of 1 total)