SHARE
TWEET

no 'says' in comments

a guest Oct 9th, 2011 1,674 Never
  1. /* remove/change 'says' in comments // alchymyth 2011 */
  2. class Comment_Says_Custom_Text_Wrangler {
  3.         function comment_says_text($translation, $text, $domain) {
  4.         $new_says = ''; //whatever you want to have instead of 'says' in comments
  5.     $translations = &get_translations_for_domain( $domain );
  6.     if ( $text == '<cite class="fn">%s</cite> <span class="says">says:</span>' ) {
  7.            if($new_says) $new_says = ' '.$new_says; //compensate for the space character
  8.        return $translations->translate( '<cite class="fn">%s</cite><span class="says">'.$new_says.':</span>' );
  9.      } else {
  10.     return $translation; // standard text
  11.          }  
  12.         }
  13. }
  14. add_filter('gettext', array('Comment_Says_Custom_Text_Wrangler', 'comment_says_text'), 10, 4);
  15.  
RAW Paste Data
Top