Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




comment_type [ WordPress Function ]

comment_type ( $commenttxt = false, $trackbacktxt = false, $pingbacktxt = false )
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
Defined at:



Display the comment type of the current comment.

Source


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

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics