mirror of
git://develop.git.wordpress.org/
synced 2025-05-15 00:05:26 +02:00
Help/About: Reverse the order of conditionals for displaying the "Go to Updates" link.
`isset()` is faster than `current_user_can()`, so should be checked first. Includes updating code layout for better readability. Follow-up to [19442], [19524], [28477], [33466], [55848]. See #57839. git-svn-id: https://develop.svn.wordpress.org/trunk@55853 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
e1b51684dc
commit
d51ee6ce09
@ -279,10 +279,21 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
|
||||
<hr class="is-large" />
|
||||
|
||||
<div class="return-to-dashboard">
|
||||
<?php if ( current_user_can( 'update_core' ) && isset( $_GET['updated'] ) ) : ?>
|
||||
<a href="<?php echo esc_url( self_admin_url( 'update-core.php' ) ); ?>"><?php is_multisite() ? _e( 'Go to Updates' ) : _e( 'Go to Dashboard → Updates' ); ?></a> |
|
||||
<?php endif; ?>
|
||||
<a href="<?php echo esc_url( self_admin_url() ); ?>"><?php is_blog_admin() ? _e( 'Go to Dashboard → Home' ) : _e( 'Go to Dashboard' ); ?></a>
|
||||
<?php
|
||||
if ( isset( $_GET['updated'] ) && current_user_can( 'update_core' ) ) {
|
||||
printf(
|
||||
'<a href="%1$s">%2$s</a> | ',
|
||||
esc_url( self_admin_url( 'update-core.php' ) ),
|
||||
is_multisite() ? __( 'Go to Updates' ) : __( 'Go to Dashboard → Updates' )
|
||||
);
|
||||
}
|
||||
|
||||
printf(
|
||||
'<a href="%1$s">%2$s</a>',
|
||||
esc_url( self_admin_url() ),
|
||||
is_blog_admin() ? __( 'Go to Dashboard → Home' ) : __( 'Go to Dashboard' )
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user