• In order to stop Word Press from converting double dashes into single dashes I changed my wordpress/wp-includes/formatting.php file according to a suggestion made by several users.

    But upgraded to 3.3 has changed them all back and repeating the fix has no effect. Can anyone offer help?

    Thanks,

    Muntrem

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    I changed my wordpress/wp-includes/formatting.php

    Aaaand that’s all she wrote.

    Let that be a lesson to you, young man, don’t modify core files that ship with the WordPress distribution!

    There’s much easier ways to filter content. Try this solution that I just tested on my crash test dummy.

    In your wp-content/plugins directory create a file called un-double-dash.php and paste in this code.

    <?php
    /*
    Plugin Name: Un-double the dash
    */
    
    add_filter( 'the_content' , 'mh_double_dash' , 99 );
    function mh_double_dash( $text ) {
            return str_replace( '& #8211;', '--', $text );
    }

    See that & #8211; delete the space between the & and the #.

    Activate that new plugin and enjoy the double dash not being converted.

    That will apply to the_content but it can be applied to the_excerpt, etc. too.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Note: Just to be clear, the “Let that be a lesson to you, young man” part was an attempt at humor. I don’t think the original poster is a young man or needs admonishment. ??

    In seriousness, please don’t edit the core files. There is usually an easy way to accomplish something like this and the plugin I describe above will unconvert the – back to double dashes.

    Thread Starter muntrem

    (@muntrem)

    I got the joke. And this was super helpful. Thanks Jan.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Upgrade to 3.3 ruins Double Dash fix’ is closed to new replies.