From 6f1016586fa3d88bfb12ef96522a9134360544c4 Mon Sep 17 00:00:00 2001 From: nacin Date: Thu, 16 Dec 2010 06:12:55 +0000 Subject: [PATCH] Use maybe_network_admin_url. see #15840. git-svn-id: http://svn.automattic.com/wordpress/trunk@16978 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/import.php | 7 +++---- wp-admin/includes/update.php | 12 ++++-------- wp-includes/admin-bar.php | 4 +--- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/wp-admin/import.php b/wp-admin/import.php index 07616a82c..ec9764386 100644 --- a/wp-admin/import.php +++ b/wp-admin/import.php @@ -44,7 +44,6 @@ if ( ! empty( $_GET['invalid'] ) && !empty($popular_importers[$_GET['invalid']][ add_thickbox(); require_once ('admin-header.php'); $parent_file = 'tools.php'; -$href = is_multisite() ? network_admin_url( 'plugin-install.php' ) : admin_url( 'plugin-install.php' ); ?>
@@ -109,8 +108,8 @@ if (empty ($importers)) { } } if ( empty($action) ) - $action = '' . $data[0] . ''; } else { $action = "{$data[0]}"; @@ -131,7 +130,7 @@ if (empty ($importers)) { } if ( current_user_can('install_plugins') ) - echo '

' . sprintf( __('If the importer you need is not listed, search the plugins directory to see if an importer is available.'), esc_url( $href . '?tab=search&type=tag&s=importer' ) ) . '

'; + echo '

' . sprintf( __('If the importer you need is not listed, search the plugins directory to see if an importer is available.'), esc_url( maybe_network_admin_url( 'plugin-install.php?tab=search&type=tag&s=importer' ) ) ) . '

'; ?>
diff --git a/wp-admin/includes/update.php b/wp-admin/includes/update.php index 51b3111fa..32da39146 100644 --- a/wp-admin/includes/update.php +++ b/wp-admin/includes/update.php @@ -98,15 +98,13 @@ function core_update_footer( $msg = '' ) { if ( ! isset( $cur->response ) ) $cur->response = ''; - $href = is_multisite() ? network_admin_url( 'update-core.php' ) : admin_url( 'update-core.php' ); - switch ( $cur->response ) { case 'development' : - return sprintf( __( 'You are using a development version (%1$s). Cool! Please stay updated.' ), $GLOBALS['wp_version'], $href ); + return sprintf( __( 'You are using a development version (%1$s). Cool! Please stay updated.' ), $GLOBALS['wp_version'], maybe_network_admin_url( 'update-core.php' ) ); break; case 'upgrade' : - return sprintf( ''.__( 'Get Version %2$s' ).'', $href, $cur->current); + return sprintf( ''.__( 'Get Version %2$s' ).'', maybe_network_admin_url( 'update-core.php' ), $cur->current); break; case 'latest' : @@ -132,8 +130,7 @@ function update_nag() { return false; if ( current_user_can('update_core') ) { - $href = is_multisite() ? network_admin_url( 'update-core.php' ) : admin_url( 'update-core.php' ); - $msg = sprintf( __('WordPress %1$s is available! Please update now.'), $cur->current, $href ); + $msg = sprintf( __('WordPress %1$s is available! Please update now.'), $cur->current, maybe_network_admin_url( 'update-core.php' ) ); } else { $msg = sprintf( __('WordPress %1$s is available! Please notify the site administrator.'), $cur->current ); } @@ -151,8 +148,7 @@ function update_right_now_message() { $msg = sprintf( __('You are using WordPress %s.'), $GLOBALS['wp_version'] ); if ( isset( $cur->response ) && $cur->response == 'upgrade' && current_user_can('update_core') ) { - $href = is_multisite() ? network_admin_url( 'update-core.php' ) : admin_url( 'update-core.php' ); - $msg .= " " . sprintf( __('Update to %s'), $cur->current ? $cur->current : __( 'Latest' ) ) . ''; + $msg .= " " . sprintf( __('Update to %s'), $cur->current ? $cur->current : __( 'Latest' ) ) . ''; } echo "$msg"; diff --git a/wp-includes/admin-bar.php b/wp-includes/admin-bar.php index c7b71e0c8..6b9564d11 100644 --- a/wp-includes/admin-bar.php +++ b/wp-includes/admin-bar.php @@ -274,9 +274,7 @@ function wp_admin_bar_updates_menu() { $update_title .= sprintf( __('Updates %s'), "" . number_format_i18n($update_count) . '' ); $update_title .= ''; - $href = is_multisite() ? network_admin_url( 'update-core.php' ) : admin_url( 'update-core.php' ); - - $wp_admin_bar->add_menu( array( 'id' => 'updates', 'title' => $update_title, 'href' => $href ) ); + $wp_admin_bar->add_menu( array( 'id' => 'updates', 'title' => $update_title, 'href' => maybe_network_admin_url( 'update-core.php' ) ) ); } /**