Add a link to the stats page in the adminbar (3 posts)

  1. cedric.charles
    Posted 3 years ago #

    Hi :) !

    I'm trying to add a link to the stats page in the adminbar. To do it, I simply add this code :

    function change_toolbar($wp_toolbar) {
             'id' => 'my-site-stats',
             'title' => 'Statistiques du site',
             'href' => get_home_url($blog->userblog_id).'/wp-admin/index.php?page=wp-piwik_stats'
    add_action('admin_bar_menu', 'change_toolbar', 999);

    The link works but I want to have only the link in the adminbar and not in the admin menu (WP-Piwik), so I did that


    This piece of code removed the adminmenu link but since that when I try to access the stats page through the link in the adminbar, WordPress tells me that I can't access the page... If I remove the unset code above, I can access stats page again...

    Could you help me please ?


  2. braekling
    Plugin Author

    Posted 3 years ago #

    A site has to be registered to WordPress, but I currently don't know how to do this without adding the site to the menu.

    Maybe someone else in this forum can help?

  3. cedric.charles
    Posted 3 years ago #

    Yes please :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP-Piwik
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic