Summery Summery
Displays the comment type of the current comment.
Syntax Syntax
Parameters Parameters
- $commenttxt
-
(Optional) String to display for comment type.
Default value: false
- $trackbacktxt
-
(Optional) String to display for trackback type.
Default value: false
- $pingbacktxt
-
(Optional) String to display for pingback type.
Default value: false
Source Source
File: wp-includes/comment-template.php
* @since 0.71 * * @param string $commenttxt Optional. String to display for comment type. Default false. * @param string $trackbacktxt Optional. String to display for trackback type. Default false. * @param string $pingbacktxt Optional. String to display for pingback type. Default false. */ 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':
Advertisement
Changelog Changelog
Version | Description |
---|---|
0.71 | Introduced. |