Last active
December 14, 2015 23:59
-
-
Save jameskoster/5169535 to your computer and use it in GitHub Desktop.
WordPress - Move the textarea to the top of the comment form
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
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