Register Settings API

Register Settings API Install Statistics

0
100%
Today: 0 Yesterday: 0 All-time: 1,397 downloads
Register Settings API Icon

Try plugin: Register Settings API

We'll create fresh WordPress site with Register Settings API installed. You have 20 minutes to test the plugin after that site we'll be deleted.

Takes ~10 seconds to install.

About Register Settings API

Add settings to your own theme or plugin. As simple as writing an array.

2


0


0


0


0

updated: 9 years ago
since: 9 years ago
author: Jens Törnell

Description

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;
}