Make network_admin_url() return admin_url() when not multisite like its home and site counterparts. Kill the now redundant maybe_network_admin_url() function. fixes #15840.

git-svn-id: http://svn.automattic.com/wordpress/trunk@16994 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-12-16 09:31:42 +00:00
parent 49c11dc768
commit eb574d4e5f
4 changed files with 10 additions and 24 deletions

View File

@ -108,7 +108,7 @@ if (empty ($importers)) {
}
}
if ( empty($action) )
$action = '<a href="' . esc_url( maybe_network_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_slug .
$action = '<a href="' . esc_url( network_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_slug .
'&from=import&TB_iframe=true&width=600&height=550' ) ) . '" class="thickbox" title="' .
esc_attr__('Install importer') . '">' . $data[0] . '</a>';
} else {
@ -130,7 +130,7 @@ if (empty ($importers)) {
}
if ( current_user_can('install_plugins') )
echo '<p>' . sprintf( __('If the importer you need is not listed, <a href="%s">search the plugins directory</a> to see if an importer is available.'), esc_url( maybe_network_admin_url( 'plugin-install.php?tab=search&type=tag&s=importer' ) ) ) . '</p>';
echo '<p>' . sprintf( __('If the importer you need is not listed, <a href="%s">search the plugins directory</a> to see if an importer is available.'), esc_url( network_admin_url( 'plugin-install.php?tab=search&type=tag&s=importer' ) ) ) . '</p>';
?>
</div>

View File

@ -100,11 +100,11 @@ function core_update_footer( $msg = '' ) {
switch ( $cur->response ) {
case 'development' :
return sprintf( __( 'You are using a development version (%1$s). Cool! Please <a href="%2$s">stay updated</a>.' ), $GLOBALS['wp_version'], maybe_network_admin_url( 'update-core.php' ) );
return sprintf( __( 'You are using a development version (%1$s). Cool! Please <a href="%2$s">stay updated</a>.' ), $GLOBALS['wp_version'], network_admin_url( 'update-core.php' ) );
break;
case 'upgrade' :
return sprintf( '<strong>'.__( '<a href="%1$s">Get Version %2$s</a>' ).'</strong>', maybe_network_admin_url( 'update-core.php' ), $cur->current);
return sprintf( '<strong>'.__( '<a href="%1$s">Get Version %2$s</a>' ).'</strong>', network_admin_url( 'update-core.php' ), $cur->current);
break;
case 'latest' :
@ -130,7 +130,7 @@ function update_nag() {
return false;
if ( current_user_can('update_core') ) {
$msg = sprintf( __('<a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> is available! <a href="%2$s">Please update now</a>.'), $cur->current, maybe_network_admin_url( 'update-core.php' ) );
$msg = sprintf( __('<a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> is available! <a href="%2$s">Please update now</a>.'), $cur->current, network_admin_url( 'update-core.php' ) );
} else {
$msg = sprintf( __('<a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> is available! Please notify the site administrator.'), $cur->current );
}
@ -148,7 +148,7 @@ function update_right_now_message() {
$msg = sprintf( __('You are using <span class="b">WordPress %s</span>.'), $GLOBALS['wp_version'] );
if ( isset( $cur->response ) && $cur->response == 'upgrade' && current_user_can('update_core') ) {
$msg .= " <a href='" . maybe_network_admin_url( 'update-core.php' ) . "' class='button'>" . sprintf( __('Update to %s'), $cur->current ? $cur->current : __( 'Latest' ) ) . '</a>';
$msg .= " <a href='" . network_admin_url( 'update-core.php' ) . "' class='button'>" . sprintf( __('Update to %s'), $cur->current ? $cur->current : __( 'Latest' ) ) . '</a>';
}
echo "<span id='wp-version-message'>$msg</span>";

View File

@ -274,7 +274,7 @@ function wp_admin_bar_updates_menu() {
$update_title .= sprintf( __('Updates %s'), "<span id='ab-updates' class='update-count'>" . number_format_i18n($update_count) . '</span>' );
$update_title .= '</span>';
$wp_admin_bar->add_menu( array( 'id' => 'updates', 'title' => $update_title, 'href' => maybe_network_admin_url( 'update-core.php' ) ) );
$wp_admin_bar->add_menu( array( 'id' => 'updates', 'title' => $update_title, 'href' => network_admin_url( 'update-core.php' ) ) );
}
/**

View File

@ -2223,6 +2223,9 @@ function network_home_url( $path = '', $scheme = null ) {
* @return string Admin url link with optional path appended
*/
function network_admin_url( $path = '', $scheme = 'admin' ) {
if ( ! is_multisite() )
return admin_url( $path, $scheme );
$url = network_site_url('wp-admin/network/', $scheme);
if ( !empty($path) && is_string($path) && strpos($path, '..') === false )
@ -2269,23 +2272,6 @@ function self_admin_url($path = '', $scheme = 'admin') {
return admin_url($path, $scheme);
}
/**
* Retrieve the url to the admin area for either the current blog or the network
* depending on whether multisite is enabled.
*
* @since 3.1.0
*
* @param string $path Optional path relative to the admin url
* @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). 'http' or 'https' can be passed to force those schemes.
* @return string Admin url link with optional path appended
*/
function maybe_network_admin_url( $path = '', $scheme = 'admin' ) {
if ( is_multisite() )
return network_admin_url( $path, $scheme );
else
return admin_url( $path, $scheme );
}
/**
* Get the URL to the user's dashboard.
*