Add full HTML filter to comment_form(), along with an echo arg. props joostdevalk, fixes #12564.

git-svn-id: http://svn.automattic.com/wordpress/trunk@14268 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-04-28 04:28:51 +00:00
parent b8b7d95dd0
commit b8b6090959
1 changed files with 8 additions and 3 deletions

View File

@ -1515,10 +1515,11 @@ function comment_form( $args = array(), $post_id = null ) {
'title_reply_to' => __( 'Leave a Reply to %s' ),
'cancel_reply_link' => __( 'Cancel reply' ),
'label_submit' => __( 'Post Comment' ),
'echo' => true,
);
$args = wp_parse_args( $args, apply_filters( 'comment_form_defaults', $defaults ) );
ob_start();
?>
<?php if ( comments_open() ) : ?>
<?php do_action( 'comment_form_before' ); ?>
@ -1556,8 +1557,12 @@ function comment_form( $args = array(), $post_id = null ) {
<?php do_action( 'comment_form_after' ); ?>
<?php else : ?>
<?php do_action( 'comment_form_comments_closed' ); ?>
<?php endif; ?>
<?php
<?php endif;
$form = apply_filters( 'comment_form_output', ob_get_clean(), $args );
if ( $args['echo'] )
echo $form;
else
return $form;
}
?>