How do I use the branding plugin to hide my sites from the admin bar, except for me, the admin?

I am having a problem with the custom admin bar plugin.
First, I can't seem to hide "my sites" from it, without it hiding my way of being the admin and getting from one admin dash to another.
I need to be able to hide things and add things to that bar, and choose for whom it will show or hide.
And, well, secondly, I want to add custom links to that bar like you did up there

  • Tom Eagles

    @william_bronson the links above are part of a customised version of the bbpress forums made for this website.

    Disabling the dashboard to admins only can be done by this

    @Kimberly found it for me the other day

    http://www.tutorialstag.com/restrict-wordpress-dashboard-access.html

    I am in the middle of putting a mini guide together for how to customise the main admin bar with new menu items, just pulling a load of resources together in a more user friendly format, i hope to finish it this weekend. (it will need some custom coding but hopefully the guide will explain it well enough for all levels of experience)

    @happyimu that ony adds the drop down menu under the left most tab for example here under the wpmudev graphic.

  • william_bronson

    ummm no
    I am using the ultimate branding plugin

    The problem is 2 things
    1. first, hiding my sites menu on the bar, removes it for everyone, including me.
    2. adding a new link only adds it to the dropdown when you mouse over the logo. It does not give you the option, like some other plugins, to add something to the top bar, like in the Ultimate Branding plugin sales picture, or the WPMU DEV bar that you see right now!

    Come on guys, really?

    Am I missing something here?
    Are you using your own plugin, or did you do more custom stuff than the plugin allows, like this forum itself?

    I must say, I find it frustrating that the very reason I spent the money to join here is that I was impressed by your site. It's clearly world class and illustrates what can be accomplished. But, by whom? A custom team of programmers I guess.

    Perhaps the branding plugin does do what I want, but in 6 hours I can't figure out how to make it like the one at the top of this site.

  • Tom Eagles

    @william_bronson as i pointed out in my post the branding plug in will not do what you asked.

    Using the hide my sites feature does hide it for the admin aswell however as superadmin you can still reach all sites via the dashboard menu item sites.

    secondly the menu tabs you see at the top of the forum are a highly customised version of the BBPress forums not a wordpress admin menu. as i mentioned in my first post.

    So as i said to modify the admin menu it would involve custom coding. As i mentioned i am going to put a tutorial together for this, there are plenty of code snippets around to do that.

    The link i gave you will allow you to even hide the dashboard aswell to all except the admin of that site.

    But in short you could do the following to remove the my site link on the admin bar

    function remove_admin_bar_links() {
    	global $wp_admin_bar;
    	$wp_admin_bar->remove_menu('my-sites');
    	}
    add_action( 'wp_before_admin_bar_render', 'remove_admin_bar_links' );

    To add items do this.

    function my_admin_bar_link() {
    	global $wp_admin_bar;
    	if ( !is_super_admin() || !is_admin_bar_showing() )
    		return;
    	$wp_admin_bar->add_menu( array(
    	'id' => 'diww',
    	'parent' => 'my-blogs',
    	'title' => __( 'Do It With WordPress'),
    	'href' => admin_url( 'http://www.doitwithwp.com/wp-admin.php' )
    	) );
    }
    add_action('admin_bar_menu', 'my_admin_bar_link');

    To create a totally new custom bar this is the code.

    for a completely custom menu do this

    function my_admin_bar_menu() {
    	global $wp_admin_bar;
    	if ( !is_super_admin() || !is_admin_bar_showing() )
    		return;
    	$wp_admin_bar->add_menu( array(
    	'id' => 'social_networks',
    	'title' => __( 'Social Networks'),
    	'href' => FALSE ) );
    	$wp_admin_bar->add_menu( array(
    	'parent' => 'social_networks',
    	'title' => __( 'Facebook'),
    	'href' => 'http://www.facebook.com/doitwithwp' ) );
    	$wp_admin_bar->add_menu( array(
    	'parent' => 'social_networks',
    	'title' => __( 'Twitter'),
    	'href' => 'http://www.twitter.com/daclements' ) );
    }
    add_action('admin_bar_menu', 'my_admin_bar_menu');

    to set the position of the menu pass one more variable

    like this

    add_action('admin_bar_menu', 'my_admin_bar_menu', xxx );

    where xxx is the position try in increments of 10 untill you get the right spot.

    all of these items go in your functions.php file.

  • Tom Eagles

    @william_bronson make a backup of the original file before applying these parts of the code. then just have a working copy that you can edit / add bits to, if it goes wrong you have your original to fall back on. ( just download mine to the desktop rename it to anything edit it and do save as functions.php) then upload the new version. this way i never lose the original by saving over it by mistake.

    :slight_smile:

    Like i said a more invoved tutorial is coming up soon, including creating nav bars for custom posts. It's just a matter of time , ok having some free time lol.

    Plugins are cool but sometimes you just have to get your hands dirty in code to do things.

    There are plenty of code snippets around but not that many tutorials with them that make them easy for a relatively inexperienced coder to implement them with, which is what i want to aim for. But anyone must have a basic idea so they know what to tweak etc prior to editing code.

    Some themes dont handle code or follow wordpress standards so what works on 90% wont work on all unfortunately,

    Anyway glad to help holler back if needed just put a @ in front of my username and it will let me know you posted.

  • aecnu

    Greetings william_bronson,

    Thank you for these great questions and significant items to bring up.

    The first thing I would like to know is who were you addressing in this post?
    https://premium.wpmudev.org/forums/topic/how-do-i-use-the-branding-plugin-to-hide-my-sites-from-the-admin-bar-except-for-me-the-admin#post-277558

    Specifically:

    Come on guys, really?
    Am I missing something here?
    Are you using your own plugin, or did you do more custom stuff than the plugin allows, like this forum itself?

    The other people who are regular members that responded to your ticket?

    I must say, I find it frustrating that the very reason I spent the money to join here is that I was impressed by your site. It's clearly world class and illustrates what can be accomplished. But, by whom? A custom team of programmers I guess.

    This site was indeed coded from a custom coded version of the original v 1.0 of bbPress, and though I do not even know the specifics because the items were compartmentalized, the issue regarding the admin bar is not.

    Have you tried our Custom Admin Bar plugin by any chance?

    Please advise.

    Cheers, Joe

  • william_bronson

    my mistake. I apologize happyimu,
    Yes, I think I have the custom admin bar plugin, inside the ultimate branding plugin.

    My review so far:
    It allowed me to replace the top left image. Cool
    It allowed me to create a custom drop down menu below that image. Cool
    It allowed me to hide some things from the top bar. But,
    I can't figure out why some already didnt show for regular subscribers and some only on my admin login. And if I try to hide the my sites menu, it hides it for me too, as the super admin, making it hard for me to manage the multisite operations.
    Also, I can't replace or hide the wordpress icon next to the sites under mysites without custom coding.

    I think you sent me some ideas on that to modify my functions.php but i'm worried I will lose control over all of this when an update is done.
    I'd rather do it in a location that will stick with updates. That's why I went with your plugin, so it would update with wordpress along the way.

    Right now my navigation is doable but not ideal.
    Here's a screen shot.
    Since all members have access to the members area and forum, I'd like to at least hide that wordpress icon. I suppose I could just replace it and then remember to do it after updates.

    If you want to take an interest into my development with your plugins and give me pointers, I'd love that. You can join at http://mybizpower.com/register and see what a user sees. I'm about to enable and configure affiliates plugin to go with my membership, but I wanted to get everything working so far, FIRST.

    Please, if you have time to just peruse what I've done already, I really want to make wpmu dev stuff my main content. I hated not using your q&a and or forum plugins, but I used simple press. If you recommend them to emulate what you have here with community, let me know. Otherwise, I'll have to learn to use simple press or bbpress.

  • Tom Eagles

    hi there @william_bronson

    I think you sent me some ideas on that to modify my functions.php but i'm worried I will lose control over all of this when an update is done.
    I'd rather do it in a location that will stick with updates. That's why I went with your plugin, so it would update with wordpress along the way.

    You could simply create a text file of the edits you made to the functions.php, so if the theme is ever updated it would be just a simple copy and paste into the new version and upload it. That or test it using a child theme.

    I take it reading through your other threads your site isnt live yet? so this is a great time to try these things out first. Just downalod the original functions.php open it up in an editor of your choice then save as something like backup_functions.php then make your edits on the functions.php upload test it if it doesnt work then just reupload the original. Just takes a few seconds.

    If i am testing something like this i just put up an under maintenance message for the few seconds it takes to test things like this.