Make WordPress Core


Ignore:
Timestamp:
01/17/2016 03:46:01 PM (9 years ago)
Author:
afercia
Message:

Accessibility: Remove title attributes from the Posts list table.

Fixes #35313.

File:
1 edited

Legend:

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

    r35901 r36333  
    878878
    879879        if ( $can_edit_post && $post->post_status != 'trash' ) {
    880             $edit_link = get_edit_post_link( $post->ID );
    881             echo '<a class="row-title" href="' . $edit_link . '" title="' . esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $title ) ) . '">' . $pad . $title . '</a>';
     880            printf(
     881                '<a class="row-title" href="%s" aria-label="%s">%s%s</a>',
     882                get_edit_post_link( $post->ID ),
     883                /* translators: %s: post title */
     884                esc_attr( sprintf( __( '&#8220;%s&#8221; (Edit)' ), $title ) ),
     885                $pad,
     886                $title
     887            );
    882888        } else {
    883889            echo $pad . $title;
     
    11701176        $can_edit_post = current_user_can( 'edit_post', $post->ID );
    11711177        $actions = array();
     1178        $title = _draft_or_post_title();
    11721179
    11731180        if ( $can_edit_post && 'trash' != $post->post_status ) {
    1174             $actions['edit'] = '<a href="' . get_edit_post_link( $post->ID ) . '" title="' . esc_attr__( 'Edit this item' ) . '">' . __( 'Edit' ) . '</a>';
    1175             $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr__( 'Edit this item inline' ) . '">' . __( 'Quick&nbsp;Edit' ) . '</a>';
     1181            $actions['edit'] = sprintf(
     1182                '<a href="%s" aria-label="%s">%s</a>',
     1183                get_edit_post_link( $post->ID ),
     1184                /* translators: %s: post title */
     1185                esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $title ) ),
     1186                __( 'Edit' )
     1187            );
     1188            $actions['inline hide-if-no-js'] = sprintf(
     1189                '<a href="#" class="editinline" aria-label="%s">%s</a>',
     1190                /* translators: %s: post title */
     1191                esc_attr( sprintf( __( 'Quick edit &#8220;%s&#8221; inline' ), $title ) ),
     1192                __( 'Quick&nbsp;Edit' )
     1193            );
    11761194        }
    11771195
    11781196        if ( current_user_can( 'delete_post', $post->ID ) ) {
    1179             if ( 'trash' === $post->post_status )
    1180                 $actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash' ) . "' href='" . wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&amp;action=untrash', $post->ID ) ), 'untrash-post_' . $post->ID ) . "'>" . __( 'Restore' ) . "</a>";
    1181             elseif ( EMPTY_TRASH_DAYS )
    1182                 $actions['trash'] = "<a class='submitdelete' title='" . esc_attr__( 'Move this item to the Trash' ) . "' href='" . get_delete_post_link( $post->ID ) . "'>" . _x( 'Trash', 'verb' ) . "</a>";
    1183             if ( 'trash' === $post->post_status || !EMPTY_TRASH_DAYS )
    1184                 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently' ) . "' href='" . get_delete_post_link( $post->ID, '', true ) . "'>" . __( 'Delete Permanently' ) . "</a>";
     1197            if ( 'trash' === $post->post_status ) {
     1198                $actions['untrash'] = sprintf(
     1199                    '<a href="%s" aria-label="%s">%s</a>',
     1200                    wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&amp;action=untrash', $post->ID ) ), 'untrash-post_' . $post->ID ),
     1201                    /* translators: %s: post title */
     1202                    esc_attr__( sprintf( __( 'Restore &#8220;%s&#8221; from the Trash' ), $title ) ),
     1203                    __( 'Restore' )
     1204                );
     1205            } elseif ( EMPTY_TRASH_DAYS ) {
     1206                $actions['trash'] = sprintf(
     1207                    '<a href="%s" class="submitdelete" aria-label="%s">%s</a>',
     1208                    get_delete_post_link( $post->ID ),
     1209                    /* translators: %s: post title */
     1210                    esc_attr__( sprintf( __( 'Move &#8220;%s&#8221; to the Trash' ), $title ) ),
     1211                    _x( 'Trash', 'verb' )
     1212                );
     1213            }
     1214            if ( 'trash' === $post->post_status || ! EMPTY_TRASH_DAYS ) {
     1215                $actions['delete'] = sprintf(
     1216                    '<a href="%s" class="submitdelete" aria-label="%s">%s</a>',
     1217                    get_delete_post_link( $post->ID, '', true ),
     1218                    /* translators: %s: post title */
     1219                    esc_attr__( sprintf( __( 'Delete &#8220;%s&#8221; permanently' ), $title ) ),
     1220                    __( 'Delete Permanently' )
     1221                );
     1222            }
    11851223        }
    11861224
    11871225        if ( is_post_type_viewable( $post_type_object ) ) {
    1188             $title = _draft_or_post_title();
    11891226            if ( in_array( $post->post_status, array( 'pending', 'draft', 'future' ) ) ) {
    11901227                if ( $can_edit_post ) {
    11911228                    $unpublished_link = set_url_scheme( get_permalink( $post ) );
    11921229                    $preview_link = get_preview_post_link( $post, array(), $unpublished_link );
    1193                     $actions['view'] = '<a href="' . esc_url( $preview_link ) . '" title="' . esc_attr( sprintf( __( 'Preview &#8220;%s&#8221;' ), $title ) ) . '" rel="permalink">' . __( 'Preview' ) . '</a>';
     1230                    $actions['view'] = sprintf(
     1231                        '<a href="%s" rel="permalink" aria-label="%s">%s</a>',
     1232                        esc_url( $preview_link ),
     1233                        /* translators: %s: post title */
     1234                        esc_attr( sprintf( __( 'Preview &#8220;%s&#8221;' ), $title ) ),
     1235                        __( 'Preview' )
     1236                    );
    11941237                }
    11951238            } elseif ( 'trash' != $post->post_status ) {
    1196                 $actions['view'] = '<a href="' . get_permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View &#8220;%s&#8221;' ), $title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>';
     1239                $actions['view'] = sprintf(
     1240                    '<a href="%s" rel="permalink" aria-label="%s">%s</a>',
     1241                    get_permalink( $post->ID ),
     1242                    /* translators: %s: post title */
     1243                    esc_attr( sprintf( __( 'View &#8220;%s&#8221;' ), $title ) ),
     1244                    __( 'View' )
     1245                );
    11971246            }
    11981247        }
Note: See TracChangeset for help on using the changeset viewer.