Ticket #50787: 50787.2.diff
File 50787.2.diff, 28.7 KB (added by , 4 years ago) |
---|
-
wp-admin/includes/class-wp-plugin-install-list-table.php
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 ee6ba137e3..b72623b6d5 100644
a b class WP_Plugin_Install_List_Table extends WP_List_Table { 651 651 if ( ! $compatible_php || ! $compatible_wp ) { 652 652 echo '<div class="notice inline notice-error notice-alt"><p>'; 653 653 if ( ! $compatible_php && ! $compatible_wp ) { 654 _e( 'This plugin doesn’t work with your versions of WordPress and PHP.' );654 echo wp_get_compatibility_string( 'plugin_incompatible_wp_php' ); 655 655 if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { 656 656 printf( 657 657 /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */ … … class WP_Plugin_Install_List_Table extends WP_List_Table { 675 675 wp_update_php_annotation( '</p><p><em>', '</em>' ); 676 676 } 677 677 } elseif ( ! $compatible_wp ) { 678 _e( 'This plugin doesn’t work with your version of WordPress.' );678 echo wp_get_compatibility_string( 'plugin_incompatible_wp' ); 679 679 if ( current_user_can( 'update_core' ) ) { 680 680 printf( 681 681 /* translators: %s: URL to WordPress Updates screen. */ … … class WP_Plugin_Install_List_Table extends WP_List_Table { 684 684 ); 685 685 } 686 686 } elseif ( ! $compatible_php ) { 687 _e( 'This plugin doesn’t work with your version of PHP.' );687 echo wp_get_compatibility_string( 'plugin_incompatible_php' ); 688 688 if ( current_user_can( 'update_php' ) ) { 689 689 printf( 690 690 /* translators: %s: URL to Update PHP page. */ -
wp-admin/includes/theme.php
diff --git a/wp-admin/includes/theme.php b/wp-admin/includes/theme.php index 84b13c58f7..4782b18982 100644
a b function customize_themes_print_templates() { 845 845 <p> 846 846 <# if ( ! data.updateResponse.compatibleWP && ! data.updateResponse.compatiblePHP ) { #> 847 847 <?php 848 printf( 849 /* translators: %s: Theme name. */ 850 __( 'There is a new version of %s available, but it doesn’t work with your versions of WordPress and PHP.' ), 851 '{{{ data.name }}}' 852 ); 848 echo wp_get_compatibility_string( 'update_incompatible_wp_php', '{{{ data.name }}}' ); 853 849 if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { 854 850 printf( 855 851 /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */ … … function customize_themes_print_templates() { 875 871 ?> 876 872 <# } else if ( ! data.updateResponse.compatibleWP ) { #> 877 873 <?php 878 printf( 879 /* translators: %s: Theme name. */ 880 __( 'There is a new version of %s available, but it doesn’t work with your version of WordPress.' ), 881 '{{{ data.name }}}' 882 ); 874 echo wp_get_compatibility_string( 'update_incompatible_wp', '{{{ data.name }}}' ); 883 875 if ( current_user_can( 'update_core' ) ) { 884 876 printf( 885 877 /* translators: %s: URL to WordPress Updates screen. */ … … function customize_themes_print_templates() { 890 882 ?> 891 883 <# } else if ( ! data.updateResponse.compatiblePHP ) { #> 892 884 <?php 893 printf( 894 /* translators: %s: Theme name. */ 895 __( 'There is a new version of %s available, but it doesn’t work with your version of PHP.' ), 896 '{{{ data.name }}}' 897 ); 885 echo wp_get_compatibility_string( 'update_incompatible_php', '{{{ data.name }}}' ); 898 886 if ( current_user_can( 'update_php' ) ) { 899 887 printf( 900 888 /* translators: %s: URL to Update PHP page. */ … … function customize_themes_print_templates() { 926 914 <div class="notice notice-error notice-alt notice-large"><p> 927 915 <# if ( ! data.compatibleWP && ! data.compatiblePHP ) { #> 928 916 <?php 929 _e( 'This theme doesn’t work with your versions of WordPress and PHP.' );917 echo wp_get_compatibility_string( 'theme_incompatible_wp_php' ); 930 918 if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { 931 919 printf( 932 920 /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */ … … function customize_themes_print_templates() { 952 940 ?> 953 941 <# } else if ( ! data.compatibleWP ) { #> 954 942 <?php 955 _e( 'This theme doesn’t work with your version of WordPress.' );943 echo wp_get_compatibility_string( 'theme_incompatible_wp' ); 956 944 if ( current_user_can( 'update_core' ) ) { 957 945 printf( 958 946 /* translators: %s: URL to WordPress Updates screen. */ … … function customize_themes_print_templates() { 963 951 ?> 964 952 <# } else if ( ! data.compatiblePHP ) { #> 965 953 <?php 966 _e( 'This theme doesn’t work with your version of PHP.' );954 echo wp_get_compatibility_string( 'theme_incompatible_php' ); 967 955 if ( current_user_can( 'update_php' ) ) { 968 956 printf( 969 957 /* translators: %s: URL to Update PHP page. */ -
wp-admin/includes/update.php
diff --git a/wp-admin/includes/update.php b/wp-admin/includes/update.php index e7ebabb8f7..c827841213 100644
a b function wp_plugin_update_row( $file, $plugin_data ) { 513 513 ) 514 514 ); 515 515 } else { 516 echo wp_get_compatibility_string( 'update_incompatible_php', $plugin_name ); 517 echo ' '; 516 518 printf( 517 /* translators: 1: Plugin name, 2: Details URL, 3: Additional link attributes, 4: Version number 5: URL to Update PHP page. */ 518 __( 'There is a new version of %1$s available, but it doesn’t work with your version of PHP. <a href="%2$s" %3$s>View version %4$s details</a> or <a href="%5$s">learn more about updating PHP</a>.' ), 519 $plugin_name, 519 /* translators: 1: Details URL, 2: Additional link attributes, 3: Version number 4: URL to Update PHP page. */ 520 __( '<a href="%1$s" %2$s>View version %3$s details</a> or <a href="%4$s">learn more about updating PHP</a>.' ), 520 521 esc_url( $details_url ), 521 522 sprintf( 522 523 'class="thickbox open-plugin-details-modal" aria-label="%s"', … … function wp_theme_update_row( $theme_key, $theme ) { 707 708 } 708 709 } else { 709 710 if ( ! $compatible_wp && ! $compatible_php ) { 710 printf( 711 /* translators: %s: Theme name. */ 712 __( 'There is a new version of %s available, but it doesn’t work with your versions of WordPress and PHP.' ), 713 $theme['Name'] 714 ); 711 echo wp_get_compatibility_string( 'update_incompatible_wp_php', $theme['Name'] ); 715 712 if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { 716 713 printf( 717 714 /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */ … … function wp_theme_update_row( $theme_key, $theme ) { 735 732 wp_update_php_annotation( '</p><p><em>', '</em>' ); 736 733 } 737 734 } elseif ( ! $compatible_wp ) { 738 printf( 739 /* translators: %s: Theme name. */ 740 __( 'There is a new version of %s available, but it doesn’t work with your version of WordPress.' ), 741 $theme['Name'] 742 ); 735 echo wp_get_compatibility_string( 'update_incompatible_wp', $theme['Name'] ); 743 736 if ( current_user_can( 'update_core' ) ) { 744 737 printf( 745 738 /* translators: %s: URL to WordPress Updates screen. */ … … function wp_theme_update_row( $theme_key, $theme ) { 748 741 ); 749 742 } 750 743 } elseif ( ! $compatible_php ) { 751 printf( 752 /* translators: %s: Theme name. */ 753 __( 'There is a new version of %s available, but it doesn’t work with your version of PHP.' ), 754 $theme['Name'] 755 ); 744 echo wp_get_compatibility_string( 'update_incompatible_php', $theme['Name'] ); 756 745 if ( current_user_can( 'update_php' ) ) { 757 746 printf( 758 747 /* translators: %s: URL to Update PHP page. */ -
wp-admin/theme-install.php
diff --git a/wp-admin/theme-install.php b/wp-admin/theme-install.php index 8f9d3c6137..9c171704db 100644
a b if ( $tab ) { 280 280 <div class="notice notice-error notice-alt"><p> 281 281 <# if ( ! data.compatible_wp && ! data.compatible_php ) { #> 282 282 <?php 283 _e( 'This theme doesn’t work with your versions of WordPress and PHP.' );283 echo wp_get_compatibility_string( 'theme_incompatible_wp_php' ); 284 284 if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { 285 285 printf( 286 286 /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */ … … if ( $tab ) { 306 306 ?> 307 307 <# } else if ( ! data.compatible_wp ) { #> 308 308 <?php 309 _e( 'This theme doesn’t work with your version of WordPress.' );309 echo wp_get_compatibility_string( 'theme_incompatible_wp' ); 310 310 if ( current_user_can( 'update_core' ) ) { 311 311 printf( 312 312 /* translators: %s: URL to WordPress Updates screen. */ … … if ( $tab ) { 317 317 ?> 318 318 <# } else if ( ! data.compatible_php ) { #> 319 319 <?php 320 _e( 'This theme doesn’t work with your version of PHP.' );320 echo wp_get_compatibility_string( 'theme_incompatible_php' ); 321 321 if ( current_user_can( 'update_php' ) ) { 322 322 printf( 323 323 /* translators: %s: URL to Update PHP page. */ … … if ( $tab ) { 466 466 <div class="notice notice-error notice-alt notice-large"><p> 467 467 <# if ( ! data.compatible_wp && ! data.compatible_php ) { #> 468 468 <?php 469 _e( 'This theme doesn’t work with your versions of WordPress and PHP.' );469 echo wp_get_compatibility_string( 'theme_incompatible_wp_php' ); 470 470 if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { 471 471 printf( 472 472 /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */ … … if ( $tab ) { 492 492 ?> 493 493 <# } else if ( ! data.compatible_wp ) { #> 494 494 <?php 495 _e( 'This theme doesn’t work with your version of WordPress.' );495 echo wp_get_compatibility_string( 'theme_incompatible_wp' ); 496 496 if ( current_user_can( 'update_core' ) ) { 497 497 printf( 498 498 /* translators: %s: URL to WordPress Updates screen. */ … … if ( $tab ) { 503 503 ?> 504 504 <# } else if ( ! data.compatible_php ) { #> 505 505 <?php 506 _e( 'This theme doesn’t work with your version of PHP.' );506 echo wp_get_compatibility_string( 'theme_incompatible_php' ); 507 507 if ( current_user_can( 'update_php' ) ) { 508 508 printf( 509 509 /* translators: %s: URL to Update PHP page. */ -
wp-admin/themes.php
diff --git a/wp-admin/themes.php b/wp-admin/themes.php index 157a42e629..fdff3c98d1 100644
a b foreach ( $themes as $theme ) : 401 401 <div class="update-message notice inline notice-error notice-alt"><p> 402 402 <?php 403 403 if ( ! $theme['updateResponse']['compatibleWP'] && ! $theme['updateResponse']['compatiblePHP'] ) { 404 printf( 405 /* translators: %s: Theme name. */ 406 __( 'There is a new version of %s available, but it doesn’t work with your versions of WordPress and PHP.' ), 407 $theme['name'] 408 ); 404 echo wp_get_compatibility_string( 'update_incompatible_wp_php', $theme['name'] ); 409 405 if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { 410 406 printf( 411 407 /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */ … … foreach ( $themes as $theme ) : 429 425 wp_update_php_annotation( '</p><p><em>', '</em>' ); 430 426 } 431 427 } elseif ( ! $theme['updateResponse']['compatibleWP'] ) { 432 printf( 433 /* translators: %s: Theme name. */ 434 __( 'There is a new version of %s available, but it doesn’t work with your version of WordPress.' ), 435 $theme['name'] 436 ); 428 echo wp_get_compatibility_string( 'update_incompatibility_wp', $theme['name'] ); 437 429 if ( current_user_can( 'update_core' ) ) { 438 430 printf( 439 431 /* translators: %s: URL to WordPress Updates screen. */ … … foreach ( $themes as $theme ) : 442 434 ); 443 435 } 444 436 } elseif ( ! $theme['updateResponse']['compatiblePHP'] ) { 445 printf( 446 /* translators: %s: Theme name. */ 447 __( 'There is a new version of %s available, but it doesn’t work with your version of PHP.' ), 448 $theme['name'] 449 ); 437 echo wp_get_compatibility_string( 'update_incompatible_php', $theme['name'] ); 450 438 if ( current_user_can( 'update_php' ) ) { 451 439 printf( 452 440 /* translators: %s: URL to Update PHP page. */ … … foreach ( $themes as $theme ) : 465 453 if ( ! $theme['compatibleWP'] || ! $theme['compatiblePHP'] ) { 466 454 echo '<div class="notice inline notice-error notice-alt"><p>'; 467 455 if ( ! $theme['compatibleWP'] && ! $theme['compatiblePHP'] ) { 468 _e( 'This theme doesn’t work with your versions of WordPress and PHP.' );456 echo wp_get_compatibility_string( 'theme_incompatible_wp_php' ); 469 457 if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { 470 458 printf( 471 459 /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */ … … foreach ( $themes as $theme ) : 489 477 wp_update_php_annotation( '</p><p><em>', '</em>' ); 490 478 } 491 479 } elseif ( ! $theme['compatibleWP'] ) { 492 _e( 'This theme doesn’t work with your version of WordPress.' );480 echo wp_get_compatibility_string( 'theme_incompatible_wp' ); 493 481 if ( current_user_can( 'update_core' ) ) { 494 482 printf( 495 483 /* translators: %s: URL to WordPress Updates screen. */ … … foreach ( $themes as $theme ) : 498 486 ); 499 487 } 500 488 } elseif ( ! $theme['compatiblePHP'] ) { 501 _e( 'This theme doesn’t work with your version of PHP.' );489 echo wp_get_compatibility_string( 'theme_incompatible_php' ); 502 490 if ( current_user_can( 'update_php' ) ) { 503 491 printf( 504 492 /* translators: %s: URL to Update PHP page. */ … … function wp_theme_auto_update_setting_template() { 740 728 <div class="update-message notice inline notice-error notice-alt"><p> 741 729 <# if ( ! data.updateResponse.compatibleWP && ! data.updateResponse.compatiblePHP ) { #> 742 730 <?php 743 printf( 744 /* translators: %s: Theme name. */ 745 __( 'There is a new version of %s available, but it doesn’t work with your versions of WordPress and PHP.' ), 746 '{{{ data.name }}}' 747 ); 731 echo wp_get_compatibility_string( 'update_incompatible_wp_php', '{{{ data.name }}}' ); 748 732 if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { 749 733 printf( 750 734 /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */ … … function wp_theme_auto_update_setting_template() { 770 754 ?> 771 755 <# } else if ( ! data.updateResponse.compatibleWP ) { #> 772 756 <?php 773 printf( 774 /* translators: %s: Theme name. */ 775 __( 'There is a new version of %s available, but it doesn’t work with your version of WordPress.' ), 776 '{{{ data.name }}}' 777 ); 757 echo wp_get_compatibility_string( 'update_incompatible_wp', '{{{ data.name }}}' ); 778 758 if ( current_user_can( 'update_core' ) ) { 779 759 printf( 780 760 /* translators: %s: URL to WordPress Updates screen. */ … … function wp_theme_auto_update_setting_template() { 785 765 ?> 786 766 <# } else if ( ! data.updateResponse.compatiblePHP ) { #> 787 767 <?php 788 printf( 789 /* translators: %s: Theme name. */ 790 __( 'There is a new version of %s available, but it doesn’t work with your version of PHP.' ), 791 '{{{ data.name }}}' 792 ); 768 echo wp_get_compatibility_string( 'update_incompatible_php', '{{{ data.name }}}' ); 793 769 if ( current_user_can( 'update_php' ) ) { 794 770 printf( 795 771 /* translators: %s: URL to Update PHP page. */ … … function wp_theme_auto_update_setting_template() { 808 784 <div class="notice notice-error notice-alt"><p> 809 785 <# if ( ! data.compatibleWP && ! data.compatiblePHP ) { #> 810 786 <?php 811 _e( 'This theme doesn’t work with your versions of WordPress and PHP.' );787 echo wp_get_compatibility_string( 'theme_incompatible_wp_php' ); 812 788 if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { 813 789 printf( 814 790 /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */ … … function wp_theme_auto_update_setting_template() { 834 810 ?> 835 811 <# } else if ( ! data.compatibleWP ) { #> 836 812 <?php 837 _e( 'This theme doesn’t work with your version of WordPress.' );813 echo wp_get_compatibility_string( 'theme_incompatible_wp' ); 838 814 if ( current_user_can( 'update_core' ) ) { 839 815 printf( 840 816 /* translators: %s: URL to WordPress Updates screen. */ … … function wp_theme_auto_update_setting_template() { 845 821 ?> 846 822 <# } else if ( ! data.compatiblePHP ) { #> 847 823 <?php 848 _e( 'This theme doesn’t work with your version of PHP.' );824 echo wp_get_compatibility_string( 'theme_incompatible_php' ); 849 825 if ( current_user_can( 'update_php' ) ) { 850 826 printf( 851 827 /* translators: %s: URL to Update PHP page. */ … … function wp_theme_auto_update_setting_template() { 940 916 <div class="notice notice-error notice-alt notice-large"><p> 941 917 <# if ( ! data.compatibleWP && ! data.compatiblePHP ) { #> 942 918 <?php 943 _e( 'This theme doesn’t work with your versions of WordPress and PHP.' );919 echo wp_get_compatibility_string( 'theme_incompatible_wp_php' ); 944 920 if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { 945 921 printf( 946 922 /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */ … … function wp_theme_auto_update_setting_template() { 966 942 ?> 967 943 <# } else if ( ! data.compatibleWP ) { #> 968 944 <?php 969 _e( 'This theme doesn’t work with your version of WordPress.' );945 echo wp_get_compatibility_string( 'theme_incompatible_wp' ); 970 946 if ( current_user_can( 'update_core' ) ) { 971 947 printf( 972 948 /* translators: %s: URL to WordPress Updates screen. */ … … function wp_theme_auto_update_setting_template() { 977 953 ?> 978 954 <# } else if ( ! data.compatiblePHP ) { #> 979 955 <?php 980 _e( 'This theme doesn’t work with your version of PHP.' );956 echo wp_get_compatibility_string( 'theme_incompatible_php' ); 981 957 if ( current_user_can( 'update_php' ) ) { 982 958 printf( 983 959 /* translators: %s: URL to Update PHP page. */ … … function wp_theme_auto_update_setting_template() { 1003 979 <p> 1004 980 <# if ( ! data.updateResponse.compatibleWP && ! data.updateResponse.compatiblePHP ) { #> 1005 981 <?php 1006 printf( 1007 /* translators: %s: Theme name. */ 1008 __( 'There is a new version of %s available, but it doesn’t work with your versions of WordPress and PHP.' ), 1009 '{{{ data.name }}}' 1010 ); 982 echo wp_get_compatibility_string( 'update_incompatible_wp_php', '{{{ data.name }}}' ); 1011 983 if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { 1012 984 printf( 1013 985 /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */ … … function wp_theme_auto_update_setting_template() { 1033 1005 ?> 1034 1006 <# } else if ( ! data.updateResponse.compatibleWP ) { #> 1035 1007 <?php 1036 printf( 1037 /* translators: %s: Theme name. */ 1038 __( 'There is a new version of %s available, but it doesn’t work with your version of WordPress.' ), 1039 '{{{ data.name }}}' 1040 ); 1008 echo wp_get_compatibility_string( 'update_incompatible_wp', '{{{ data.name }}}' ); 1041 1009 if ( current_user_can( 'update_core' ) ) { 1042 1010 printf( 1043 1011 /* translators: %s: URL to WordPress Updates screen. */ … … function wp_theme_auto_update_setting_template() { 1048 1016 ?> 1049 1017 <# } else if ( ! data.updateResponse.compatiblePHP ) { #> 1050 1018 <?php 1051 printf( 1052 /* translators: %s: Theme name. */ 1053 __( 'There is a new version of %s available, but it doesn’t work with your version of PHP.' ), 1054 '{{{ data.name }}}' 1055 ); 1019 echo wp_get_compatibility_string( 'update_incompatible_php', '{{{ data.name }}}' ); 1056 1020 if ( current_user_can( 'update_php' ) ) { 1057 1021 printf( 1058 1022 /* translators: %s: URL to Update PHP page. */ -
wp-admin/update-core.php
diff --git a/wp-admin/update-core.php b/wp-admin/update-core.php index 6a871671ee..dcef871a03 100644
a b function list_plugin_updates() { 382 382 $compatible_php = is_php_version_compatible( $requires_php ); 383 383 384 384 if ( ! $compatible_php && current_user_can( 'update_php' ) ) { 385 $compat .= '<br>' . __( 'This update doesn’t work with your version of PHP.' ) . ' ';385 $compat .= '<br>' . wp_get_compatibility_string( 'core_update_incompatible_php' ) . ' '; 386 386 $compat .= sprintf( 387 387 /* translators: %s: URL to Update PHP page. */ 388 388 __( '<a href="%s">Learn more about updating PHP</a>.' ), … … function list_theme_updates() { 518 518 $compat = ''; 519 519 520 520 if ( ! $compatible_wp && ! $compatible_php ) { 521 $compat .= '<br>' . __( 'This update doesn’t work with your versions of WordPress and PHP.' ) . ' ';521 $compat .= '<br>' . wp_get_compatibility_string( 'core_update_incompatible_wp_php' ) . ' '; 522 522 if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { 523 523 $compat .= sprintf( 524 524 /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */ … … function list_theme_updates() { 552 552 } 553 553 } 554 554 } elseif ( ! $compatible_wp ) { 555 $compat .= '<br>' . __( 'This update doesn’t work with your version of WordPress.' ) . ' ';555 $compat .= '<br>' . wp_get_compatibility_string( 'core_update_incompatible_wp' ) . ' '; 556 556 if ( current_user_can( 'update_core' ) ) { 557 557 $compat .= sprintf( 558 558 /* translators: %s: URL to WordPress Updates screen. */ … … function list_theme_updates() { 561 561 ); 562 562 } 563 563 } elseif ( ! $compatible_php ) { 564 $compat .= '<br>' . __( 'This update doesn’t work with your version of PHP.' ) . ' ';564 $compat .= '<br>' . wp_get_compatibility_string( 'core_update_incompatible_php' ) . ' '; 565 565 if ( current_user_can( 'update_php' ) ) { 566 566 $compat .= sprintf( 567 567 /* translators: %s: URL to Update PHP page. */ -
wp-includes/customize/class-wp-customize-theme-control.php
diff --git a/wp-includes/customize/class-wp-customize-theme-control.php b/wp-includes/customize/class-wp-customize-theme-control.php index a0a705d545..bb174849c8 100644
a b class WP_Customize_Theme_Control extends WP_Customize_Control { 111 111 <p> 112 112 <# if ( ! data.theme.updateResponse.compatibleWP && ! data.theme.updateResponse.compatiblePHP ) { #> 113 113 <?php 114 printf( 115 /* translators: %s: Theme name. */ 116 __( 'There is a new version of %s available, but it doesn’t work with your versions of WordPress and PHP.' ), 117 '{{{ data.theme.name }}}' 118 ); 114 echo wp_get_compatibility_string( 'update_incompatible_wp_php', '{{{ data.theme.name }}}' ); 119 115 if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { 120 116 printf( 121 117 /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */ … … class WP_Customize_Theme_Control extends WP_Customize_Control { 141 137 ?> 142 138 <# } else if ( ! data.theme.updateResponse.compatibleWP ) { #> 143 139 <?php 144 printf( 145 /* translators: %s: Theme name. */ 146 __( 'There is a new version of %s available, but it doesn’t work with your version of WordPress.' ), 147 '{{{ data.theme.name }}}' 148 ); 140 echo wp_get_compatibility_string( 'update_incompatible_wp', '{{{ data.theme.name }}}' ); 149 141 if ( current_user_can( 'update_core' ) ) { 150 142 printf( 151 143 /* translators: %s: URL to WordPress Updates screen. */ … … class WP_Customize_Theme_Control extends WP_Customize_Control { 156 148 ?> 157 149 <# } else if ( ! data.theme.updateResponse.compatiblePHP ) { #> 158 150 <?php 159 printf( 160 /* translators: %s: Theme name. */ 161 __( 'There is a new version of %s available, but it doesn’t work with your version of PHP.' ), 162 '{{{ data.theme.name }}}' 163 ); 151 echo wp_get_compatibility_string( 'update_incompatible_php', '{{{ data.theme.name }}}' ); 164 152 if ( current_user_can( 'update_php' ) ) { 165 153 printf( 166 154 /* translators: %s: URL to Update PHP page. */ … … class WP_Customize_Theme_Control extends WP_Customize_Control { 180 168 <div class="notice notice-error notice-alt"><p> 181 169 <# if ( ! data.theme.compatibleWP && ! data.theme.compatiblePHP ) { #> 182 170 <?php 183 _e( 'This theme doesn’t work with your versions of WordPress and PHP.' );171 echo wp_get_compatibility_string( 'theme_incompatible_wp_php' ); 184 172 if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { 185 173 printf( 186 174 /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */ … … class WP_Customize_Theme_Control extends WP_Customize_Control { 206 194 ?> 207 195 <# } else if ( ! data.theme.compatibleWP ) { #> 208 196 <?php 209 _e( 'This theme doesn’t work with your version of WordPress.' );197 echo wp_get_compatibility_string( 'theme_incompatible_wp' ); 210 198 if ( current_user_can( 'update_core' ) ) { 211 199 printf( 212 200 /* translators: %s: URL to WordPress Updates screen. */ … … class WP_Customize_Theme_Control extends WP_Customize_Control { 217 205 ?> 218 206 <# } else if ( ! data.theme.compatiblePHP ) { #> 219 207 <?php 220 _e( 'This theme doesn’t work with your version of PHP.' );208 echo wp_get_compatibility_string( 'theme_incompatible_php' ); 221 209 if ( current_user_can( 'update_php' ) ) { 222 210 printf( 223 211 /* translators: %s: URL to Update PHP page. */ -
wp-includes/functions.php
diff --git a/wp-includes/functions.php b/wp-includes/functions.php index fe68d7f760..c289a36965 100644
a b function is_php_version_compatible( $required ) { 7660 7660 function wp_fuzzy_number_match( $expected, $actual, $precision = 1 ) { 7661 7661 return abs( (float) $expected - (float) $actual ) <= $precision; 7662 7662 } 7663 7664 /** 7665 * Return compatibility string. 7666 * 7667 * @since 5.6.0 7668 * 7669 * @param string $key The key for the particular string. 7670 * Default is false. 7671 * @param string $name Plugin or theme name. 7672 * @return string The appropriate compatibilty string. 7673 */ 7674 function wp_get_compatibility_string( $key = false, $name = '' ) { 7675 static $strings = array(); 7676 7677 if ( empty( $strings ) ) { 7678 $strings = array( 7679 'theme_incompatible_wp_php' => __( 'This theme doesn’t work with your versions of WordPress and PHP.' ), 7680 'plugin_incompatible_wp_php' => __( 'This plugin doesn’t work with your versions of WordPress and PHP.' ), 7681 'core_update_incompatible_wp_php' => __( 'This update doesn’t work with your versions of WordPress and PHP.' ), 7682 'theme_incompatible_wp' => __( 'This theme doesn’t work with your version of WordPress.' ), 7683 'plugin_incompatible_wp' => __( 'This plugin doesn’t work with your version of WordPress.' ), 7684 'core_update_incompatible_wp' => __( 'This update doesn’t work with your version of WordPress.' ), 7685 'theme_incompatible_php' => __( 'This theme doesn’t work with your version of PHP.' ), 7686 'plugin_incompatible_php' => __( 'This plugin doesn’t work with your version of PHP.' ), 7687 'core_update_incompatible_php' => __( 'This update doesn’t work with your version of PHP.' ), 7688 ); 7689 } 7690 7691 if ( array_key_exists( $key, $strings ) ) { 7692 return $strings[ $key ]; 7693 } 7694 7695 if ( $name ) { 7696 $names = array( 7697 /* translators: 1: plugin or theme name */ 7698 'update_incompatible_wp_php' => sprintf( __( 'There is a new version of %s available, but it doesn’t work with your versions of WordPress and PHP.' ), $name ), 7699 /* translators: 1: plugin or theme name */ 7700 'update_incompatible_wp' => sprintf( __( 'There is a new version of %s available, but it doesn’t work with your version of WordPress.' ), $name ), 7701 /* translators: 1: plugin or theme name */ 7702 'update_incompatible_php' => sprintf( __( 'There is a new version of %s available, but it doesn’t work with your version of PHP.' ), $name ), 7703 ); 7704 7705 if ( array_key_exists( $key, $names ) ) { 7706 return $names[ $key ]; 7707 } 7708 } 7709 7710 return ''; 7711 }