Skip to content

Instantly share code, notes, and snippets.

@jameskoster
Last active December 14, 2015 23:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jameskoster/5169535 to your computer and use it in GitHub Desktop.
Save jameskoster/5169535 to your computer and use it in GitHub Desktop.
WordPress - Move the textarea to the top of the comment form
function jk_move_textarea( $input = array () ) {
static $textarea = '';
if ( 'comment_form_defaults' === current_filter() ) {
$textarea = $input['comment_field'];
$input['comment_field'] = '';
return $input;
}
if ( is_singular( 'post' ) || is_page() ) {
print $textarea;
}
}
add_action( 'comment_form_defaults', 'jk_move_textarea' );
add_action( 'comment_form_top', 'jk_move_textarea' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment