WordPress Settings Framework

Published 26th August 2012

The WordPress Settings Framework aims to take the pain out of creating settings pages for your WordPress plugins by effectively creating a wrapper around the WordPress settings API and making it super simple to create and maintain settings pages. Creating settings pages becomes as easy as:

$wpsf_settings[] = array( 'section_id' => 'general', 'section_title' => 'General Settings', 'section_description' => 'Some intro description about this section.', 'section_order' => 5, 'fields' => array( array( 'id' => 'text', 'title' => 'Text', 'desc' => 'This is a description.', 'type' => 'text', 'std' => 'This is std' ), array( 'id' => 'select', 'title' => 'Select', 'desc' => 'This is a description.', 'type' => 'select', 'std' => 'green', 'choices' => array( 'red' => 'Red', 'green' => 'Green', 'blue' => 'Blue' ) ), // add as many fields as you need... ) );

Then WPSF generates the settings form for you. It would look something like:

WordPress Settings Framework →