Support » Plugin: Multisite Admin Bar Switcher » Make First Link go to site, not dashboard

  • I would like to remove all of the additional links in the alphabet listing part, and just have the sites listed, and have the link go to the site, not the dashboard. That way, people who are browsing our network who are not going to be admins of each site they go to, do not get insufficient permissions screens when they click the first link to a site. I have also made this change:

    // Add 'Your Site'
    	$url = get_admin_url( $current_blog->blog_id );
    	$wp_admin_bar->add_menu(array(
    		'parent' => 'mabs',
    		'id' => 'mabs_yoursite',
    		'title' =>__('This Site'),
    		'href' => str_replace('/wp-admin/', '', $url)

    so the current site they visit does not say YOUR site, as that is not always the case, they can just be visiting. Having it say This site is much more logical I think.

    I have not quite figured out how to make the change needed to make the site name in the alphabet list, link to the site not the dashboard, and remove the additional drop down for each site. I basically just want people to be able to get back to sites they have visited easier. 99% of the time there will only be one admin per site. any help appreciated!

    https://wordpress.org/plugins/multisite-admin-bar-switcher/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter AIPman1

    (@aipman1)

    Ok, removing this from the code, removes the additional menu options:

    mabs_display_blog_pages($user, $letter.$i, $admin_url);

    Will report when I figure out how to change the URL to remove the /wp-admin/ from it.

    Thread Starter AIPman1

    (@aipman1)

    ok folks, for those looking…this accomplishes the alphabet links going to the site not the dashboard with no other frills…

    //Add the site
    		$wp_admin_bar->add_menu(array(
    			'parent' => $site_parent,
    			'id' => 'mabs_'.$letter.$i,
    			'title' => apply_filters('mabs_blog_name', $blog->blogname, $blog),
    			'href' => str_replace('wp-admin/','',$admin_url),
    			'meta' => array(
    				'class' => 'mabs_blog',
    			),
    		));
    
    		//Add site submenu options
    
    		$i++;

    it also keeps intact the This Site additional links if the user has permissions for them so they can admin a site once there, so, this plug in is perfect for me now! thanks for the code, and hope the info helps anyone needing it.

    Plugin Author flynsarmy

    (@flynsarmy)

    For such a large change, you might just want your own plugin rather than mine. Remove existing menu, add your own.

    I can add a filter for Your Site. Not sure how to best handle the rest of your changes.

    Thread Starter AIPman1

    (@aipman1)

    Perhaps I wasn’t clear? I did accomplish everything I wanted with just the few small changes I made. One word change, removing one line of code that placed the additional pages of a site next to it’s name in the alphabet presentation part, and changing 'href' => $admin_url), to 'href' => str_replace('wp-admin/','',$admin_url), in the add the site part.

    I also commented out the search as I didn’t want that, but that was easy too. If I meed to MAKE this a different plug in i don’t know. But it actually wasn’t hard to accomplish what I wanted with it once I figured out what did what in the code. I’m no coder. lol.

    The network still shows to those who have that access, and the pages a user has access to are accessible in the This Site so if it is a site they own, they can go to the dashboard then, or if it isn’t, things only show that they have permissions for, etc. seems perfect to me now.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Make First Link go to site, not dashboard’ is closed to new replies.