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

git-svn-id: https://develop.svn.wordpress.org/trunk@14268 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2010-04-28 04:28:51 +00:00
parent 610abdf2a5
commit 54a577c537
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;
}
?>