What is the best way to add new custom blog settings to the WordPress general settings (or some other settings page for that matter), such that these settings are available to the theme to use?
For example I would like simple settings like the Twitter URL and Facebook Page URL to be configurable, rather than hardcoded in the theme. It would be nice if I could then access them via the bloginfo()
function, but any other function will do just the same.
Here is part of a class I wrote for client recently:
OK, I was evidently looking at the wrong place. The Settings API offers all the functions to register new settings, adding sections, customising the admin settings forms etc.
What isn’t clear from the documentation is how to retrieve those settings when you need them in your theme. If I understood correctly the
get_option()
function does the trick.