WordPress.org

Make WordPress Core

Ticket #43376: 43376_button_element.3.diff

File 43376_button_element.3.diff, 2.1 KB (added by audrasjb, 3 years ago)

Fix error in previous patch: replaces role with type attribute…

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

    diff --git a/src/wp-admin/includes/class-wp-comments-list-table.php b/src/wp-admin/includes/class-wp-comments-list-table.php
    index 5070b94..14e743c 100644
    a b if ( ( 'spam' === $comment_status || 'trash' === $comment_status ) && current_us 
    635635                if ( 'spam' !== $the_comment_status && 'trash' !== $the_comment_status ) {
    636636                        $actions['edit'] = "<a href='comment.php?action=editcomment&amp;c={$comment->comment_ID}' aria-label='" . esc_attr__( 'Edit this comment' ) . "'>" . __( 'Edit' ) . '</a>';
    637637
    638                         $format = '<a data-comment-id="%d" data-post-id="%d" data-action="%s" class="%s" aria-label="%s" href="#">%s</a>';
     638                        $format = '<button type="button" data-comment-id="%d" data-post-id="%d" data-action="%s" class="%s button-link" aria-expanded="false" aria-label="%s">%s</button>';
    639639
    640640                        $actions['quickedit'] = sprintf( $format, $comment->comment_ID, $comment->comment_post_ID, 'edit', 'vim-q comment-inline', esc_attr__( 'Quick edit this comment inline' ), __( 'Quick&nbsp;Edit' ) );
    641641
  • src/wp-admin/js/edit-comments.js

    diff --git a/src/wp-admin/js/edit-comments.js b/src/wp-admin/js/edit-comments.js
    index b9a9f2c..795f2f8 100644
    a b commentReply = { 
    578578        init : function() {
    579579                var row = $('#replyrow');
    580580
    581                 $('a.cancel', row).click(function() { return commentReply.revert(); });
     581                $('a.cancel', row).click(function() {
     582                        $( '.comment-inline' ).attr( 'aria-expanded', 'false' );
     583                        return commentReply.revert();
     584                });
    582585                $('a.save', row).click(function() { return commentReply.send(); });
    583586                $( 'input#author-name, input#author-email, input#author-url', row ).keypress( function( e ) {
    584587                        if ( e.which == 13 ) {
    $(document).ready(function(){ 
    962965        // Quick Edit and Reply have an inline comment editor.
    963966        $( '#the-comment-list' ).on( 'click', '.comment-inline', function (e) {
    964967                e.preventDefault();
     968                $( this ).attr( 'aria-expanded', 'true' );
    965969                var $el = $( this ),
    966970                        action = 'replyto';
    967971