Make WordPress Core

Ticket #26167: 26167-2.patch

File 26167-2.patch, 6.3 KB (added by bramd, 11 years ago)

New patch that uses aria-label for an extended label for activate/deactivate/delete links.

  • src/wp-admin/includes/class-wp-plugins-list-table.php

     
    376376                        if ( $screen->in_admin( 'network' ) ) {
    377377                                if ( $is_active ) {
    378378                                        if ( current_user_can( 'manage_network_plugins' ) )
    379                                                 $actions['deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'deactivate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Deactivate this plugin') . '">' . __('Network Deactivate') . '</a>';
     379                                                $actions['deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'deactivate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Deactivate this plugin') . '" aria-label="' . esc_attr(sprintf(__('Network Deactivate %s'), $plugin_data['Name'])) . '">' . __('Network Deactivate') . '</a>';
    380380                                } else {
    381381                                        if ( current_user_can( 'manage_network_plugins' ) )
    382                                                 $actions['activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin for all sites in this network') . '" class="edit">' . __('Network Activate') . '</a>';
     382                                                $actions['activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin for all sites in this network') . '" class="edit" aria-label="' . esc_attr(sprintf(__('Network Activate %s'), $plugin_data['Name'])) . '">' . __('Network Activate') . '</a>';
    383383                                        if ( current_user_can( 'delete_plugins' ) && ! is_plugin_active( $plugin_file ) )
    384                                                 $actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&amp;checked[]=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'bulk-plugins') . '" title="' . esc_attr__('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>';
     384                                                $actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&amp;checked[]=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'bulk-plugins') . '" title="' . esc_attr__('Delete this plugin') . '" class="delete" aria-label="' . esc_attr(sprintf(__('Delete %s'), $plugin_data['Name'])) . '">' . __('Delete') . '</a>';
    385385                                }
    386386                        } else {
    387387                                if ( $is_active ) {
    388                                         $actions['deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'deactivate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Deactivate this plugin') . '">' . __('Deactivate') . '</a>';
     388                                        $actions['deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'deactivate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Deactivate this plugin') . '" aria-label="' . esc_attr(sprintf(__('Deactivate %s'), $plugin_data['Name'])) . '">' . __('Deactivate') . '</a>';
    389389                                } else {
    390                                         $actions['activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin') . '" class="edit">' . __('Activate') . '</a>';
     390                                        $actions['activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin') . '" class="edit" aria-label="' . esc_attr(sprintf(__('Activate %s'), $plugin_data['Name'])) . '">' . __('Activate') . '</a>';
    391391
    392392                                        if ( ! is_multisite() && current_user_can('delete_plugins') )
    393                                                 $actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&amp;checked[]=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'bulk-plugins') . '" title="' . esc_attr__('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>';
     393                                                $actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&amp;checked[]=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'bulk-plugins') . '" title="' . esc_attr__('Delete this plugin') . '" class="delete" aria-label="' . esc_attr(sprintf(__('Delete %s'), $plugin_data['Name'])) . '">' . __('Delete') . '</a>';
    394394                                } // end if $is_active
    395395                         } // end if $screen->in_admin( 'network' )
    396396
    397397                        if ( ( ! is_multisite() || $screen->in_admin( 'network' ) ) && current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) )
    398                                 $actions['edit'] = '<a href="plugin-editor.php?file=' . $plugin_file . '" title="' . esc_attr__('Open this file in the Plugin Editor') . '" class="edit">' . __('Edit') . '</a>';
     398                                $actions['edit'] = '<a href="plugin-editor.php?file=' . $plugin_file . '" title="' . esc_attr__('Open this file in the Plugin Editor') . '" class="edit" aria-label="' . esc_attr(sprintf(__('Edit %s'), $plugin_data['Name'])) . '">' . __('Edit') . '</a>';
    399399                } // end if $context
    400400
    401401                $prefix = $screen->in_admin( 'network' ) ? 'network_admin_' : '';
     
    476476
    477477                        switch ( $column_name ) {
    478478                                case 'cb':
    479                                         echo "<th scope='row' class='check-column'>$checkbox</th>";
     479                                        echo "<td class='check-column'>$checkbox</td>";
    480480                                        break;
    481481                                case 'name':
    482                                         echo "<td class='plugin-title'$style><strong>$plugin_name</strong>";
     482                                        echo "<th class='plugin-title'$style><strong>$plugin_name</strong>";
    483483                                        echo $this->row_actions( $actions, true );
    484                                         echo "</td>";
     484                                        echo "</th>";
    485485                                        break;
    486486                                case 'description':
    487487                                        echo "<td class='column-description desc'$style>