Register Settings API
Add settings to your own theme or plugin. As simple as writing an array. Full documentation at: http://www.wp-load.com/register-settings-api/ Benefits of the plugin Work fine as a plugin OR as included to your theme or plugin. Everything you need is in one single file. No more fighting the settings
About this tool.
Add settings to your own theme or plugin. As simple as writing an array.
Full documentation at: http://www.wp-load.com/register-settings-api/
Benefits of the plugin
- Work fine as a plugin OR as included to your theme or plugin.
- Everything you need is in one single file.
- No more fighting the settings API. Just add your settings and you are done.
- Tinymce, textarea, checkboxes, radio buttons, url, color, email supported.
- It will from the array create a menu and a settings page with tabs and fields.
Full example, placed in functions.php OR your plugin
add_filter('register_settings_api', 'settings_array'); function settings_array( $options_page ) { $options_page['my-menu-slug'] = array( 'menu_title' => 'My menu', 'page_title' => 'My page', 'option_name' => 'my_options_slug', 'tabs' => array( 'first' => array( 'tab_title' => 'My first tab', 'fields' => array( 'my_editor' => array( 'type' => 'tinymce', 'title' => 'My editor' ), 'my_color' => array( 'type' => 'color', 'title' => 'My color' ) ), ), 'second' => array( 'tab_title' => 'My second tab', 'fields' => array( 'my_textarea' => array( 'type' => 'textarea', 'title' => 'My textarea' ) ) ) ) ); return $options_page; }
A closer look.
Getting started.
To use as a plugin:
- 01Upload register-settings-api folder to the /wp-content/plugins/ directory
- 02Activate the plugin through the ‘Plugins’ menu in WordPress
- 03Place the array code (described in another tab) in your functions.php file OR in your plugin
To use as a class:
- 04Upload register-settings-api.php into your theme or plugin and include it
- 05Remove the comment on the top and only keep the class. Else it might belive it’s a plugin
- 06It’s recommended to rename the class, the instance and the class_exists class to prevent collision with other plugins