Just a warning here, consider the following situation:
- Multilingual site(whichever plugin).
- Multiple languages, each with it's own translation file(therefore each
one declaring it's own slug for your post type).
- The user regenerates the permalinks by going to Settings > Permalinks.
Only the permalinks with the currently active language's slug are
regenerated. All translation permalinks are not.
- You go to the front-end and visit the site in a different language. Your
links now use the correct slug for that language, but they end-up in 404's.
I know that ultimately it's great to be able to have different slugs for
each language, but it's really difficult to do so.
A different approach that I can suggest is to use a plugin option to set
the slug(from a settings page). This way, the slug can still be changed and
if anyone else is trying to create multiple rewrite rules for your
plugin(for each language for instance), they are still able to do so.
While working on my own multilingual plugin, I came across that situation -
I wanted to let the user define a unique slug for each language - in the
end it mostly worked, but with a lot of hacking.
So, my advice is - make the slug dynamic via a plugin option and that's it.
Post by Nicholas CiskeYou probably want to run it through sanitize_title before you attempt to
use it... lest a wily translator blow up your permalinks ;-)
http://codex.wordpress.org/Function_Reference/sanitize_title
_________________________
Nick Ciske
http://thoughtrefinery.com/
@nciske
Post by Tom BarrettHello
What is the best way to allow the of a custom post type to change via
translation.
'rewrite' => array( 'slug' => __( 'glossary', WPG_TEXTDOMAIN ) ),
Is that good?
Thanks!
--
http://www.tcbarrett.com | http://gplus.to/tcbarrett |
http://twitter.com/tcbarrett
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers