Ticket #45986: 45986.5.diff
File 45986.5.diff, 6.3 KB (added by , 6 years ago) |
---|
-
src/wp-admin/includes/class-wp-plugin-install-list-table.php
635 635 echo '<div class="notice inline notice-error notice-alt"><p>'; 636 636 if ( ! $compatible_php && ! $compatible_wp ) { 637 637 _e( 'This plugin doesn’t work with your versions of WordPress and PHP. ' ); 638 if ( current_user_can( 'update_core' ) ) {638 if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { 639 639 printf( 640 /* translators: 1: "Update WordPress" screen URL, 2: "Updat ingPHP" 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 } else { 645 wp_update_php_annotation(); 646 } elseif ( current_user_can( 'update_core' ) ) { 646 647 printf( 647 /* translators: %s: "Updating PHP" page URL */ 648 /* translators: %s: "Update WordPress" screen URL */ 649 __( '<a href="%s">Please update WordPress</a>.' ), 650 self_admin_url( 'update-core.php' ) 651 ); 652 } elseif ( current_user_can( 'update_php' ) ) { 653 printf( 654 /* translators: %s: "Update PHP" page URL */ 648 655 __( '<a href="%s">Learn more about updating PHP</a>.' ), 649 esc_url( __( 'https://wordpress.org/support/update-php/') )656 esc_url( wp_get_update_php_url() ) 650 657 ); 658 wp_update_php_annotation(); 651 659 } 652 660 } elseif ( ! $compatible_wp ) { 653 661 _e( 'This plugin doesn’t work with your version of WordPress. ' ); … … 660 668 } 661 669 } elseif ( ! $compatible_php ) { 662 670 _e( 'This plugin doesn’t work with your version of PHP. ' ); 663 printf( 664 /* translators: %s: "Updating PHP" page URL */ 665 __( '<a href="%s">Learn more about updating PHP</a>.' ), 666 esc_url( __( 'https://wordpress.org/support/update-php/' ) ) 667 ); 671 if ( current_user_can( 'update_php' ) ) { 672 printf( 673 /* translators: %s: "Update PHP" page URL */ 674 __( '<a href="%s">Learn more about updating PHP</a>.' ), 675 esc_url( wp_get_update_php_url() ) 676 ); 677 wp_update_php_annotation(); 678 } 668 679 } 669 680 echo '</p></div>'; 670 681 } -
src/wp-admin/includes/dashboard.php
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 … … 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)' ) … … 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 /** -
src/wp-admin/includes/plugin-install.php
762 762 763 763 if ( ! $compatible_php ) { 764 764 echo '<div class="notice notice-error notice-alt"><p>'; 765 printf( 766 /* translators: "Updating PHP" page URL */ 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/' ) ) 769 ); 770 echo '</p></div>'; 765 _e( '<strong>Error:</strong> This plugin <strong>requires a newer version of PHP</strong>.' ); 766 if ( current_user_can( 'update_php' ) ) { 767 printf( 768 /* translators: %s: "Update PHP" page URL */ 769 ' ' . __( '<a href="%s" target="_blank">Click here to learn more about updating PHP</a>.' ), 770 esc_url( wp_get_update_php_url() ) 771 ); 772 echo '</p>'; 773 wp_update_php_annotation(); 774 } else { 775 echo '</p>'; 776 } 777 echo '</div>'; 771 778 } 772 779 773 780 if ( ! $tested_wp ) { -
src/wp-includes/functions.php
6716 6716 function wp_get_default_update_php_url() { 6717 6717 return _x( 'https://wordpress.org/support/update-php/', 'localized PHP upgrade information page' ); 6718 6718 } 6719 6720 /** 6721 * Prints the default annotation for the web host altering the "Update PHP" page URL. 6722 * 6723 * This function is to be used after {@see wp_get_update_php_url()} to display a consistent 6724 * annotation if the web host has altered the default "Update PHP" page URL. 6725 * 6726 * @since 5.1.0 6727 */ 6728 function wp_update_php_annotation() { 6729 $update_url = wp_get_update_php_url(); 6730 $default_url = wp_get_default_update_php_url(); 6731 6732 if ( $update_url === $default_url ) { 6733 return; 6734 } 6735 6736 echo '<p class="description">'; 6737 printf( 6738 /* translators: %s: default Update PHP page URL */ 6739 __( '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>.' ), 6740 esc_url( $default_url ) 6741 ); 6742 echo'</p>'; 6743 }