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



comment_type › WordPress Function

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

Displays the comment type of the current comment.



Fonte

function comment_type( $comment_text = false, $trackback_text = false, $pingback_text = false ) {
	if ( false === $comment_text ) {
		$comment_text = _x( 'Comment', 'noun' );
	}
	if ( false === $trackback_text ) {
		$trackback_text = __( 'Trackback' );
	}
	if ( false === $pingback_text ) {
		$pingback_text = __( 'Pingback' );
	}
	$type = get_comment_type();
	switch ( $type ) {
		case 'trackback':
			echo $trackback_text;
			break;
		case 'pingback':
			echo $pingback_text;
			break;
		default:
			echo $comment_text;
	}
}