I migrated a website from another CMS to wordpress. A problem I am having is that the previous CMS was very liberal with the permalink generated from the page title. For example it would create a link:
and when I recreated the post in wordpress and tried to preserve that address, wordpress would sanitize the slug to look like:
For the sake of not breaking links both internally and externally, I would like to str_replace (or something regex based) on the address coming in to wordpress to remove unwanted characters before it gets passed to the wp_rewrite where it gets properly routed.
I tried var_dump()'ing the $wp_query, but when I bound it to the 'wp_loaded' hook with a very positive priority, the $wp_query['request'] is still NULL, and if I try hooking it to 'parse_request' with a 0 priority it appears that the request has already passed through wp_rewrite.
Is there a global variable where this request is temporarily stored that I could modify during 'init' or something along those lines?
Aucun commentaire:
Enregistrer un commentaire