WordPress.org

Ready to get started?Download WordPress

Forums

[Req] better accents conversion in permalinks (6 posts)

  1. Ozh
    Member
    Posted 10 years ago #

    I have a post entitled "Je déteste Paris" (note the accent)
    The resulting permalink is /2004/05/06/je-dteste-paris/ which doesnt make sense. Accent letters (not sure how to call them) should be converted into "non accent" letters, instead of being simply removed. /je-deteste-paris/ is perfectly understandable.
    So, "é" should be converted into "e", "à" into "a", and so on (I can provide a full list if necessary)
    Thanks

  2. fbdp
    Member
    Posted 10 years ago #

    This problem seems to be fixed in 1.2b. (?)
    In previous versions, I used to put this function inside my my-hacks.php file:

    function removeaccents($string) {
    return strtr($string, "ŠšŸÀ�ÂÃÄÅÆÇÈÉÊËÌ�Î�ÑÒÓ�ÕÖÙÚÛÜ�àáâãäåæçèéêëìíîïñòóôõöùúûüý", "SsYAAAAAAACEEEEIIIINOOOOOUUUUYaaaaaaaceeeeiiiinooooouuuuy");
    }

    And in /wp-includes/functions.php add this line in function satinize_title:

    $title = removeaccents($title);

    after

    $title = preg_replace('/&.+;/', '', $title); // kill entities

    This worked for me. Hope it helps. If not, post again.

  3. fbdp
    Member
    Posted 10 years ago #

    WP 1.2b has the same issue... You can use the same procedure above. You will find the function sanitize_title inside /wp-includes/functions-formatting.php

  4. Ozh
    Member
    Posted 10 years ago #

    great, thanks :)

  5. fbdp
    Member
    Posted 10 years ago #

    I'd really like to see this built-in on WP. Any chance?

  6. fbdp
    Member
    Posted 10 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.