Install/Upgrade: Link to HelpHub instead of the Codex.

WordPress version links in the Codex (eg, https://codex.wordpress.org/Version_5.0) are redirected to their HelpHub equivalent.

Rather than relying on the redirect, Core and link directly to HelpHub.

Props swissspidy.
Fixes #45574.



git-svn-id: https://develop.svn.wordpress.org/trunk@44451 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast 2019-01-08 03:28:15 +00:00
parent 36949b760f
commit 7bf44ed065
4 changed files with 48 additions and 28 deletions

View File

@ -262,28 +262,26 @@ function update_nag() {
return false;
}
$version_url = sprintf(
/* translators: %s: WordPress version */
esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),
sanitize_title( $cur->current )
);
if ( current_user_can( 'update_core' ) ) {
$msg = sprintf(
/* translators: 1: Codex URL to release notes, 2: new WordPress version, 3: URL to network admin, 4: accessibility text */
/* translators: 1: URL to WordPress release notes, 2: new WordPress version, 3: URL to network admin, 4: accessibility text */
__( '<a href="%1$s">WordPress %2$s</a> is available! <a href="%3$s" aria-label="%4$s">Please update now</a>.' ),
sprintf(
/* translators: %s: WordPress version */
esc_url( __( 'https://codex.wordpress.org/Version_%s' ) ),
$cur->current
),
$version_url,
$cur->current,
network_admin_url( 'update-core.php' ),
esc_attr__( 'Please update WordPress now' )
);
} else {
$msg = sprintf(
/* translators: 1: Codex URL to release notes, 2: new WordPress version */
/* translators: 1: URL to WordPress release notes, 2: new WordPress version */
__( '<a href="%1$s">WordPress %2$s</a> is available! Please notify the site administrator.' ),
sprintf(
/* translators: %s: WordPress version */
esc_url( __( 'https://codex.wordpress.org/Version_%s' ) ),
$cur->current
),
$version_url,
$cur->current
);
}

View File

