Use get_admin_url() to get the correct My Sites URL without calling switch_to_blog() directly.

props ocean90.
see #31314.
Built from https://develop.svn.wordpress.org/trunk@31448


git-svn-id: http://core.svn.wordpress.org/trunk@31429 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2015-02-13 12:53:25 +00:00
parent e2f5a8094e
commit 7e71b1f827
2 changed files with 10 additions and 12 deletions

View File

@ -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(
@ -681,10 +679,10 @@ function wp_admin_bar_appearance_menu( $wp_admin_bar ) {
}
if ( current_theme_supports( 'widgets' ) ) {
$wp_admin_bar->add_menu( array(
'parent' => 'appearance',
'id' => 'widgets',
'title' => __( 'Widgets' ),
$wp_admin_bar->add_menu( array(
'parent' => 'appearance',
'id' => 'widgets',
'title' => __( 'Widgets' ),
'href' => admin_url( 'widgets.php' ),
'meta' => array(
'class' => 'hide-if-customize',
@ -692,10 +690,10 @@ function wp_admin_bar_appearance_menu( $wp_admin_bar ) {
) );
if ( current_user_can( 'customize' ) ) {
$wp_admin_bar->add_menu( array(
'parent' => 'appearance',
'id' => 'customize-widgets',
'title' => __( 'Widgets' ),
$wp_admin_bar->add_menu( array(
'parent' => 'appearance',
'id' => 'customize-widgets',
'title' => __( 'Widgets' ),
'href' => add_query_arg( urlencode( 'autofocus[panel]' ), 'widgets', $customize_url ), // urlencode() needed due to #16859
'meta' => array(
'class' => 'hide-if-no-customize',

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.2-alpha-31447';
$wp_version = '4.2-alpha-31448';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.