Advertisements

comment_form_title

Definition:
function comment_form_title( $noreplytext = false, $replytext = false, $linktoparent = TRUE ) {}

Display text based on comment reply status. Only affects users with Javascript disabled.

Parameters

  • string $noreplytext: Optional. Text to display when not replying to a comment.
  • string $replytext: Optional. Text to display when replying to a comment. Accepts “%s” for the author of the comment being replied to.
  • string $linktoparent: Optional. Boolean to control making the author’s name a link to their comment.

Source code

function comment_form_title( $noreplytext = false, $replytext = false, $linktoparent = TRUE ) {

	global $comment;



	if ( false === $noreplytext ) $noreplytext = __( 'Leave a Reply' );

	if ( false === $replytext ) $replytext = __( 'Leave a Reply to %s' );



	$replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0;



	if ( 0 == $replytoid )

		echo $noreplytext;

	else {

		$comment = get_comment($replytoid);

		$author = ( $linktoparent ) ? '<a href="#comment-' . get_comment_ID() . '">' . get_comment_author() . '</a>' : get_comment_author();

		printf( $replytext, $author );

	}

}

689

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: