mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-18 12:35:03 +00:00
Check manage_options for upgrade notification. Tailor message accordingly. Props johnbillion. fixes #4869
git-svn-id: http://svn.automattic.com/wordpress/trunk@5994 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
bacbca924f
commit
0219651b96
@ -3,6 +3,9 @@
|
|||||||
// The admin side of our 1.0 update system
|
// The admin side of our 1.0 update system
|
||||||
|
|
||||||
function core_update_footer( $msg ) {
|
function core_update_footer( $msg ) {
|
||||||
|
if ( !current_user_can('manage_options') )
|
||||||
|
return sprintf( '| '.__( 'Version %s' ), $GLOBALS['wp_version'] );
|
||||||
|
|
||||||
$cur = get_option( 'update_core' );
|
$cur = get_option( 'update_core' );
|
||||||
|
|
||||||
switch ( $cur->response ) {
|
switch ( $cur->response ) {
|
||||||
@ -28,9 +31,12 @@ $cur = get_option( 'update_core' );
|
|||||||
if ( ! isset( $cur->response ) || $cur->response != 'upgrade' )
|
if ( ! isset( $cur->response ) || $cur->response != 'upgrade' )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
?>
|
if ( current_user_can('manage_options') )
|
||||||
<div id="update-nag"><?php printf( __('A new version of WordPress is available! <a href="%s">Please update now</a>.'), $cur->url ); ?></div>
|
$msg = sprintf( __('A new version of WordPress is available! <a href="%s">Please update now</a>.'), $cur->url );
|
||||||
<?php
|
else
|
||||||
|
$msg = __('A new version of WordPress is available! Please notify the site administrator.');
|
||||||
|
|
||||||
|
echo "<div id='update-nag'>$msg</div>";
|
||||||
}
|
}
|
||||||
add_action( 'admin_notices', 'update_nag', 3 );
|
add_action( 'admin_notices', 'update_nag', 3 );
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user