Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

FmiKL/wp-options-page

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
24 Commits
 
 
 
 
 
 
 
 

Repository files navigation

WordPress Options Page

A lightweight PHP class for creating custom options pages in the WordPress admin area.

Features

  • Text, email, url, number, color, checkbox, textarea, select fields
  • Group fields into sections
  • Media library integration via placeholder keywords
  • Automatic image size selection
  • Built-in sanitization per field type

Setup

require_once 'path/to/wp-options-page/class-option-page.php';

Usage

$option = new Option_Page( 'Site Settings', 'site_settings' );

$option->add_section( 'general', 'General' );

$option->add_field( 'text', 'site_tagline', array( 'label' => 'Tagline', 'section' => 'general' ) );
$option->add_field( 'color', 'brand_color', array( 'label' => 'Brand color', 'section' => 'general' ) );

$option->add_field( 'email', 'contact_email', array( 'label' => 'Email' ) );
$option->add_field( 'select', 'layout', array( 'label' => 'Layout', 'choices' => array( 'grid', 'list' ) ) );

License

GPL v2

About

A lightweight PHP class for creating custom options pages in the WordPress admin area.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Morty Proxy This is a proxified and sanitized view of the page, visit original site.