Make WordPress Core

Ticket #50787: 50787.diff

File 50787.diff, 28.4 KB (added by afragen, 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..d2e7507991 100644
    a b class WP_Plugin_Install_List_Table extends WP_List_Table { 
    651651                        if ( ! $compatible_php || ! $compatible_wp ) {
    652652                                echo '<div class="notice inline notice-error notice-alt"><p>';
    653653                                if ( ! $compatible_php && ! $compatible_wp ) {
    654                                         _e( 'This plugin doesn&#8217;t work with your versions of WordPress and PHP.' );
     654                                        echo wp_compatibility_strings( 'plugin_incompatible_wp_php' );
    655655                                        if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
    656656                                                printf(
    657657                                                        /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
    class WP_Plugin_Install_List_Table extends WP_List_Table { 
    675675                                                wp_update_php_annotation( '</p><p><em>', '</em>' );
    676676                                        }
    677677                                } elseif ( ! $compatible_wp ) {
    678                                         _e( 'This plugin doesn&#8217;t work with your version of WordPress.' );
     678                                        echo wp_compatibility_strings( 'plugin_incompatible_wp' );
    679679                                        if ( current_user_can( 'update_core' ) ) {
    680680                                                printf(
    681681                                                        /* translators: %s: URL to WordPress Updates screen. */
    class WP_Plugin_Install_List_Table extends WP_List_Table { 
    684684                                                );
    685685                                        }
    686686                                } elseif ( ! $compatible_php ) {
    687                                         _e( 'This plugin doesn&#8217;t work with your version of PHP.' );
     687                                        echo wp_compatibility_strings( 'plugin_incompatible_php' );
    688688                                        if ( current_user_can( 'update_php' ) ) {
    689689                                                printf(
    690690                                                        /* 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..981cac9e1d 100644
    a b function customize_themes_print_templates() { 
    845845                                                                <p>
    846846                                                                        <# if ( ! data.updateResponse.compatibleWP && ! data.updateResponse.compatiblePHP ) { #>
    847847                                                                                <?php
    848                                                                                 printf(
    849                                                                                         /* translators: %s: Theme name. */
    850                                                                                         __( 'There is a new version of %s available, but it doesn&#8217;t work with your versions of WordPress and PHP.' ),
    851                                                                                         '{{{ data.name }}}'
    852                                                                                 );
     848                                                                                echo wp_compatibility_strings( 'update_incompatible_wp_php', '{{{ data.name }}}' );
    853849                                                                                if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
    854850                                                                                        printf(
    855851                                                                                                /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
    function customize_themes_print_templates() { 
    875871                                                                                ?>
    876872                                                                        <# } else if ( ! data.updateResponse.compatibleWP ) { #>
    877873                                                                                <?php
    878                                                                                 printf(
    879                                                                                         /* translators: %s: Theme name. */
    880                                                                                         __( 'There is a new version of %s available, but it doesn&#8217;t work with your version of WordPress.' ),
    881                                                                                         '{{{ data.name }}}'
    882                                                                                 );
     874                                                                                echo wp_compatibility_strings( 'update_incompatible_wp', '{{{ data.name }}}' );
    883875                                                                                if ( current_user_can( 'update_core' ) ) {
    884876                                                                                        printf(
    885877                                                                                                /* translators: %s: URL to WordPress Updates screen. */
    function customize_themes_print_templates() { 
    890882                                                                                ?>
    891883                                                                        <# } else if ( ! data.updateResponse.compatiblePHP ) { #>
    892884                                                                                <?php
    893                                                                                 printf(
    894                                                                                         /* translators: %s: Theme name. */
    895                                                                                         __( 'There is a new version of %s available, but it doesn&#8217;t work with your version of PHP.' ),
    896                                                                                         '{{{ data.name }}}'
    897                                                                                 );
     885                                                                                echo wp_compatibility_strings( 'update_incompatible_php', '{{{ data.name }}}' );
    898886                                                                                if ( current_user_can( 'update_php' ) ) {
    899887                                                                                        printf(
    900888                                                                                                /* translators: %s: URL to Update PHP page. */
    function customize_themes_print_templates() { 
    926914                                                <div class="notice notice-error notice-alt notice-large"><p>
    927915                                                        <# if ( ! data.compatibleWP && ! data.compatiblePHP ) { #>
    928916                                                                <?php
    929                                                                 _e( 'This theme doesn&#8217;t work with your versions of WordPress and PHP.' );
     917                                                                echo wp_compatibility_strings( 'theme_incompatible_wp_php' );
    930918                                                                if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
    931919                                                                        printf(
    932920                                                                                /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
    function customize_themes_print_templates() { 
    952940                                                                ?>
    953941                                                        <# } else if ( ! data.compatibleWP ) { #>
    954942                                                                <?php
    955                                                                 _e( 'This theme doesn&#8217;t work with your version of WordPress.' );
     943                                                                echo wp_compatibility_strings( 'theme_incompatible_wp' );
    956944                                                                if ( current_user_can( 'update_core' ) ) {
    957945                                                                        printf(
    958946                                                                                /* translators: %s: URL to WordPress Updates screen. */
    function customize_themes_print_templates() { 
    963951                                                                ?>
    964952                                                        <# } else if ( ! data.compatiblePHP ) { #>
    965953                                                                <?php
    966                                                                 _e( 'This theme doesn&#8217;t work with your version of PHP.' );
     954                                                                echo wp_compatibility_strings( 'theme_incompatible_php' );
    967955                                                                if ( current_user_can( 'update_php' ) ) {
    968956                                                                        printf(
    969957                                                                                /* 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..83872923af 100644
    a b function wp_plugin_update_row( $file, $plugin_data ) { 
    513513                                        )
    514514                                );
    515515                        } else {
     516                                echo wp_compatibility_strings( 'update_incompatible_php', $plugin_name );
     517                                echo ' ';
    516518                                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&#8217;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>.' ),
    520521                                        esc_url( $details_url ),
    521522                                        sprintf(
    522523                                                'class="thickbox open-plugin-details-modal" aria-label="%s"',
    function wp_theme_update_row( $theme_key, $theme ) { 
    707708                }
    708709        } else {
    709710                if ( ! $compatible_wp && ! $compatible_php ) {
    710                         printf(
    711                                 /* translators: %s: Theme name. */
    712                                 __( 'There is a new version of %s available, but it doesn&#8217;t work with your versions of WordPress and PHP.' ),
    713                                 $theme['Name']
    714                         );
     711                        echo wp_compatibility_strings( 'update_incompatible_wp_php', $theme['Name'] );
    715712                        if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
    716713                                printf(
    717714                                        /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
    function wp_theme_update_row( $theme_key, $theme ) { 
    735732                                wp_update_php_annotation( '</p><p><em>', '</em>' );
    736733                        }
    737734                } elseif ( ! $compatible_wp ) {
    738                         printf(
    739                                 /* translators: %s: Theme name. */
    740                                 __( 'There is a new version of %s available, but it doesn&#8217;t work with your version of WordPress.' ),
    741                                 $theme['Name']
    742                         );
     735                        echo wp_compatibility_strings( 'update_incompatible_wp', $theme['Name'] );
    743736                        if ( current_user_can( 'update_core' ) ) {
    744737                                printf(
    745738                                        /* translators: %s: URL to WordPress Updates screen. */
    function wp_theme_update_row( $theme_key, $theme ) { 
    748741                                );
    749742                        }
    750743                } elseif ( ! $compatible_php ) {
    751                         printf(
    752                                 /* translators: %s: Theme name. */
    753                                 __( 'There is a new version of %s available, but it doesn&#8217;t work with your version of PHP.' ),
    754                                 $theme['Name']
    755                         );
     744                        echo wp_compatibility_strings( 'update_incompatible_php', $theme['Name'] );
    756745                        if ( current_user_can( 'update_php' ) ) {
    757746                                printf(
    758747                                        /* 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..c355618221 100644
    a b if ( $tab ) { 
    280280                <div class="notice notice-error notice-alt"><p>
    281281                        <# if ( ! data.compatible_wp && ! data.compatible_php ) { #>
    282282                                <?php
    283                                 _e( 'This theme doesn&#8217;t work with your versions of WordPress and PHP.' );
     283                                echo wp_compatibility_strings( 'theme_incompatible_wp_php' );
    284284                                if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
    285285                                        printf(
    286286                                                /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
    if ( $tab ) { 
    306306                                ?>
    307307                        <# } else if ( ! data.compatible_wp ) { #>
    308308                                <?php
    309                                 _e( 'This theme doesn&#8217;t work with your version of WordPress.' );
     309                                echo wp_compatibility_strings( 'theme_incompatible_wp' );
    310310                                if ( current_user_can( 'update_core' ) ) {
    311311                                        printf(
    312312                                                /* translators: %s: URL to WordPress Updates screen. */
    if ( $tab ) { 
    317317                                ?>
    318318                        <# } else if ( ! data.compatible_php ) { #>
    319319                                <?php
    320                                 _e( 'This theme doesn&#8217;t work with your version of PHP.' );
     320                                echo wp_compatibility_strings( 'theme_incompatible_php' );
    321321                                if ( current_user_can( 'update_php' ) ) {
    322322                                        printf(
    323323                                                /* translators: %s: URL to Update PHP page. */
    if ( $tab ) { 
    466466                                                        <div class="notice notice-error notice-alt notice-large"><p>
    467467                                                                <# if ( ! data.compatible_wp && ! data.compatible_php ) { #>
    468468                                                                        <?php
    469                                                                         _e( 'This theme doesn&#8217;t work with your versions of WordPress and PHP.' );
     469                                                                        echo wp_compatibility_strings( 'theme_incompatible_wp_php' );
    470470                                                                        if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
    471471                                                                                printf(
    472472                                                                                        /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
    if ( $tab ) { 
    492492                                                                        ?>
    493493                                                                <# } else if ( ! data.compatible_wp ) { #>
    494494                                                                        <?php
    495                                                                         _e( 'This theme doesn&#8217;t work with your version of WordPress.' );
     495                                                                        echo wp_compatibility_strings( 'theme_incompatible_wp' );
    496496                                                                        if ( current_user_can( 'update_core' ) ) {
    497497                                                                                printf(
    498498                                                                                        /* translators: %s: URL to WordPress Updates screen. */
    if ( $tab ) { 
    503503                                                                        ?>
    504504                                                                <# } else if ( ! data.compatible_php ) { #>
    505505                                                                        <?php
    506                                                                         _e( 'This theme doesn&#8217;t work with your version of PHP.' );
     506                                                                        echo wp_compatibility_strings( 'theme_incompatible_php' );
    507507                                                                        if ( current_user_can( 'update_php' ) ) {
    508508                                                                                printf(
    509509                                                                                        /* 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..d3ca0fdd54 100644
    a b foreach ( $themes as $theme ) : 
    401401                        <div class="update-message notice inline notice-error notice-alt"><p>
    402402                                <?php
    403403                                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&#8217;t work with your versions of WordPress and PHP.' ),
    407                                                 $theme['name']
    408                                         );
     404                                        echo wp_compatibility_strings( 'update_incompatible_wp_php',  $theme['name'] );
    409405                                        if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
    410406                                                printf(
    411407                                                        /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
    foreach ( $themes as $theme ) : 
    429425                                                wp_update_php_annotation( '</p><p><em>', '</em>' );
    430426                                        }
    431427                                } elseif ( ! $theme['updateResponse']['compatibleWP'] ) {
    432                                         printf(
    433                                                 /* translators: %s: Theme name. */
    434                                                 __( 'There is a new version of %s available, but it doesn&#8217;t work with your version of WordPress.' ),
    435                                                 $theme['name']
    436                                         );
     428                                        echo wp_compatibility_strings( 'update_incompatibility_wp', $theme['name'] );
    437429                                        if ( current_user_can( 'update_core' ) ) {
    438430                                                printf(
    439431                                                        /* translators: %s: URL to WordPress Updates screen. */
    foreach ( $themes as $theme ) : 
    442434                                                );
    443435                                        }
    444436                                } elseif ( ! $theme['updateResponse']['compatiblePHP'] ) {
    445                                         printf(
    446                                                 /* translators: %s: Theme name. */
    447                                                 __( 'There is a new version of %s available, but it doesn&#8217;t work with your version of PHP.' ),
    448                                                 $theme['name']
    449                                         );
     437                                        echo wp_compatibility_strings( 'update_incompatible_php', $theme['name'] );
    450438                                        if ( current_user_can( 'update_php' ) ) {
    451439                                                printf(
    452440                                                        /* translators: %s: URL to Update PHP page. */
    foreach ( $themes as $theme ) : 
    465453        if ( ! $theme['compatibleWP'] || ! $theme['compatiblePHP'] ) {
    466454                echo '<div class="notice inline notice-error notice-alt"><p>';
    467455                if ( ! $theme['compatibleWP'] && ! $theme['compatiblePHP'] ) {
    468                         _e( 'This theme doesn&#8217;t work with your versions of WordPress and PHP.' );
     456                        echo wp_compatibility_strings( 'theme_incompatible_wp_php' );
    469457                        if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
    470458                                printf(
    471459                                        /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
    foreach ( $themes as $theme ) : 
    489477                                wp_update_php_annotation( '</p><p><em>', '</em>' );
    490478                        }
    491479                } elseif ( ! $theme['compatibleWP'] ) {
    492                         _e( 'This theme doesn&#8217;t work with your version of WordPress.' );
     480                        echo wp_compatibility_strings( 'theme_incompatible_wp' );
    493481                        if ( current_user_can( 'update_core' ) ) {
    494482                                printf(
    495483                                        /* translators: %s: URL to WordPress Updates screen. */
    foreach ( $themes as $theme ) : 
    498486                                );
    499487                        }
    500488                } elseif ( ! $theme['compatiblePHP'] ) {
    501                         _e( 'This theme doesn&#8217;t work with your version of PHP.' );
     489                        echo wp_compatibility_strings( 'theme_incompatible_php' );
    502490                        if ( current_user_can( 'update_php' ) ) {
    503491                                printf(
    504492                                        /* translators: %s: URL to Update PHP page. */
    function wp_theme_auto_update_setting_template() { 
    740728                        <div class="update-message notice inline notice-error notice-alt"><p>
    741729                                <# if ( ! data.updateResponse.compatibleWP && ! data.updateResponse.compatiblePHP ) { #>
    742730                                        <?php
    743                                         printf(
    744                                                 /* translators: %s: Theme name. */
    745                                                 __( 'There is a new version of %s available, but it doesn&#8217;t work with your versions of WordPress and PHP.' ),
    746                                                 '{{{ data.name }}}'
    747                                         );
     731                                        echo wp_compatibility_strings( 'update_incompatible_wp_php', '{{{ data.name }}}' );
    748732                                        if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
    749733                                                printf(
    750734                                                        /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
    function wp_theme_auto_update_setting_template() { 
    770754                                        ?>
    771755                                <# } else if ( ! data.updateResponse.compatibleWP ) { #>
    772756                                        <?php
    773                                         printf(
    774                                                 /* translators: %s: Theme name. */
    775                                                 __( 'There is a new version of %s available, but it doesn&#8217;t work with your version of WordPress.' ),
    776                                                 '{{{ data.name }}}'
    777                                         );
     757                                        echo wp_compatibility_strings( 'update_incompatible_wp', '{{{ data.name }}}' );
    778758                                        if ( current_user_can( 'update_core' ) ) {
    779759                                                printf(
    780760                                                        /* translators: %s: URL to WordPress Updates screen. */
    function wp_theme_auto_update_setting_template() { 
    785765                                        ?>
    786766                                <# } else if ( ! data.updateResponse.compatiblePHP ) { #>
    787767                                        <?php
    788                                         printf(
    789                                                 /* translators: %s: Theme name. */
    790                                                 __( 'There is a new version of %s available, but it doesn&#8217;t work with your version of PHP.' ),
    791                                                 '{{{ data.name }}}'
    792                                         );
     768                                        echo wp_compatibility_strings( 'update_incompatible_php', '{{{ data.name }}}' );
    793769                                        if ( current_user_can( 'update_php' ) ) {
    794770                                                printf(
    795771                                                        /* translators: %s: URL to Update PHP page. */
    function wp_theme_auto_update_setting_template() { 
    808784                <div class="notice notice-error notice-alt"><p>
    809785                        <# if ( ! data.compatibleWP && ! data.compatiblePHP ) { #>
    810786                                <?php
    811                                 _e( 'This theme doesn&#8217;t work with your versions of WordPress and PHP.' );
     787                                echo wp_compatibility_strings( 'theme_incompatible_wp_php' );
    812788                                if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
    813789                                        printf(
    814790                                                /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
    function wp_theme_auto_update_setting_template() { 
    834810                                ?>
    835811                        <# } else if ( ! data.compatibleWP ) { #>
    836812                                <?php
    837                                 _e( 'This theme doesn&#8217;t work with your version of WordPress.' );
     813                                echo wp_compatibility_strings( 'theme_incompatible_wp' );
    838814                                if ( current_user_can( 'update_core' ) ) {
    839815                                        printf(
    840816                                                /* translators: %s: URL to WordPress Updates screen. */
    function wp_theme_auto_update_setting_template() { 
    845821                                ?>
    846822                        <# } else if ( ! data.compatiblePHP ) { #>
    847823                                <?php
    848                                 _e( 'This theme doesn&#8217;t work with your version of PHP.' );
     824                                echo wp_compatibility_strings( 'theme_incompatible_php' );
    849825                                if ( current_user_can( 'update_php' ) ) {
    850826                                        printf(
    851827                                                /* translators: %s: URL to Update PHP page. */
    function wp_theme_auto_update_setting_template() { 
    940916                                        <div class="notice notice-error notice-alt notice-large"><p>
    941917                                                <# if ( ! data.compatibleWP && ! data.compatiblePHP ) { #>
    942918                                                        <?php
    943                                                         _e( 'This theme doesn&#8217;t work with your versions of WordPress and PHP.' );
     919                                                        echo wp_compatibility_strings( 'theme_incompatible_wp_php' );
    944920                                                        if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
    945921                                                                printf(
    946922                                                                        /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
    function wp_theme_auto_update_setting_template() { 
    966942                                                        ?>
    967943                                                <# } else if ( ! data.compatibleWP ) { #>
    968944                                                        <?php
    969                                                         _e( 'This theme doesn&#8217;t work with your version of WordPress.' );
     945                                                        echo wp_compatibility_strings( 'theme_incompatible_wp' );
    970946                                                        if ( current_user_can( 'update_core' ) ) {
    971947                                                                printf(
    972948                                                                        /* translators: %s: URL to WordPress Updates screen. */
    function wp_theme_auto_update_setting_template() { 
    977953                                                        ?>
    978954                                                <# } else if ( ! data.compatiblePHP ) { #>
    979955                                                        <?php
    980                                                         _e( 'This theme doesn&#8217;t work with your version of PHP.' );
     956                                                        echo wp_compatibility_strings( 'theme_incompatible_php' );
    981957                                                        if ( current_user_can( 'update_php' ) ) {
    982958                                                                printf(
    983959                                                                        /* translators: %s: URL to Update PHP page. */
    function wp_theme_auto_update_setting_template() { 
    1003979                                                        <p>
    1004980                                                                <# if ( ! data.updateResponse.compatibleWP && ! data.updateResponse.compatiblePHP ) { #>
    1005981                                                                        <?php
    1006                                                                         printf(
    1007                                                                                 /* translators: %s: Theme name. */
    1008                                                                                 __( 'There is a new version of %s available, but it doesn&#8217;t work with your versions of WordPress and PHP.' ),
    1009                                                                                 '{{{ data.name }}}'
    1010                                                                         );
     982                                                                        echo wp_compatibility_strings( 'update_incompatible_wp_php', '{{{ data.name }}}' );
    1011983                                                                        if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
    1012984                                                                                printf(
    1013985                                                                                        /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
    function wp_theme_auto_update_setting_template() { 
    10331005                                                                        ?>
    10341006                                                                <# } else if ( ! data.updateResponse.compatibleWP ) { #>
    10351007                                                                        <?php
    1036                                                                         printf(
    1037                                                                                 /* translators: %s: Theme name. */
    1038                                                                                 __( 'There is a new version of %s available, but it doesn&#8217;t work with your version of WordPress.' ),
    1039                                                                                 '{{{ data.name }}}'
    1040                                                                         );
     1008                                                                        echo wp_compatibility_strings( 'update_incompatible_wp', '{{{ data.name }}}' );
    10411009                                                                        if ( current_user_can( 'update_core' ) ) {
    10421010                                                                                printf(
    10431011                                                                                        /* translators: %s: URL to WordPress Updates screen. */
    function wp_theme_auto_update_setting_template() { 
    10481016                                                                        ?>
    10491017                                                                <# } else if ( ! data.updateResponse.compatiblePHP ) { #>
    10501018                                                                        <?php
    1051                                                                         printf(
    1052                                                                                 /* translators: %s: Theme name. */
    1053                                                                                 __( 'There is a new version of %s available, but it doesn&#8217;t work with your version of PHP.' ),
    1054                                                                                 '{{{ data.name }}}'
    1055                                                                         );
     1019                                                                        echo wp_compatibility_strings( 'update_incompatible_php', '{{{ data.name }}}' );
    10561020                                                                        if ( current_user_can( 'update_php' ) ) {
    10571021                                                                                printf(
    10581022                                                                                        /* 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..7bc5f2513b 100644
    a b function list_plugin_updates() { 
    382382                $compatible_php = is_php_version_compatible( $requires_php );
    383383
    384384                if ( ! $compatible_php && current_user_can( 'update_php' ) ) {
    385                         $compat .= '<br>' . __( 'This update doesn&#8217;t work with your version of PHP.' ) . '&nbsp;';
     385                        $compat .= '<br>' . wp_compatibility_strings( 'core_update_incompatible_php' ) . '&nbsp;';
    386386                        $compat .= sprintf(
    387387                                /* translators: %s: URL to Update PHP page. */
    388388                                __( '<a href="%s">Learn more about updating PHP</a>.' ),
    function list_theme_updates() { 
    518518                $compat = '';
    519519
    520520                if ( ! $compatible_wp && ! $compatible_php ) {
    521                         $compat .= '<br>' . __( 'This update doesn&#8217;t work with your versions of WordPress and PHP.' ) . '&nbsp;';
     521                        $compat .= '<br>' . wp_compatibility_strings( 'core_update_incompatible_wp_php' ) . '&nbsp;';
    522522                        if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
    523523                                $compat .= sprintf(
    524524                                        /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
    function list_theme_updates() { 
    552552                                }
    553553                        }
    554554                } elseif ( ! $compatible_wp ) {
    555                         $compat .= '<br>' . __( 'This update doesn&#8217;t work with your version of WordPress.' ) . '&nbsp;';
     555                        $compat .= '<br>' .  wp_compatibility_strings( 'core_update_incompatible_wp' ) . '&nbsp;';
    556556                        if ( current_user_can( 'update_core' ) ) {
    557557                                $compat .= sprintf(
    558558                                        /* translators: %s: URL to WordPress Updates screen. */
    function list_theme_updates() { 
    561561                                );
    562562                        }
    563563                } elseif ( ! $compatible_php ) {
    564                         $compat .= '<br>' . __( 'This update doesn&#8217;t work with your version of PHP.' ) . '&nbsp;';
     564                        $compat .= '<br>' .  wp_compatibility_strings( 'core_update_incompatible_php' ) . '&nbsp;';
    565565                        if ( current_user_can( 'update_php' ) ) {
    566566                                $compat .= sprintf(
    567567                                        /* 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..3ca693c1f3 100644
    a b class WP_Customize_Theme_Control extends WP_Customize_Control { 
    111111                                                <p>
    112112                                                        <# if ( ! data.theme.updateResponse.compatibleWP && ! data.theme.updateResponse.compatiblePHP ) { #>
    113113                                                                <?php
    114                                                                 printf(
    115                                                                         /* translators: %s: Theme name. */
    116                                                                         __( 'There is a new version of %s available, but it doesn&#8217;t work with your versions of WordPress and PHP.' ),
    117                                                                         '{{{ data.theme.name }}}'
    118                                                                 );
     114                                                                echo wp_compatibility_strings( 'update_incompatible_wp_php', '{{{ data.theme.name }}}' );
    119115                                                                if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
    120116                                                                        printf(
    121117                                                                                /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
    class WP_Customize_Theme_Control extends WP_Customize_Control { 
    141137                                                                ?>
    142138                                                        <# } else if ( ! data.theme.updateResponse.compatibleWP ) { #>
    143139                                                                <?php
    144                                                                 printf(
    145                                                                         /* translators: %s: Theme name. */
    146                                                                         __( 'There is a new version of %s available, but it doesn&#8217;t work with your version of WordPress.' ),
    147                                                                         '{{{ data.theme.name }}}'
    148                                                                 );
     140                                                                echo wp_compatibility_strings( 'update_incompatible_wp', '{{{ data.theme.name }}}' );
    149141                                                                if ( current_user_can( 'update_core' ) ) {
    150142                                                                        printf(
    151143                                                                                /* translators: %s: URL to WordPress Updates screen. */
    class WP_Customize_Theme_Control extends WP_Customize_Control { 
    156148                                                                ?>
    157149                                                        <# } else if ( ! data.theme.updateResponse.compatiblePHP ) { #>
    158150                                                                <?php
    159                                                                 printf(
    160                                                                         /* translators: %s: Theme name. */
    161                                                                         __( 'There is a new version of %s available, but it doesn&#8217;t work with your version of PHP.' ),
    162                                                                         '{{{ data.theme.name }}}'
    163                                                                 );
     151                                                                echo wp_compatibility_strings( 'update_incompatible_php', '{{{ data.theme.name }}}' );
    164152                                                                if ( current_user_can( 'update_php' ) ) {
    165153                                                                        printf(
    166154                                                                                /* translators: %s: URL to Update PHP page. */
    class WP_Customize_Theme_Control extends WP_Customize_Control { 
    180168                                <div class="notice notice-error notice-alt"><p>
    181169                                        <# if ( ! data.theme.compatibleWP && ! data.theme.compatiblePHP ) { #>
    182170                                                <?php
    183                                                 _e( 'This theme doesn&#8217;t work with your versions of WordPress and PHP.' );
     171                                                echo wp_compatibility_strings( 'theme_incompatible_wp_php' );
    184172                                                if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
    185173                                                        printf(
    186174                                                                /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
    class WP_Customize_Theme_Control extends WP_Customize_Control { 
    206194                                                ?>
    207195                                        <# } else if ( ! data.theme.compatibleWP ) { #>
    208196                                                <?php
    209                                                 _e( 'This theme doesn&#8217;t work with your version of WordPress.' );
     197                                                echo wp_compatibility_strings( 'theme_incompatible_wp' );
    210198                                                if ( current_user_can( 'update_core' ) ) {
    211199                                                        printf(
    212200                                                                /* translators: %s: URL to WordPress Updates screen. */
    class WP_Customize_Theme_Control extends WP_Customize_Control { 
    217205                                                ?>
    218206                                        <# } else if ( ! data.theme.compatiblePHP ) { #>
    219207                                                <?php
    220                                                 _e( 'This theme doesn&#8217;t work with your version of PHP.' );
     208                                                echo wp_compatibility_strings( 'theme_incompatible_php' );
    221209                                                if ( current_user_can( 'update_php' ) ) {
    222210                                                        printf(
    223211                                                                /* 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..8d2971b1b8 100644
    a b function is_php_version_compatible( $required ) { 
    76607660function wp_fuzzy_number_match( $expected, $actual, $precision = 1 ) {
    76617661        return abs( (float) $expected - (float) $actual ) <= $precision;
    76627662}
     7663
     7664/**
     7665 * Return compatibility strings.
     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 */
     7674function wp_compatibility_strings( $key = false, $name = '' ) {
     7675        $strings = array(
     7676                'theme_incompatible_wp_php'       => __( 'This theme doesn&#8217;t work with your versions of WordPress and PHP.' ),
     7677                'plugin_incompatible_wp_php'      => __( 'This plugin doesn&#8217;t work with your versions of WordPress and PHP.' ),
     7678                'core_update_incompatible_wp_php' => __( 'This update doesn&#8217;t work with your versions of WordPress and PHP.' ),
     7679                'theme_incompatible_wp'           => __( 'This theme doesn&#8217;t work with your version of WordPress.' ),
     7680                'plugin_incompatible_wp'          => __( 'This plugin doesn&#8217;t work with your version of WordPress.' ),
     7681                'core_update_incompatible_wp'     => __( 'This update doesn&#8217;t work with your version of WordPress.' ),
     7682                'theme_incompatible_php'          => __( 'This theme doesn&#8217;t work with your version of PHP.' ),
     7683                'plugin_incompatible_php'         => __( 'This plugin doesn&#8217;t work with your version of PHP.' ),
     7684                'core_update_incompatible_php'    => __( 'This update doesn&#8217;t work with your version of PHP.' ),
     7685
     7686                /* translators: 1: plugin or theme name */
     7687                'update_incompatible_wp_php'      => sprintf( __( 'There is a new version of %s available, but it doesn&#8217;t work with your versions of WordPress and PHP.' ), $name ),
     7688                /* translators: 1: plugin or theme name */
     7689                'update_incompatible_wp'          => sprintf( __( 'There is a new version of %s available, but it doesn&#8217;t work with your version of WordPress.' ), $name ),
     7690                /* translators: 1: plugin or theme name */
     7691                'update_incompatible_php'         => sprintf( __( 'There is a new version of %s available, but it doesn&#8217;t work with your version of PHP.' ), $name ),
     7692        );
     7693
     7694        if ( ! array_key_exists( $key, $strings ) ) {
     7695                return;
     7696        }
     7697
     7698        return $strings[ $key ];
     7699}