comment_type

Definition:
function comment_type($commenttxt = false, $trackbacktxt = false, $pingbacktxt = false) {}

Display the comment type of the current comment.

Parameters

  • string $commenttxt: The string to display for comment type
  • string $trackbacktxt: The string to display for trackback type
  • string $pingbacktxt: The string to display for pingback type

Source code

function comment_type($commenttxt = false, $trackbacktxt = false, $pingbacktxt = false) {

	if ( false === $commenttxt ) $commenttxt = _x( 'Comment', 'noun' );

	if ( false === $trackbacktxt ) $trackbacktxt = __( 'Trackback' );

	if ( false === $pingbacktxt ) $pingbacktxt = __( 'Pingback' );

	$type = get_comment_type();

	switch( $type ) {

		case 'trackback' :

			echo $trackbacktxt;

			break;

		case 'pingback' :

			echo $pingbacktxt;

			break;

		default :

			echo $commenttxt;

	}

}

707

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 )

Facebook photo

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

Connecting to %s

%d bloggers like this: