Skip to content

Based on the WordPress Settings API, this class generates options pages. It supports all basic input types, selects and all, but also media uploads, which is quite neat.

Notifications You must be signed in to change notification settings

WebMaestroFr/wm-settings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Synopsis

Based on the WordPress Settings API, a class to generate options pages. Create settings forms with all basic input types, selects, textareas and media uploads.

Basic Example

// Define the page
$my_page = create_settings_page(
  'my_page_id',
  __( 'My Page' ),
  array(
    'title' => __( 'My Menu' )
  ),
  array(
    'my_setting_id' => array(
      'title'       => __( 'My Setting' ),
      'description' => __( 'This is my section description.' ),
      'fields'      => array(
        'my_option_name' => array(
          'label'        => __( 'My Option' ),
          'description'  => __( 'This is my field description.' )
        )
      )
    )
  )
);

// Access the values
$my_value = get_setting( 'my_setting_id', 'my_option_name' );

Motivation

Settings are really useful to provide an easy configuration of themes and plugins to our users within their administration panel. But the creation of options pages often ends up in a messy and repetitive use of the great WordPress Settings API.

Considering generic form fields, this is a class to clean and simplify the process. It’s something light that shall be used on the admin side.

Installation

  1. Download the last release
  2. Unzip it into your theme or plugin
  3. require_once( 'path/to/wm-settings/plugin.php' );

Documentation

Read the documentation.

Contributors

If you are interested by this project, please feel free to contribute in any way you like.

You can contact @WebmaestroFR on twitter.

License

WTFPL – Do What the Fuck You Want to Public License

About

Based on the WordPress Settings API, this class generates options pages. It supports all basic input types, selects and all, but also media uploads, which is quite neat.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published