Link to network/update-core when running multisite. Remove theme/plugin editors from blog menu when running multisite. Redirect to network/* when accessing theme/plugin-install/editor. props ocean90, see #15525.

git-svn-id: https://develop.svn.wordpress.org/trunk@16747 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2010-12-06 15:41:19 +00:00
parent 3e38f2e429
commit 8abcb8e5ce
9 changed files with 55 additions and 12 deletions
+14 -8
View File
@@ -98,13 +98,15 @@ 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 <a href="%2$s">stay updated</a>.' ), $GLOBALS['wp_version'], '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'], $href );
break;
case 'upgrade' :
return sprintf( '<strong>'.__( '<a href="%1$s">Get Version %2$s</a>' ).'</strong>', 'update-core.php', $cur->current);
return sprintf( '<strong>'.__( '<a href="%1$s">Get Version %2$s</a>' ).'</strong>', $href, $cur->current);
break;
case 'latest' :
@@ -129,11 +131,12 @@ function update_nag() {
if ( ! isset( $cur->response ) || $cur->response != 'upgrade' )
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, 'update-core.php' );
else
if ( current_user_can('update_core') ) {
$href = is_multisite() ? network_admin_url( 'update-core.php' ) : 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, $href );
} 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 );
}
echo "<div class='update-nag'>$msg</div>";
}
add_action( 'admin_notices', 'update_nag', 3 );
@@ -146,8 +149,11 @@ function update_right_now_message() {
$cur = get_preferred_from_update_core();
$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='update-core.php' class='button'>" . sprintf( __('Update to %s'), $cur->current ? $cur->current : __( 'Latest' ) ) . '</a>';
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 .= " <a href='" . $href . "' class='button'>" . sprintf( __('Update to %s'), $cur->current ? $cur->current : __( 'Latest' ) ) . '</a>';
}
echo "<span id='wp-version-message'>$msg</span>";
}