Created
October 21, 2020 12:50
-
-
Save mahdiyazdani/347ba175084888d323dfcf4548184460 to your computer and use it in GitHub Desktop.
Move the comment text field to the bottom
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Move the comment text field to the bottom. | |
* | |
* @see https://developer.wordpress.org/reference/hooks/comment_form_fields/ | |
* @param array $fields The comment fields. | |
* @return array | |
*/ | |
function prefix_move_comment_field_to_bottom( $fields ) { | |
$comment_field = $fields['comment']; | |
unset( $fields['comment'] ); | |
$fields['comment'] = $comment_field; | |
return $fields; | |
} | |
add_filter( 'comment_form_fields', 'prefix_move_comment_field_to_bottom' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment