diff --git a/src/wp-admin/js/edit-comments.js b/src/wp-admin/js/edit-comments.js
index 9e0fc09602..16a1b405c8 100644
|
a
|
b
|
commentReply = { |
| 580 | 580 | |
| 581 | 581 | $('a.cancel', row).click(function() { return commentReply.revert(); }); |
| 582 | 582 | $('a.save', row).click(function() { return commentReply.send(); }); |
| | 583 | |
| | 584 | // Allow users to use Ctrl/Cmd+Enter to submit comment |
| | 585 | $('#replycontent', editRow).keydown(function (e) { |
| | 586 | if (( e.metaKey || e.ctrlKey ) && e.keyCode == 13) { |
| | 587 | commentReply.send(); |
| | 588 | e.preventDefault(); |
| | 589 | return false; |
| | 590 | } |
| | 591 | }); |
| | 592 | |
| 583 | 593 | $( 'input#author-name, input#author-email, input#author-url', row ).keypress( function( e ) { |
| 584 | 594 | if ( e.which == 13 ) { |
| 585 | 595 | commentReply.send(); |
diff --git a/src/wp-includes/comment-template.php b/src/wp-includes/comment-template.php
index b9b4cae49d..c531dd2be6 100644
|
a
|
b
|
function comment_form( $args = array(), $post_id = null ) { |
| 2215 | 2215 | $fields = apply_filters( 'comment_form_default_fields', $fields ); |
| 2216 | 2216 | $defaults = array( |
| 2217 | 2217 | 'fields' => $fields, |
| 2218 | | 'comment_field' => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label> <textarea id="comment" name="comment" cols="45" rows="8" maxlength="65525" aria-required="true" required="required"></textarea></p>', |
| | 2218 | 'comment_field' => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label> <textarea id="comment" name="comment" cols="45" rows="8" maxlength="65525" aria-required="true" required="required" onkeydown="return addComment.submitForm( event, \'comment\' )"></textarea></p>', |
| 2219 | 2219 | /** This filter is documented in wp-includes/link-template.php */ |
| 2220 | 2220 | 'must_log_in' => '<p class="must-log-in">' . sprintf( |
| 2221 | 2221 | /* translators: %s: login URL */ |
diff --git a/src/wp-includes/js/comment-reply.js b/src/wp-includes/js/comment-reply.js
index 184726d35e..73872a2d32 100644
|
a
|
b
|
|
| 1 | 1 | var addComment = { |
| | 2 | submitForm: function( e, textareaId ) { |
| | 3 | if ( ( e.metaKey || e.ctrlKey ) && e.keyCode == 13 ) { |
| | 4 | var t = this, |
| | 5 | textarea = t.I( textareaId ), |
| | 6 | commentForm = t.I( textarea.form.id ); |
| | 7 | |
| | 8 | document.createElement( 'form' ).submit.call( commentForm ); |
| | 9 | e.preventDefault(); |
| | 10 | return false; |
| | 11 | } |
| | 12 | }, |
| | 13 | |
| 2 | 14 | moveForm: function( commId, parentId, respondId, postId ) { |
| 3 | 15 | var div, element, style, cssHidden, |
| 4 | 16 | t = this, |