[wp-trac] Re: [WordPress Trac] #4916: comment_type function doesn't
return the comment type string
WordPress Trac
wp-trac at lists.automattic.com
Thu Sep 6 17:13:38 GMT 2007
#4916: comment_type function doesn't return the comment type string
---------------------------------------+------------------------------------
Reporter: hudatoriq | Owner: hudatoriq
Type: defect | Status: reopened
Priority: normal | Milestone:
Component: General | Version: 2.3
Severity: normal | Resolution:
Keywords: comment reporter-feedback |
---------------------------------------+------------------------------------
Changes (by westi):
* keywords: comment => comment reporter-feedback
Comment:
Can you provide an example of what you are trying to do?
Do we need to add a filter to the output of comment_type to allow you to
translate the generated text?
Maybe something like this:
{{{
function comment_type($commenttxt = 'Comment', $trackbacktxt =
'Trackback', $pingbacktxt = 'Pingback') {
$type = get_comment_type();
switch( $type ) {
case 'trackback' :
$output = $trackbacktxt;
break;
case 'pingback' :
$output = $pingbacktxt;
break;
default :
$output = $commenttxt;
}
echo apply_filters('comment_type',$output);
}
}}}
--
Ticket URL: <http://trac.wordpress.org/ticket/4916#comment:3>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list