Use get_admin_url()
to get the correct My Sites URL without calling switch_to_blog()
directly.
props ocean90. see #31314. git-svn-id: https://develop.svn.wordpress.org/trunk@31448 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
bde2a220d9
commit
83d5751a33
@ -333,13 +333,11 @@ function wp_admin_bar_my_sites_menu( $wp_admin_bar ) {
|
||||
if ( count( $wp_admin_bar->user->blogs ) < 1 && ! is_super_admin() )
|
||||
return;
|
||||
|
||||
switch_to_blog( $wp_admin_bar->user->active_blog->blog_id );
|
||||
$wp_admin_bar->add_menu( array(
|
||||
'id' => 'my-sites',
|
||||
'title' => __( 'My Sites' ),
|
||||
'href' => admin_url( 'my-sites.php' ),
|
||||
'href' => get_admin_url( $wp_admin_bar->user->active_blog->blog_id, 'my-sites.php' ),
|
||||
) );
|
||||
restore_current_blog();
|
||||
|
||||
if ( is_super_admin() ) {
|
||||
$wp_admin_bar->add_group( array(
|
||||
|
Loading…
Reference in New Issue
Block a user