Make WordPress Core

Ticket #36555: 36555.patch

File 36555.patch, 3.9 KB (added by joedolson, 9 years ago)

Adds aria-button-if-js where appropriate

  • wp-admin/includes/class-wp-media-list-table.php

     
    505505                        <?php if ( $user_can_edit ) {
    506506                                $title = _draft_or_post_title( $post->post_parent );
    507507                                printf(
    508                                         '<a href="#the-list" onclick="findPosts.open( \'media[]\', \'%s\' ); return false;" class="hide-if-no-js" aria-label="%s">%s</a>',
     508                                        '<a href="#the-list" onclick="findPosts.open( \'media[]\', \'%s\' ); return false;" class="hide-if-no-js aria-button-if-js" aria-label="%s">%s</a>',
    509509                                        $post->ID,
    510510                                        /* translators: %s: attachment title */
    511511                                        esc_attr( sprintf( __( 'Attach &#8220;%s&#8221; to existing content' ), $title ) ),
     
    657657                        if ( current_user_can( 'delete_post', $post->ID ) ) {
    658658                                if ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) {
    659659                                        $actions['trash'] = sprintf(
    660                                                 '<a href="%s" class="submitdelete" aria-label="%s">%s</a>',
     660                                                '<a href="%s" class="submitdelete aria-button-if-js" aria-label="%s">%s</a>',
    661661                                                wp_nonce_url( "post.php?action=trash&amp;post=$post->ID", 'trash-post_' . $post->ID ),
    662662                                                /* translators: %s: attachment title */
    663663                                                esc_attr( sprintf( __( 'Move &#8220;%s&#8221; to the Trash' ), $att_title ) ),
     
    666666                                } else {
    667667                                        $delete_ays = ! MEDIA_TRASH ? " onclick='return showNotice.warn();'" : '';
    668668                                        $actions['delete'] = sprintf(
    669                                                 '<a href="%s" class="submitdelete"%s aria-label="%s">%s</a>',
     669                                                '<a href="%s" class="submitdelete aria-button-if-js"%s aria-label="%s">%s</a>',
    670670                                                wp_nonce_url( "post.php?action=delete&amp;post=$post->ID", 'delete-post_' . $post->ID ),
    671671                                                $delete_ays,
    672672                                                /* translators: %s: attachment title */
     
    685685
    686686                        if ( current_user_can( 'edit_post', $post->ID ) ) {
    687687                                $actions['attach'] = sprintf(
    688                                         '<a href="#the-list" onclick="findPosts.open( \'media[]\', \'%s\' ); return false;" class="hide-if-no-js" aria-label="%s">%s</a>',
     688                                        '<a href="#the-list" onclick="findPosts.open( \'media[]\', \'%s\' ); return false;" class="hide-if-no-js aria-button-if-js" aria-label="%s">%s</a>',
    689689                                        $post->ID,
    690690                                        /* translators: %s: attachment title */
    691691                                        esc_attr( sprintf( __( 'Attach &#8220;%s&#8221; to existing content' ), $att_title ) ),
     
    706706                        if ( current_user_can( 'delete_post', $post->ID ) ) {
    707707                                if ( $this->is_trash ) {
    708708                                        $actions['untrash'] = sprintf(
    709                                                 '<a href="%s" class="submitdelete" aria-label="%s">%s</a>',
     709                                                '<a href="%s" class="submitdelete aria-button-if-js" aria-label="%s">%s</a>',
    710710                                                wp_nonce_url( "post.php?action=untrash&amp;post=$post->ID", 'untrash-post_' . $post->ID ),
    711711                                                /* translators: %s: attachment title */
    712712                                                esc_attr( sprintf( __( 'Restore &#8220;%s&#8221; from the Trash' ), $att_title ) ),
     
    714714                                        );
    715715                                } elseif ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) {
    716716                                        $actions['trash'] = sprintf(
    717                                                 '<a href="%s" class="submitdelete" aria-label="%s">%s</a>',
     717                                                '<a href="%s" class="submitdelete aria-button-if-js" aria-label="%s">%s</a>',
    718718                                                wp_nonce_url( "post.php?action=trash&amp;post=$post->ID", 'trash-post_' . $post->ID ),
    719719                                                /* translators: %s: attachment title */
    720720                                                esc_attr( sprintf( __( 'Move &#8220;%s&#8221; to the Trash' ), $att_title ) ),
     
    724724                                if ( $this->is_trash || ! EMPTY_TRASH_DAYS || ! MEDIA_TRASH ) {
    725725                                        $delete_ays = ( !$this->is_trash && !MEDIA_TRASH ) ? " onclick='return showNotice.warn();'" : '';
    726726                                        $actions['delete'] = sprintf(
    727                                                 '<a href="%s" class="submitdelete"%s aria-label="%s">%s</a>',
     727                                                '<a href="%s" class="submitdelete aria-button-if-js"%s aria-label="%s">%s</a>',
    728728                                                wp_nonce_url( "post.php?action=delete&amp;post=$post->ID", 'delete-post_' . $post->ID ),
    729729                                                $delete_ays,
    730730                                                /* translators: %s: attachment title */