#2520 closed enhancement (fixed)
No Multisite no 'my-blogs' adminbar menu item - replacement function to add dashboard links
Reported by: | hnla | Owned by: | |
---|---|---|---|
Milestone: | 1.5 | Priority: | minor |
Severity: | Version: | ||
Component: | Core | Keywords: | bp_adminbar, menus |
Cc: |
Description
This is thrown up and is minor issue/enhancement.
On non multisite installs adminbar does not have my-blogs link thus no easy access to dashboard.
Added new function to add back links to various dashboard pages in bp-core-adminbar.php for testing removed to functions.php for practicalities sake.
{{{<?php function no_multisite_dashboard_link() {
global $bp; ?>
<li><a href="<?php site_url() ?>/wp-admin/">Dashboard</a>
<ul>
<li><a href="<?php site_url() ?>/wp-admin/post-new.php">Post New</a></li>
<li><a href="<?php site_url() ?>/wp-admin/post-new.php?post_type=page">Create Page</a></li>
<li><a href="<?php site_url() ?>/wp-admin/widgets.php">Widgets</a></li>
</ul>
</li>
<?php }
if (!bp_core_is_multisite())
add_action('bp_adminbar_menus', 'no_multisite_dashboard_link');
}}}
Just throwing this out there and expect there is a better approach to this working the existing function bp_adminbar_blogs_menu()
Change History (3)
#3
@
14 years ago
<i>- is only visible to people who have at least 'edit_posts' capability on the blog</i>
I had to create a little function along the same lines as the one I showed above but to allow users elevated above 'subscriber' as they were not receiving any links on single or multi site so grabbed wp_user_level and ran a check against that to allow links to dashboard or if admin to widgets etc - struck me that I should combine the two functions to one really until a improved adminbar is worked up.
Nice idea. I'm about to commit a patch that adds an item to the adminbar which:
If you want to add more items, you can do so with the hook 'bp_adminbar_thisblog_items'.
(BTW the way that this adminbar is built is not very appealing, but it will probably change significantly when the new WP core admin bar is ruled out. So this commit might end up being a stopgap that never actually sees release :) )