I am trying to pass an email address to a wordpress page like so:
http://www.website.com/?email=fakeemail@yeahwho.com
However, WordPress turns it into this:
http://www.website.com/?email=fakeemailyeahwho.com
I even try URL encoding it like so:
http://www.website.com/?email=fakeemail%40yeahwho.com
But WordPress is too smart and still removes the %40.
I understand that @ is a reserved character, but I should be able to still use the URL encoded version. Alas, WordPress does not want it to be so.
How can I force WordPress to respect the @ sign? I’m guessing I’ll either have to hack the internals, or do some mod_rewrite magic.
from http://www.webopius.com/content/137/using-custom-url-parameters-in-wordpress
First, add this to your theme’s functions.php file (or make a custom plugin to do it):
Next, try passing
?email=fakeemail-AT-yeahwho.comin the URL and then converting it back with something like this:This would only not work in the very rare occurrence of an email that actually has “-at-” in it. You could replace for an even more obscure string like ‘-AT6574892654738-‘ if you are concerned about this.
Whatever your final solution, don’t hack the core to get it to work. 🙂