comment_type [ WordPress Function ]
comment_type ( $commenttxt = false, $trackbacktxt = false, $pingbacktxt = false )
| Parameters: | |
| 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
- comment_type - WordPress Codex
<?php comment_type('comment', 'trackback', 'pingback'); ?> ... comment_time(), comment_type(), comments_link, comments_number(), comments_popup_link(), ...
codex.wordpress.org - Extend WP 3.0 post_type functionality to comment_type - WordPress
Extend WP 3.0 post_type functionality to comment_type. Joel Member. 12345. The possibilities are limitless. By permitting users to register a new comment type ...
wordpress.org - Wordpress - How to adding a custom comment_type? - Stack Overflow
back again, now on a better keyboard than my phone ;-). as you can see in the official documentation, comment_type is not an attribute you can set ...
stackoverflow.com - comment_{$new_status}_{$comment->comment_type}
WordPress hook directory comment_{$new_status}_{$comment->comment_type} . Important warning about variable hooks. Some hooks have variables in their ...
adambrown.info
Gebruikersdiscussies [ wordpress.org ]
- walkeezy on "How to adding a custom comment_type?"
- regiswordpress on "Custom comment type question"
- stesvis on "Custom comment type question"
- regiswordpress on "Custom comment type question"
- stesvis on "Custom comment type question"
- digitaldickinson on "Adding a custom comment_type with a plugin"
- digitaldickinson on "Adding a custom comment_type with a plugin"