WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. cedric.charles
    Member
    Posted 2 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) {
         $wp_toolbar->add_node(array(
             '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

    unset($submenu['index.php'][6]);

    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 ?
    Thanks

    http://wordpress.org/extend/plugins/wp-piwik/

  2. braekling
    Member
    Plugin Author

    Posted 2 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
    Member
    Posted 2 years ago #

    Yes please :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags