WordPress.org

Make WordPress Core

Ticket #46326: 46326.diff

File 46326.diff, 1.2 KB (added by mukesh27, 22 months ago)

Patch to add PHP version info in PHP Update Required dashboard widget.

  • wp-admin/includes/dashboard.php

    diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php
    index 3a2d3a6..9d44a2b 100644
    a b function wp_check_browser_version() { 
    16151615 */
    16161616function wp_dashboard_php_nag() {
    16171617        $response = wp_check_php_version();
    1618 
     1618        $version = phpversion();
     1619       
    16191620        if ( ! $response ) {
    16201621                return;
    16211622        }
    16221623
    16231624        if ( isset( $response['is_secure'] ) && ! $response['is_secure'] ) {
    1624                 $msg = __( 'WordPress has detected that your site is running on an insecure version of PHP.' );
     1625                printf(
     1626                        '<p>WordPress has detected that your site is running on an insecure version of PHP %s.</p>',
     1627                        $version
     1628                );
    16251629        } else {
    1626                 $msg = __( 'WordPress has detected that your site is running on an outdated version of PHP.' );
     1630                printf(
     1631                        '<p>WordPress has detected that your site is running on an outdated version of PHP %s.</p>',
     1632                        $version
     1633                );
    16271634        }
    16281635
    16291636        ?>
    1630         <p><?php echo $msg; ?></p>
    16311637
    16321638        <h3><?php _e( 'What is PHP and how does it affect my site?' ); ?></h3>
    16331639        <p><?php _e( 'PHP is the programming language we use to build and maintain WordPress. Newer versions of PHP are both faster and more secure, so updating will have a positive effect on your site’s performance.' ); ?></p>