New theme customiser
Published June 5th, 2012 under Plugins
I’ve been receiving a few requests for information on how the new theme customiser built into WordPress 3.4 works. Otto has made a great tutorial explaining the basics, so I’m not going to go into that here. What I am going to provide though is a plugin which demonstrates how to extend the theme customiser built into the default Twenty Eleven theme in WordPress 3.4. The plugin doesn’t do a lot, it simply adds an extra option into the customiser which allows you to change the background colour of your pages. You can use the same techniques employed in this plugin to edit all sorts of things. I’ve intentionally kept things as simple as possible to make it clear how everything works.
When adding new functionality via this route, make sure that you understand how the validation system works as you could inadvertently introduce security flaws if you start passing insecure data through it unchecked. In a nutshell: insecure data comes in as $input, only sanitized data is sent out as $output.
Happy customising 🙂