[wp-trac] [WordPress Trac] #4916: comment_type function doesn't return the comment type string

WordPress Trac wp-trac at lists.automattic.com
Mon Mar 12 11:37:16 UTC 2012


#4916: comment_type function doesn't return the comment type string
--------------------------------------+-----------------------------
 Reporter:  hudatoriq                 |       Owner:
     Type:  defect (bug)              |      Status:  assigned
 Priority:  normal                    |   Milestone:  Future Release
Component:  Comments                  |     Version:  2.3
 Severity:  normal                    |  Resolution:
 Keywords:  comment needs-patch i18n  |
--------------------------------------+-----------------------------

Comment (by kobenland):

 Is a core solution even necessary?

 I would have thought Themes hook into the `'get_comment_type'` filter and
 provide their own translation, like this:
 {{{
 #!php
 function theme_slug_get_comment_type( $type ) {
     $comment_types = array(
         'comment' => _x( 'Comment', 'noun', 'theme-slug' ),
         'trackback' =>  __( 'Trackback', 'theme-slug' ),
         'ping' => __( 'Pingback', 'theme-slug' );
     );
     return $comment_types[$type];
 }
 add_filter( 'get_comment_type', 'theme_slug_get_comment_type' );
 }}}

 No?

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/4916#comment:12>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list