• When I create a Category with the slug: “Test1|Test2”, the | is automatically trimmed by wordpress, in a result I’m getting “Test1Test2”.
    Where can I modify the wordpress-code (a php file?) to trim everything except the | character?

    I’m using the xlanguage plugin, and that is an unsolved problem… I need the | to be there. Does anybody know in which file I can allow the character?

    Thanks so much!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The slug is used as part of the category page URL. You can’t have | in a slug because its an illegal character in a URL.

    I just created a category named Test1 | Test2, and WP accepted that name just fine. When creating a slug WP converts non-alphanumeric characters to dashes, and created a slug named test1-test2. All of the characters in that name are valid URL characters.

    Thread Starter check12

    (@check12)

    ok, so the xlanguage plugin needs to manage this…
    a’right, I hope somebody can implement this.

    Hi stvwlf,

    If the tag is named “Test1 | Test2” there is no problem, it generates the slug “test1-test2”. The problem comes when the tag is named “Test1|Test2”, because then the slug generated is “test1test2”.

    If you have any ideas, I’ll appreciate it.

    The function that replaces to dashes is: sanitize_title_with_dashes, which is located in wp-includes/formatting.php

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘category-slug character’ is closed to new replies.