Ticket #45686: 45686.2.diff
File 45686.2.diff, 4.5 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(); … … 1626 1626 $msg = __( 'WordPress has detected that your site is running on an outdated version of PHP.' ); 1627 1627 } 1628 1628 1629 $update_url = wp_get_update_php_url(); 1630 $default_url = wp_get_default_update_php_url(); 1631 1629 1632 ?> 1630 1633 <p><?php echo $msg; ?></p> 1631 1634 … … 1634 1637 1635 1638 <p class="button-container"> 1636 1639 <?php 1637 1638 1639 esc_url( _x( 'https://wordpress.org/support/update-php/', 'localized PHP upgrade information page' )),1640 1641 1642 1643 1640 printf( 1641 '<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>', 1642 esc_url( $update_url ), 1643 __( 'Learn more about updating PHP' ), 1644 /* translators: accessibility text */ 1645 __( '(opens in a new tab)' ) 1646 ); 1644 1647 ?> 1645 1648 </p> 1646 1649 <?php 1650 1651 if ( $update_url !== $default_url ) { 1652 ?> 1653 <p class="description"> 1654 <?php 1655 printf( 1656 /* translators: %s: default Update PHP page URL */ 1657 __( 'This resource is provided by your web host, and is specific to your site. For more information, <a href="%s" target="_blank">see the official WordPress documentation</a>.' ), 1658 esc_url( $default_url ) 1659 ); 1660 ?> 1661 </p> 1662 <?php 1663 } 1647 1664 } 1648 1665 1649 1666 /** 1650 1667 * Adds an additional class to the PHP nag if the current version is insecure. 1651 1668 * 1652 * @since 5. 0.01669 * @since 5.1.0 1653 1670 * 1654 1671 * @param array $classes Metabox classes. 1655 1672 * @return array Modified metabox classes. … … 1665 1682 } 1666 1683 1667 1684 /** 1668 * Checks if the user needs to up grade PHP.1685 * Checks if the user needs to update PHP. 1669 1686 * 1670 * @since 5. 0.01687 * @since 5.1.0 1671 1688 * 1672 1689 * @return array|false $response Array of PHP version data. False on failure. 1673 1690 */ -
src/wp-includes/functions.php
6553 6553 } 6554 6554 } 6555 6555 } 6556 6557 /** 6558 * Gets the URL to learn more about updating the PHP version the site is running on. 6559 * 6560 * This URL can be overridden by specifying an environment variable `WP_UPDATE_PHP_URL` or by using the 6561 * {@see 'wp_update_php_url'} filter. Providing an empty string is not allowed and will result in the 6562 * default URL being used. Furthermore the page the URL links to should preferably be localized in the 6563 * site language. 6564 * 6565 * @since 5.1.0 6566 * 6567 * @return string URL to learn more about updating PHP. 6568 */ 6569 function wp_get_update_php_url() { 6570 $default_url = wp_get_default_update_php_url(); 6571 6572 $update_url = $default_url; 6573 if ( false !== getenv( 'WP_UPDATE_PHP_URL' ) ) { 6574 $update_url = getenv( 'WP_UPDATE_PHP_URL' ); 6575 } 6576 6577 /** 6578 * Filters the URL to learn more about updating the PHP version the site is running on. 6579 * 6580 * Providing an empty string is not allowed and will result in the default URL being used. Furthermore 6581 * the page the URL links to should preferably be localized in the site language. 6582 * 6583 * @since 5.1.0 6584 * 6585 * @param string $update_url URL to learn more about updating PHP. 6586 */ 6587 $update_url = apply_filters( 'wp_update_php_url', $update_url ); 6588 6589 if ( empty( $update_url ) ) { 6590 $update_url = $default_url; 6591 } 6592 6593 return $update_url; 6594 } 6595 6596 /** 6597 * Gets the default URL to learn more about updating the PHP version the site is running on. 6598 * 6599 * Do not use this function to retrieve this URL. Instead, use {@see wp_get_update_php_url()} when relying on the URL. 6600 * This function does not allow modifying the returned URL, and is only used to compare the actually used URL with the 6601 * default one. 6602 * 6603 * @since 5.1.0 6604 * @access private 6605 * 6606 * @return string Default URL to learn more about updating PHP. 6607 */ 6608 function wp_get_default_update_php_url() { 6609 return _x( 'https://wordpress.org/support/update-php/', 'localized PHP upgrade information page' ); 6610 }