User-defined accesskeys
This site enables users to define their own accesskeys. The PHP script that does the work comes courtesy of Dan Champion at Blether. Dan’s article on how to use the script is fairly straight-foward except that when combined with a Wordpress site, a couple of modifications are required.
The script contains a few functions and for these to work correctly on a Wordpress site, the script needs to be added to the plugins folder and ‘activated’ from within your Wordpress admin.
The script also contains a section which receives the values sent from the form that is filled out, takes the values and assigns them to a cookie and then redirects the browser back to the Accesskey assignment page.
Dan’s script uses $_SERVER['PHP_SELF'] for both the action of the form and the header redirection but because of the mod_rewrite rules for URLs on this site, the script required the URL to be hard-coded instead of using $_SERVER['PHP_SELF']. It also required the first piece of the script that accepts the post values, sets the cookie and does the redirection to be taken out of the plugin script and placed outside the Wordpress structure.
I already had a script that handles the content negotiation for the site and which gets executed before the Wordpress header gets called, so I put it in there.
I’m not sure if any other Wordpress users will find this useful but I thought I’d document how I’d gone about it anyway.
Browse by tags:
Subscribe to this site for regular updates
3 responses to User-defined accesskeys. Add your own.















Sounds like a good implementation, any chance of sharing the plugin for others? I realise this is rather old now, but I had recently decided to write such a thing for Wordpress myself!
Hi Rich,
I’ve uploaded a zip containing the files I created from Dan’s original script.
Dan’s script was all in one file but I needed to split it up: there’s a plugin file which you need to upload to your plugins directory and activate and then there’s an include file which needs to sit in the root of your WP installation which you then call into header.php in your theme.
You might need to edit the HTML in the plugin file to suit your own purposes.
excellent, thanks for that. I’ll work with it and see if I can remove the need for that extra file out side of the plugin.
I’ll let you know how I get on.