PHP Class for Generating WordPress Option Page

I’ve created a PHP class that uses multidimensional, associative arrays to generate WordPress option pages.

It makes my work a lot faster by removing all the setup and callbacks for generating the fields. It includes most of the major field types with quite a few options. I’ve also posted it on GitHub for everyone to enjoy.

Here’s an example of just how easy it is:

  • Download or clone the files into your plugin or theme folder
  • include the class file in your plugin’s root file or your theme’s functions.php file
  • Pass an array of pages, subpages, sections and fields to the pages() method

It’s easier than it sounds. Below I’ve included an example.

See? Easy. Now get over to GitHub, clone it and start creating options.