@ -238,15 +238,21 @@ $mysql_version = $wpdb->db_version();
$php_compat = version_compare( $php_version, $required_php_version, '>=' );
$mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' ) || file_exists( WP_CONTENT_DIR . '/db.php' );
$version_url = sprintf(
/* translators: %s: WordPress version */
esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),
sanitize_title( $wp_version )
);
if ( ! $mysql_compat && ! $php_compat ) {
/* translators: 1: WordPress version number, 2: Minimum required PHP version number, 3: Minimum required MySQL version number, 4: Current PHP version number, 5: Current MySQL version number */
$compat = sprintf( __( 'You cannot install because <a href="https://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires PHP version %2$s or higher and MySQL version %3$s or higher. You are running PHP version %4$s and MySQL version %5$s.' ), $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version );
/* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Minimum required MySQL version number, 5: Current PHP version number, 6: Current MySQL version number */
$compat = sprintf( __( 'You cannot install because <a href="%1$s">WordPress %2$s</a> requires PHP version %3$s or higher and MySQL version %4$s or higher. You are running PHP version %5$s and MySQL version %6$s.' ), $version_url, $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version );
} elseif ( ! $php_compat ) {
/* translators: 1: WordPress version number, 2: Minimum required PHP version number, 3: Current PHP version number */
$compat = sprintf( __( 'You cannot install because <a href="https://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires PHP version %2$s or higher. You are running version %3$s.' ), $wp_version, $required_php_version, $php_version );
/* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Current PHP version number */
$compat = sprintf( __( 'You cannot install because <a href="%1$s">WordPress %2$s</a> requires PHP version %3$s or higher. You are running version %4$s.' ), $version_url, $wp_version, $required_php_version, $php_version );
} elseif ( ! $mysql_compat ) {
/* translators: 1: WordPress version number, 2: Minimum required MySQL version number, 3: Current MySQL version number */
$compat = sprintf( __( 'You cannot install because <a href="https://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires MySQL version %2$s or higher. You are running version %3$s.' ), $wp_version, $required_mysql_version, $mysql_version );
/* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required MySQL version number, 4: Current MySQL version number */
$compat = sprintf( __( 'You cannot install because <a href="%1$s">WordPress %2$s</a> requires MySQL version %3$s or higher. You are running version %4$s.' ), $version_url, $wp_version, $required_mysql_version, $mysql_version );
}
if ( ! $mysql_compat || ! $php_compat ) {

View File

@ -70,17 +70,24 @@ function list_core_update( $update ) {
$mysql_compat = version_compare( $mysql_version, $update->mysql_version, '>=' );
}
$version_url = sprintf(
/* translators: %s: WordPress version */
esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),
sanitize_title( $update->current )
);
if ( ! $mysql_compat && ! $php_compat ) {
/* translators: 1: WordPress version number, 2: Minimum required PHP version number, 3: Minimum required MySQL version number, 4: Current PHP version number, 5: Current MySQL version number */
$message = sprintf( __( 'You cannot update because <a href="https://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires PHP version %2$s or higher and MySQL version %3$s or higher. You are running PHP version %4$s and MySQL version %5$s.' ), $update->current, $update->php_version, $update->mysql_version, $php_version, $mysql_version );
/* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Minimum required MySQL version number, 5: Current PHP version number, 6: Current MySQL version number */
$message = sprintf( __( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires PHP version %3$s or higher and MySQL version %4$s or higher. You are running PHP version %5$s and MySQL version %6$s.' ), $version_url, $update->current, $update->php_version, $update->mysql_version, $php_version, $mysql_version );
} elseif ( ! $php_compat ) {
/* translators: 1: WordPress version number, 2: Minimum required PHP version number, 3: Current PHP version number */
$message = sprintf( __( 'You cannot update because <a href="https://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires PHP version %2$s or higher. You are running version %3$s.' ), $update->current, $update->php_version, $php_version );
/* translators: 1: URL to WordPress release notes, 1: WordPress version number, 2: Minimum required PHP version number, 3: Current PHP version number */
$message = sprintf( __( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires PHP version %3$s or higher. You are running version %4$s.' ), $version_url, $update->current, $update->php_version, $php_version );
} elseif ( ! $mysql_compat ) {
/* translators: 1: WordPress version number, 2: Minimum required MySQL version number, 3: Current MySQL version number */
$message = sprintf( __( 'You cannot update because <a href="https://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires MySQL version %2$s or higher. You are running version %3$s.' ), $update->current, $update->mysql_version, $mysql_version );
} else { /* translators: 1: WordPress version number, 2: WordPress version number including locale if necessary */
$message = sprintf( __( 'You can update to <a href="https://codex.wordpress.org/Version_%1$s">WordPress %2$s</a> automatically:' ), $update->current, $version_string );
$message = sprintf( __( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires MySQL version %3$s or higher. You are running version %4$s.' ), $version_url, $update->current, $update->mysql_version, $mysql_version );
} else {
/* translators: 1: URL to WordPress release notes, 2: WordPress version number including locale if necessary */
$message = sprintf( __( 'You can update to <a href="%1$s">WordPress %2$s</a> automatically:' ), $version_url, $version_string );
}
if ( ! $mysql_compat || ! $php_compat ) {
$show_buttons = false;

View File

@ -80,12 +80,21 @@ if ( file_exists( WP_CONTENT_DIR . '/db.php' ) && empty( $wpdb->is_mysql ) ) {
<?php
elseif ( ! $php_compat || ! $mysql_compat ) :
$version_url = sprintf(
/* translators: %s: WordPress version */
esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),
sanitize_title( $wp_version )
);
if ( ! $mysql_compat && ! $php_compat ) {
printf( __( 'You cannot update because <a href="https://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires PHP version %2$s or higher and MySQL version %3$s or higher. You are running PHP version %4$s and MySQL version %5$s.' ), $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version );
/* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Minimum required MySQL version number, 5: Current PHP version number, 6: Current MySQL version number */
$message = sprintf( __( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires PHP version %3$s or higher and MySQL version %4$s or higher. You are running PHP version %5$s and MySQL version %6$s.' ), $version_url, $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version );
} elseif ( ! $php_compat ) {
printf( __( 'You cannot update because <a href="https://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires PHP version %2$s or higher. You are running version %3$s.' ), $wp_version, $required_php_version, $php_version );
/* translators: 1: URL to WordPress release notes, 1: WordPress version number, 2: Minimum required PHP version number, 3: Current PHP version number */
$message = sprintf( __( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires PHP version %3$s or higher. You are running version %4$s.' ), $version_url, $wp_version, $required_php_version, $php_version );
} elseif ( ! $mysql_compat ) {
printf( __( 'You cannot update because <a href="https://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires MySQL version %2$s or higher. You are running version %3$s.' ), $wp_version, $required_mysql_version, $mysql_version );
/* translators: 1: WordPress version number, 2: Minimum required MySQL version number, 3: Current MySQL version number */
$message = sprintf( __( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires MySQL version %3$s or higher. You are running version %4$s.' ), $version_url, $wp_version, $required_mysql_version, $mysql_version );
}
?>
<?php