[wp-hackers] Slug from titles

Barrett Golding bg at hearingvoices.com
Fri Jan 13 15:16:15 UTC 2012


thanks to this list for the help w/ language explaining unique slugs,
for  an upcoming Docs page on Naming Slugs.

now requesting help explaining how slugs come from titles,
esp. re: what chars are/aren't allowed in slugs. have this so far...

-------
WordPress makes a slug from the post's title. Slugs use only lowercase alphanumeric characters, underscore, and dash ([a-z], [0-9], [_], [-]). To generate a slug from a title WordPress:
* Converts accented letters to their unaccented equivalents.
* Converts uppercase letters to lowercase.
* Removes punctuation and symbols, except underscore and dash.
* Replaces whitespace(s) with a dash.
* Removes leading or trailing dash.

If this were the (admittedly awkward) post title:
Here's Lookin' @ You, Niño #casablanca 1942-11_26 :-)

This would be the WordPress-generated slug:
heres-lookin-you-nino-casablanca-1942-11_26
-------

thanks,
bg
-- 
<http://HearingVoices.com/>
~radio active transmissions~



More information about the wp-hackers mailing list