Make WordPress Core

Changeset 31445


Ignore:
Timestamp:
02/13/2015 06:29:57 AM (10 years ago)
Author:
jeremyfelt
Message:

Create the My Sites URL in the context of a user's primary site.

Switch to the user's primary (or active) site before creating the My Sites URL. This previously linked to the current site's dashboard, even if a user was not a member of that site.

Props simonwheatley for the initial patch.

Fixes #31314.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/admin-bar.php

    r31411 r31445  
    334334        return;
    335335
     336    switch_to_blog( $wp_admin_bar->user->active_blog->blog_id );
    336337    $wp_admin_bar->add_menu( array(
    337338        'id'    => 'my-sites',
     
    339340        'href'  => admin_url( 'my-sites.php' ),
    340341    ) );
     342    restore_current_blog();
    341343
    342344    if ( is_super_admin() ) {
Note: See TracChangeset for help on using the changeset viewer.