• Resolved assassinbg

    (@assassinbg)


    I’d like to make wordpress convert dots into dashes when creating the url permalink out of a post’s title, e.g. if I have Word1.word2.word3 it should become word1-word2-word3 and not word1word2word3.

    What file do I need to edit?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter assassinbg

    (@assassinbg)

    Wow, I was surprised to find out no one was able to say anything about this topic… ??

    I’m talking about the substitution of characters like ~!@#$%^&*()= etc to dashes in post titles or tags. You see, I was able to find out that this was done through a couple of functions located in the wp-includes/formatting.php file.

    There is wptexturize(); which substitutes these:
    array("'tain't","'twere","'twas","'tis","'twill","'til","'bout","'nuff","'round","'cause");

    and some others.

    There’s also sanitize_title_with_dashes() – the one I believe does all the magic substitutions in post titles. Apparently I draw this conclusion from the function name.

    But now the problems is I can’t find out which part of the function tells it to remove the dots. In fact I get more confused by this line:

    $title = trim($title, '-');

    which is supposed to trim (remove) dashes out of posts. Yet if you make a post with post title word1-word2 the post url remains word1-word2 and the title isn’t trimmed (nor the url).

    I really hope someone could help me out here…

    Thread Starter assassinbg

    (@assassinbg)

    Hey,

    I thought I should let you know I resolved the issue. I added a str_replace() in the function sanitize_title_with_dashes() to replace dots with dashes.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Post urls.’ is closed to new replies.