wordpress logoAs we know latest wordpress.org blog publishing system includes feature that allows to replace double hyphens into single dash: — into — or –. It’s rather trivial issue but Linux Screw blog contains a lot of shell code examples like sudo apt-get remove mc --purge and I was wondering how to disable it for a long time :)

To disable this you should edit /wp-includes/formatting.php:

  • to disable only replacement — into —, just remove ‘–’ and ‘ — ‘ from the following line:
    $static_characters = array_merge(array('---', ' -- ', '--', 'xn–', '...', '``', '\'s', '\'\'', ' (tm)'), $cockney);
    and remove second and third elements from:
    $static_replacements = array_merge(... line.
  • to disable any characters replacements made by wordpress you can comment the following lines:
    $curl = str_replace($static_characters, $static_replacements, $curl);
    $curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl);
    In other words, after commenting they should look like:
    //$curl = str_replace($static_characters, $static_replacements, $curl);
    //$curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl);

Hope it helps!

 

22 Comments

 

  1. Pingback : La otra bola de cristal -

  2. Pingback : RulemaN

  3. Pingback : Monotone Monologue 2.6.3

  4. April 6, 2009  6:12 pm by Keshavaya Reply

    Hi there, I found your blog via Google while searching for first aid for a heart attack and your post looks very interesting for me.

  5. Pingback : Desactivar el reemplazo de dobles guiones por uno solo en Wordpress « cablop.net Software Tips

  6. Pingback : cablop.net – Software Tips » Desactivar el reemplazo de dobles guiones por uno solo en Wordpress

  7. August 30, 2009  11:46 pm by Joyce Reply

    Nice write up...usually I never reply to these thing but this time I will,Thanks for the great info.

  8. June 14, 2010  9:44 am by Chuck Ciolli Reply

    Another Fantastic write up, I will bookmark this in my Newsvine account. Have a good evening.

  9. Pingback : WordPress: Doppeltes Minus und andere Ersetzungsgemeinheiten | Patrick Heina

  10. October 30, 2010  5:38 am by Quick Facts Reply

    You you should edit the webpage subject title Disable double hyphen to dash wordpress replacements - Linux * Screw to something more suited for your webpage you create. I liked the blog post nevertheless.

  11. Pingback : = bubbalog = » ??????? ?? ???????????? ?? ???????? ??????

  12. March 17, 2011  3:58 am by Vincent S Reply

    Nice trick - I actually had been playing with something similar, but was trying to figure a way to do it with HTML code (like for special characters, etc.)

  13. May 4, 2011  9:22 pm by tv shack Reply

    Great – I should certainly say I'm impressed with your blog. I had no trouble navigating through all the tabs and related info. It ended up being truly easy to access. Good job...

  14. January 28, 2012  2:24 am by wdwd85 Reply

    ?????? ??????????????, , ????? ??????! ?? ?????? ????? ?? webdeep.ru.

Leave a reply

 

Your email address will not be published.