jan_dembowski

un-en-dash.php

Feb 13th, 2012
500
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /*
  3. Plugin Name: Un-en-dash the Double Dash
  4. */
  5. add_filter( 'the_content' , 'mh_un_en_dash' , 50 );
  6. add_filter( 'the_title', 'mh_un_en_dash' , 50 );
  7. add_filter( 'the_content', 'mh_un_en_dash' , 50 );
  8. add_filter( 'the_excerpt', 'mh_un_en_dash' , 50 );
  9. add_filter( 'comment_text', 'mh_un_en_dash' , 50 );
  10. add_filter( 'list_cats', 'mh_un_en_dash' , 50 );
  11.  
  12. function mh_un_en_dash( $text ) {
  13.         $content = str_replace( '&#8211;' , '--' , $text );
  14.         return $text;
  15. }
RAW Paste Data