diff --git a/wp-admin/includes/class-wp-plugin-install-list-table.php b/wp-admin/includes/class-wp-plugin-install-list-table.php
index 7cc37c056f..d13dbe2036 100644
a
|
b
|
class WP_Plugin_Install_List_Table extends WP_List_Table { |
637 | 637 | _e( 'This plugin doesn’t work with your versions of WordPress and PHP. ' ); |
638 | 638 | if ( current_user_can( 'update_core' ) ) { |
639 | 639 | printf( |
640 | | /* translators: 1: "Update WordPress" screen URL, 2: "Updating PHP" page URL */ |
| 640 | /* translators: 1: "Update WordPress" screen URL, 2: Update PHP page URL */ |
641 | 641 | __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ), |
642 | 642 | self_admin_url( 'update-core.php' ), |
643 | | esc_url( __( 'https://wordpress.org/support/update-php/' ) ) |
| 643 | esc_url( wp_get_update_php_url() ) |
644 | 644 | ); |
| 645 | wp_update_php_annotation(); |
645 | 646 | } else { |
646 | 647 | printf( |
647 | | /* translators: %s: "Updating PHP" page URL */ |
| 648 | /* translators: %s: Update PHP page URL */ |
648 | 649 | __( '<a href="%s">Learn more about updating PHP</a>.' ), |
649 | | esc_url( __( 'https://wordpress.org/support/update-php/' ) ) |
| 650 | esc_url( wp_get_update_php_url() ) |
650 | 651 | ); |
| 652 | wp_update_php_annotation(); |
651 | 653 | } |
652 | 654 | } elseif ( ! $compatible_wp ) { |
653 | 655 | _e( 'This plugin doesn’t work with your version of WordPress. ' ); |
… |
… |
class WP_Plugin_Install_List_Table extends WP_List_Table { |
661 | 663 | } elseif ( ! $compatible_php ) { |
662 | 664 | _e( 'This plugin doesn’t work with your version of PHP. ' ); |
663 | 665 | printf( |
664 | | /* translators: %s: "Updating PHP" page URL */ |
| 666 | /* translators: %s: Update PHP page URL */ |
665 | 667 | __( '<a href="%s">Learn more about updating PHP</a>.' ), |
666 | | esc_url( __( 'https://wordpress.org/support/update-php/' ) ) |
| 668 | esc_url( wp_get_update_php_url() ) |
667 | 669 | ); |
| 670 | wp_update_php_annotation(); |
668 | 671 | } |
669 | 672 | echo '</p></div>'; |
670 | 673 | } |
diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php
index e8a0004617..6456c4756a 100644
a
|
b
|
function wp_dashboard_php_nag() { |
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 | | |
1632 | 1629 | ?> |
1633 | 1630 | <p><?php echo $msg; ?></p> |
1634 | 1631 | |
… |
… |
function wp_dashboard_php_nag() { |
1639 | 1636 | <?php |
1640 | 1637 | printf( |
1641 | 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>', |
1642 | | esc_url( $update_url ), |
| 1639 | esc_url( wp_get_update_php_url() ), |
1643 | 1640 | __( 'Learn more about updating PHP' ), |
1644 | 1641 | /* translators: accessibility text */ |
1645 | 1642 | __( '(opens in a new tab)' ) |
… |
… |
function wp_dashboard_php_nag() { |
1648 | 1645 | </p> |
1649 | 1646 | <?php |
1650 | 1647 | |
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 | | } |
| 1648 | wp_update_php_annotation(); |
1664 | 1649 | } |
1665 | 1650 | |
1666 | 1651 | /** |
diff --git a/wp-admin/includes/plugin-install.php b/wp-admin/includes/plugin-install.php
index c3165f2e88..646f838f87 100644
a
|
b
|
function install_plugin_information() { |
763 | 763 | if ( ! $compatible_php ) { |
764 | 764 | echo '<div class="notice notice-error notice-alt"><p>'; |
765 | 765 | printf( |
766 | | /* translators: "Updating PHP" page URL */ |
| 766 | /* translators: %s: Update PHP page URL */ |
767 | 767 | __( '<strong>Error:</strong> This plugin <strong>requires a newer version of PHP</strong>, so unfortunately you cannot install it. <a href="%s" target="_blank">Click here to learn more about updating PHP</a>.' ), |
768 | | esc_url( __( 'https://wordpress.org/support/update-php/' ) ) |
| 768 | esc_url( wp_get_update_php_url() ) |
769 | 769 | ); |
| 770 | wp_update_php_annotation(); |
770 | 771 | echo '</p></div>'; |
771 | 772 | } |
772 | 773 | |
diff --git a/wp-includes/functions.php b/wp-includes/functions.php
index 66e1921ac7..f63284e5ad 100644
a
|
b
|
function wp_get_update_php_url() { |
6659 | 6659 | function wp_get_default_update_php_url() { |
6660 | 6660 | return _x( 'https://wordpress.org/support/update-php/', 'localized PHP upgrade information page' ); |
6661 | 6661 | } |
| 6662 | |
| 6663 | /** |
| 6664 | * Returns the default annotation for the web host altering the Update PHP page URL. |
| 6665 | * |
| 6666 | * This function is to be used after {@see wp_get_update_php_url()} to display a consistent |
| 6667 | * annotation if the web host changes the default Update PHP page URL. |
| 6668 | * |
| 6669 | * @since 5.1.0 |
| 6670 | * @access public |
| 6671 | * |
| 6672 | * @return void $message Empty or default message for web host Update PHP page URL. |
| 6673 | */ |
| 6674 | function wp_update_php_annotation() { |
| 6675 | $update_url = wp_get_update_php_url(); |
| 6676 | $default_url = wp_get_default_update_php_url(); |
| 6677 | |
| 6678 | if ( $update_url !== $default_url ) { |
| 6679 | echo '<p class="description">'; |
| 6680 | printf( |
| 6681 | /* translators: %s: default Update PHP page URL */ |
| 6682 | __( '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>.' ), |
| 6683 | esc_url( $default_url ) |
| 6684 | ); |
| 6685 | echo'</p>'; |
| 6686 | } |
| 6687 | } |