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.
Built from https://develop.svn.wordpress.org/trunk@55853


git-svn-id: http://core.svn.wordpress.org/trunk@55365 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2023-05-24 10:15:20 +00:00
parent 7311e69b59
commit f93e6ec4e8
2 changed files with 16 additions and 5 deletions

View File

@ -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 &rarr; Updates' ); ?></a> |
<?php endif; ?>
<a href="<?php echo esc_url( self_admin_url() ); ?>"><?php is_blog_admin() ? _e( 'Go to Dashboard &rarr; 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 &rarr; Updates' )
);
}
printf(
'<a href="%1$s">%2$s</a>',
esc_url( self_admin_url() ),
is_blog_admin() ? __( 'Go to Dashboard &rarr; Home' ) : __( 'Go to Dashboard' )
);
?>
</div>
</div>

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.3-alpha-55852';
$wp_version = '6.3-alpha-55853';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.