Uma área de pesquisa sobre o WordPress para devs e autores do tema



comment_type ›

Desde0.71
Obsoleton/a
comment_type ( $commenttxt = false, $trackbacktxt = false, $pingbacktxt = false )
Parâmetros: (3)
  • (string) $commenttxt Optional. String to display for comment type. Default false.
    Required: No
    Padrão: false
  • (string) $trackbacktxt Optional. String to display for trackback type. Default false.
    Required: No
    Padrão: false
  • (string) $pingbacktxt Optional. String to display for pingback type. Default false.
    Required: No
    Padrão: false
Definido em:
Codex:

Display the comment type of the current comment.



Fonte

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;
	}
}