comment_type() – Display the comment type of the current comment.
You appear to be a bot. Output may be restricted
Description
Displays the comment type of the current comment.
Usage
comment_type( $commenttxt, $trackbacktxt, $pingbacktxt );
Parameters
- $commenttxt
- ( string|false ) optional – Optional. String to display for comment type. Default false.
- $trackbacktxt
- ( string|false ) optional – Optional. String to display for trackback type. Default false.
- $pingbacktxt
- ( string|false ) optional – Optional. String to display for pingback type. Default false.
Returns
void
Source
File name: wordpress/wp-includes/comment-template.php
Lines:
1 to 22 of 22
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; } }