[Plugin: WP-Piwik] Add a link to the stats page in the adminbar
-
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
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘[Plugin: WP-Piwik] Add a link to the stats page in the adminbar’ is closed to new replies.