A simple framework for Wordpress' Settings API
JavaScript PHP CSS
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


WP Simple Settings Framework

A minimalistic framework for Wordpress Settings API.

Quick start


  1. Include the framework in your Wordpress plugin by using:

    add_action( 'init', 'sf_load_settings' );
    function sf_load_settings() {
        require 'classes/sf-class-settings.php';
        $settings_framework = new SF_Settings_API($id = 'my_plugin_name', $title = 'My Plugin Title', $menu = 'plugins.php', __FILE__);

    Optionally, you might want to make $settings_framework a global variable so that you can use the helper functions.

  2. Open sf-options.php to begin configuring your options.


Automatic settings page

Don't want it under the Plugins tab like in the screenshot? No problem, you can choose where you want it!

You can also change "Simple Settings" submenu to be anything you'd like.

settings page example


tooltips example

Optional tooltips using Twitter Bootstrap!

Select box replacement

select box replacement

Utilizing Select2 to display select boxes. It's pretty cool!

Multiple tabs

multiple tabs example

Create multiple tabs for your options.

Input types

  • Text
  • Number
  • Textarea
  • Checkbox
  • Radio
  • Select
  • WP Pages


Update or add a new option

$settings_framework->update_option('your_option', 'new_value');

Get an existing option's value


Example configuration

Check out the example config for an idea of how to use every input type.

Here's an example of one type, though:

$options[] = array(
    'name' => __( 'Name', 'geczy' ),
    'desc' => __( 'Please tell me who you are.', 'geczy' ),
    'id'   => 'text_sample',
    'type' => 'text',

Bug tracker

Have a bug? Please create an issue here on GitHub!


Copyright and License

Copyright 2012 Matthew Gates

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the names of the copyright holders nor the names of the contributors may be used to endorse or promote products derived from this software without specific prior written permission.