WordPress.org

Make WordPress Core

Ticket #36048: 36048.patch

File 36048.patch, 7.6 KB (added by ramiy, 4 years ago)
  • wp-admin/includes/update.php

     
    316316 */
    317317function wp_plugin_update_row( $file, $plugin_data ) {
    318318        $current = get_site_transient( 'update_plugins' );
     319
    319320        if ( !isset( $current->response[ $file ] ) )
    320321                return false;
    321322
     
    322323        $r = $current->response[ $file ];
    323324
    324325        $plugins_allowedtags = array('a' => array('href' => array(),'title' => array()),'abbr' => array('title' => array()),'acronym' => array('title' => array()),'code' => array(),'em' => array(),'strong' => array());
     326
    325327        $plugin_name = wp_kses( $plugin_data['Name'], $plugins_allowedtags );
    326328
    327329        $details_url = self_admin_url('plugin-install.php?tab=plugin-information&plugin=' . $r->slug . '&section=changelog&TB_iframe=true&width=600&height=800');
     
    338340                echo '<tr class="plugin-update-tr' . $active_class . '" id="' . esc_attr( $r->slug . '-update' ) . '" data-slug="' . esc_attr( $r->slug ) . '" data-plugin="' . esc_attr( $file ) . '"><td colspan="' . esc_attr( $wp_list_table->get_column_count() ) . '" class="plugin-update colspanchange"><div class="update-message">';
    339341
    340342                if ( ! current_user_can( 'update_plugins' ) ) {
    341                         /* translators: 1: plugin name, 2: details URL, 3: escaped plugin name, 4: version number */
    342                         printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="View %3$s version %4$s details">View version %4$s details</a>.' ),
     343                        /* translators: 1: plugin name, 2: details URL, 3: aria-label text, 4: version number */
     344                        printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="%3$s">View version %4$s details</a>.' ),
    343345                                $plugin_name,
    344346                                esc_url( $details_url ),
    345                                 esc_attr( $plugin_name ),
     347                                esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $r->new_version ) ),
    346348                                $r->new_version
    347349                        );
    348350                } elseif ( empty( $r->package ) ) {
    349                         /* translators: 1: plugin name, 2: details URL, 3: escaped plugin name, 4: version number */
    350                         printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="View %3$s version %4$s details">View version %4$s details</a>. <em>Automatic update is unavailable for this plugin.</em>' ),
     351                        /* translators: 1: plugin name, 2: details URL, 3: aria-label text, 4: version number */
     352                        printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="%3$s">View version %4$s details</a>. <em>Automatic update is unavailable for this plugin.</em>' ),
    351353                                $plugin_name,
    352354                                esc_url( $details_url ),
    353                                 esc_attr( $plugin_name ),
     355                                esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $r->new_version ) ),
    354356                                $r->new_version
    355357                        );
    356358                } else {
    357                         /* translators: 1: plugin name, 2: details URL, 3: escaped plugin name, 4: version number, 5: update URL */
    358                         printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="View %3$s version %4$s details">View version %4$s details</a> or <a href="%5$s" class="update-link" aria-label="update %3$s now">update now</a>.' ),
     359                        /* translators: 1: plugin name, 2: details URL, 3: aria-label text, 4: version number, 5: update URL, 6: aria-label text */
     360                        printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="%3$s">View version %4$s details</a> or <a href="%5$s" class="update-link" aria-label="%6$s">update now</a>.' ),
    359361                                $plugin_name,
    360362                                esc_url( $details_url ),
    361                                 esc_attr( $plugin_name ),
     363                                esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $r->new_version ) ),
    362364                                $r->new_version,
    363                                 wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $file, 'upgrade-plugin_' . $file )
     365                                wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $file, 'upgrade-plugin_' . $file ),
     366                                esc_attr( sprintf( __( 'Update %s now' ), $plugin_name ) )
    364367                        );
    365368                }
    366369                /**
     
    450453        $current = get_site_transient( 'update_themes' );
    451454        if ( !isset( $current->response[ $theme_key ] ) )
    452455                return false;
     456
    453457        $r = $current->response[ $theme_key ];
    454458
     459        $theme_name = $theme['Name'];
     460
    455461        $details_url = add_query_arg( array( 'TB_iframe' => 'true', 'width' => 1024, 'height' => 800 ), $current->response[ $theme_key ]['url'] );
    456462
    457463        $wp_list_table = _get_list_table('WP_MS_Themes_List_Table');
     
    460466
    461467        echo '<tr class="plugin-update-tr' . $active . '" id="' . esc_attr( $theme->get_stylesheet() . '-update' ) . '" data-slug="' . esc_attr( $theme->get_stylesheet() ) . '"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange"><div class="update-message">';
    462468        if ( ! current_user_can('update_themes') ) {
    463                 /* translators: 1: theme name, 2: details URL, 3: escaped theme name, 4: version number */
    464                 printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="View %3$s version %4$s details">View version %4$s details</a>.'),
    465                         $theme['Name'],
     469                /* translators: 1: theme name, 2: details URL, 3: aria-label text, 4: version number */
     470                printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="%3$s">View version %4$s details</a>.'),
     471                        $theme_name,
    466472                        esc_url( $details_url ),
    467                         esc_attr( $theme['Name'] ),
    468                         $r->new_version
     473                        esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme_name, $r['new_version'] ) ),
     474                        $r['new_version']
    469475                );
    470476        } elseif ( empty( $r['package'] ) ) {
    471                 /* translators: 1: theme name, 2: details URL, 3: escaped theme name, 4: version number */
    472                 printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="View %3$s version %4$s details">View version %4$s details</a>. <em>Automatic update is unavailable for this theme.</em>' ),
    473                         $theme['Name'],
     477                /* translators: 1: theme name, 2: details URL, 3: aria-label text, 4: version number */
     478                printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="%3$s">View version %4$s details</a>. <em>Automatic update is unavailable for this theme.</em>' ),
     479                        $theme_name,
    474480                        esc_url( $details_url ),
    475                         esc_attr( $theme['Name'] ),
     481                        esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme_name, $r['new_version'] ) ),
    476482                        $r['new_version']
    477483                );
    478484        } else {
    479                 /* translators: 1: theme name, 2: details URL, 3: escaped theme name, 4: version number, 5: update URL */
    480                 printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="View %3$s version %4$s details">View version %4$s details</a> or <a href="%5$s" class="update-link" aria-label="update %3$s now">update now</a>.' ),
    481                         $theme['Name'],
     485                /* translators: 1: theme name, 2: details URL, 3: aria-label text, 4: version number, 5: update URL, 6: aria-label text */
     486                printf( __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" aria-label="%3$s">View version %4$s details</a> or <a href="%5$s" class="update-link" aria-label="%6$s">update now</a>.' ),
     487                        $theme_name,
    482488                        esc_url( $details_url ),
    483                         esc_attr( $theme['Name'] ),
     489                        esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme_name, $r['new_version'] ) ),
    484490                        $r['new_version'],
    485                         wp_nonce_url( self_admin_url( 'update.php?action=upgrade-theme&theme=' ) . $theme_key, 'upgrade-theme_' . $theme_key )
     491                        wp_nonce_url( self_admin_url( 'update.php?action=upgrade-theme&theme=' ) . $theme_key, 'upgrade-theme_' . $theme_key ),
     492                        esc_attr( sprintf( __( 'Update %s now' ), $theme_name ) )
    486493                );
    487494        }
    488495        /**