Ticket #45686: 45686.diff
File 45686.diff, 3.0 KB (added by , 6 years ago) |
---|
-
src/wp-admin/includes/dashboard.php
1609 1609 } 1610 1610 1611 1611 /** 1612 * Displays the PHP up grade nag.1612 * Displays the PHP update nag. 1613 1613 * 1614 * @since 5. 0.01614 * @since 5.1.0 1615 1615 */ 1616 1616 function wp_dashboard_php_nag() { 1617 1617 $response = wp_check_php_version(); … … 1636 1636 <?php 1637 1637 printf( 1638 1638 '<a class="button button-primary" href="%1$s" target="_blank" rel="noopener noreferrer">%2$s <span class="screen-reader-text">%3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a>', 1639 esc_url( _x( 'https://wordpress.org/support/upgrade-php/', 'localized PHP upgrade information page') ),1639 esc_url( wp_get_update_php_url() ), 1640 1640 __( 'Learn more about updating PHP' ), 1641 1641 /* translators: accessibility text */ 1642 1642 __( '(opens in a new tab)' ) … … 1649 1649 /** 1650 1650 * Adds an additional class to the PHP nag if the current version is insecure. 1651 1651 * 1652 * @since 5. 0.01652 * @since 5.1.0 1653 1653 * 1654 1654 * @param array $classes Metabox classes. 1655 1655 * @return array Modified metabox classes. … … 1665 1665 } 1666 1666 1667 1667 /** 1668 * Checks if the user needs to up grade PHP.1668 * Checks if the user needs to update PHP. 1669 1669 * 1670 * @since 5. 0.01670 * @since 5.1.0 1671 1671 * 1672 1672 * @return array|false $response Array of PHP version data. False on failure. 1673 1673 */ -
src/wp-includes/functions.php
6519 6519 } 6520 6520 } 6521 6521 } 6522 6523 /** 6524 * Gets the URL to learn more about updating the PHP version the site is running on. 6525 * 6526 * This URL can be overridden by specifying an environment variable `WP_UPDATE_PHP_URL` or by using the 6527 * {@see 'wp_update_php_url'} filter. Providing an empty string is not allowed and will result in the 6528 * default URL being used. Furthermore the page the URL links to should preferably be localized in the 6529 * site language. 6530 * 6531 * @since 5.1.0 6532 * 6533 * @return string URL to learn more about updating PHP. 6534 */ 6535 function wp_get_update_php_url() { 6536 $default_url = _x( 'https://wordpress.org/support/update-php/', 'localized PHP upgrade information page' ); 6537 6538 $update_url = $default_url; 6539 if ( false !== getenv( 'WP_UPDATE_PHP_URL' ) ) { 6540 $update_url = getenv( 'WP_UPDATE_PHP_URL' ); 6541 } 6542 6543 /** 6544 * Filters the URL to learn more about updating the PHP version the site is running on. 6545 * 6546 * Providing an empty string is not allowed and will result in the default URL being used. Furthermore 6547 * the page the URL links to should preferably be localized in the site language. 6548 * 6549 * @since 5.1.0 6550 * 6551 * @param string $update_url URL to learn more about updating PHP. 6552 */ 6553 $update_url = apply_filters( 'wp_update_php_url', $update_url ); 6554 6555 if ( empty( $update_url ) ) { 6556 $update_url = $default_url; 6557 } 6558 6559 return $update_url; 6560 }