Make WordPress Core

Changeset 36394


Ignore:
Timestamp:
01/25/2016 10:54:52 PM (11 years ago)
Author:
obenland
Message:

Pass data consistently on plugin, network plugin, and network theme screens.

List tables on these three screens look similar but come with unexpected caveats.
The network themes screen in particular has been neglected, using a .plugin
class to inherit its sibling's styles and not providing classes and data
attributes that the other two offer. This will provide some more consistency.

Fixes #35335.

Location:
trunk/src/wp-admin/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-ms-themes-list-table.php

    r35924 r36394  
    683683
    684684                $class = ! $allowed ? 'inactive' : 'active';
    685 
    686                 $id = sanitize_html_class( $theme->get_stylesheet() );
    687 
    688685                if ( ! empty( $totals['upgrade'] ) && ! empty( $theme->update ) ) {
    689686                        $class .= ' update';
    690687                }
    691688
    692                 echo "<tr id='$id' class='$class'>";
     689                printf( '<tr class="%s" data-slug="%s">',
     690                        esc_attr( $class ),
     691                        esc_attr( $stylesheet )
     692                );
    693693
    694694                $this->single_row_columns( $theme );
  • trunk/src/wp-admin/includes/update.php

    r36032 r36394  
    457457        $wp_list_table = _get_list_table('WP_MS_Themes_List_Table');
    458458
    459         echo '<tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange"><div class="update-message">';
     459        $active = $theme->is_allowed( 'network' ) ? ' active': '';
     460
     461        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">';
    460462        if ( ! current_user_can('update_themes') ) {
    461463                /* translators: 1: theme name, 2: details URL, 3: escaped theme name, 4: version number */
    … …  
    476478        } else {
    477479                /* translators: 1: theme name, 2: details URL, 3: escaped theme name, 4: version number, 5: update URL */
    478                 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" aria-label="update %3$s now">update now</a>.' ),
     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>.' ),
    479481                        $theme['Name'],
    480482                        esc_url( $details_url ),
Note: See TracChangeset for help on using the changeset viewer.