It took me longer than it should have to figure out the WordPress Settings API, largely because there are certain parameter names that must match if things are to work properly. However, after making good use of the Google and studying the WordPress Codex extensively, I finally figured it out.

Two really helpful tutorials were:

Otto’s tutorial is from 2009, and Konstantin’s is from 2012, but they are still valid—they got me up and running. However, they are not copy/paste—you need to actually understand what all those bits of code are doing.

Because I couldn’t find a place where all those different bits of code were set out next to each other and which clearly showed which settings needed to match, I created a cheat sheet for the Settings API that does exactly that:

Settings_API_cheatsheet

Because I’m a color-coding kind of person, I also made sure that anything that needs to match is in the same color. Neat, huh?

Downloads:

Download this as a pdf here.

I am far from an expert in the WordPress Settings API, so if you spot errors, let me know in the comments. Also, if you can think of a way this can be improved, drop a comment. Thanks.

© 2017 Kenneth John OdlePermalink for this article:
http://techblog.kjodle.net/2015/07/16/wordpress-settings-api-cheat-sheet/