I have a strange request, but hopefully it’s doable. I want to be able to have several logos, for my clients, on my site. Depending on what logo they click it takes them to the login page with the username already entered. So, if they click on the “Bob’s Grill” logo, it takes them to the login page with the “Bob’s Grill” username already entered.
Is there any way to do this? Thanks!
There are ways to trick WP into pre-populating the username field, but I’m pretty sure it would involve using POST and also tricking it into thinking there were errors in a previous submission.
My advice would be to just use Javascript (or jQuery, as I’ve done below). It’s still ‘hacky’, but at least it gets the job done with very little overhead and it’s dead easy to use. It adds a little script that checks for the prepopulate URL parameter, and triggers autocompletion if it finds anything.
Then, when creating the links on the logos, simply use something along these lines in your theme’s templates to trigger the script above: