Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

no 'says' in comments

By: a guest on Oct 9th, 2011  |  syntax: None  |  size: 0.73 KB  |  views: 951  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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.  
clone this paste RAW Paste Data