Disable double hyphen to dash wordpress replacements

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!

 
 
» You might also be interested in the following articles:
FAQ: How to disable directory browsing in apache/httpd?
The fastest way to disable PC speaker in Ubuntu
Fun: Bill Gates recommends Ubuntu :)
Funny aptitude trick in Ubuntu and Debian…
FAQ: How to disable/remap a keyboard key in Linux?



» Want to stay up to date? Subscribe to our E-MAIL or RSS feed!

8 Responses to “Disable double hyphen to dash wordpress replacements”


  1. 1 RulemaN
  2. 2 Keshavaya

    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.

  3. 3 Joyce

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

  1. 1 La otra bola de cristal -
  2. 2 RulemaN
  3. 3 Monotone Monologue 2.6.3
  4. 4 Desactivar el reemplazo de dobles guiones por uno solo en Wordpress « cablop.net Software Tips
  5. 5 cablop.net – Software Tips » Desactivar el reemplazo de dobles guiones por uno solo en Wordpress

Leave a Reply




Friendly Sites:Who is behind Linux Screw?
Aspiring Sysadmin | GeekyBits³ | Bash Cures Cancer | TOTMS
Linux Operating System | Small Linux Deployments | My SysAd Blog
The Danesh Project | ZEPY | Linux config Wiki | Planet Sysadmin
The Sys Admin | {buhay sysad} | a non-geek's linux notes
Linux HOWTOs, Tutorials & Projects with Adam Palmer | LinuxAlt.Com
My name is Artem Nosulchik (artiomix AT gmail DOT com) and I'm Linux/Unix, Cisco systems engineer. The main idea of Linux Screw is to share relevant knowledge, skills and observations over The Web. Here you can find a lot of information related to different Linux distributions, FreeBSD, IOS as well as a other Open Source around staff. Read more ››