This morning, I clicked the WordPress update button idly, and it was updated from 5.0.3 to 5.1. Unexpectedly, there was a problem that the comment reply button failed. I was stunned at the moment, because the computer was not convenient to connect to the Internet, and it was impossible to troubleshoot. As a result, the bug hung up all day=

After a closer look, I found that the problem was due to the update of WP comment-reply-link() The output of the function. The original output reply key has an HTML tag with a onclick Event, bound addComment.moveForm() event, Sakura Theme , and writing Gorgeous Theme Comments and replies all use this onclick Event, and in WP 5.1, this onclick The event has been removed, as shown in the figure, the top is WP 5.1, and the bottom is WP 5.0:

Therefore, the way to fix this problem is to add a click event listener for the reply key. Take the Sakura topic as an example, and use jQuery to implement:

 $('body').on('click', '.comment-reply-link', function(){ addComment.moveForm( "comment-"+$(this).attr('data-commentid'), $(this).attr('data-commentid'), "respond", $(this).attr('data-postid') ); return false;  //  Don't miss this sentence to prevent a tag from jumping });

I think the starting point of the change to WP is very good, because I always feel that the online onclick event is very low (although a lot of 23333 are used in the Sakura topic), but it is not good to suddenly cancel the original interface without warning and explanation. WP should have provided a hook so that we can freely decide whether to retain the original method, right?

Q.E.D.

Appreciation