This article covers the benefits of the Settings API, how to use it to create admin options pages, and how to keep your sanity despite its oddities. My last article walked through making a WordPress admin options page: one of the numerous pages in wp-admin that allow you, the site administrator, to change anything from your site’s color scheme to which Twitter feed a widget pulls from, and which you’re likely to find yourself making in the process of building either a plugin or theme. In that article, I mentioned that I’m not a big fan of the default way you create these pages: the WordPress Settings API. My main complaints are as follows: It’s made up of lots of functions which take huge numbers of parameters. The order of those parameters often feels counterintuitive and easy to forget. All this complexity is being introduced to solve real, but not giant, problems with the other possible ways you can make an admin options page in WordPress. However, if I’m honest, I’m probably exaggerating the pain and undervaluing the benefits of the Settings API. There’s a lot that’s good about it, especially if you’re willing to put in the time to make sense of it. Here, we’ll cover its benefits,
Share This