• Stars
    star
    467
  • Rank 93,935 (Top 2 %)
  • Language
    PHP
  • Created over 12 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A PHP class abstraction that removes all the headaches of the WordPress settings API under the hood and builds a nice options panel on the fly.

What is this?

It's a PHP class wrapper for handling WordPress Settings API. Gives a very handy way to build theme or plugins option panel.

Package Installation (via Composer)

To install this package, edit your composer.json file:

{
    "require": {
        "tareq1988/wordpress-settings-api-class": "dev-master"
    }
}

Now run:

$ composer install

Usage Example

Checkout the examples folder for OOP and procedural example. They were called in plugin.php file.

A detailed tutorial can be found here.

Retrieving saved options

/**
 * Get the value of a settings field
 *
 * @param string $option settings field name
 * @param string $section the section name this field belongs to
 * @param string $default default text if it's not found
 *
 * @return mixed
 */
function prefix_get_option( $option, $section, $default = '' ) {

    $options = get_option( $section );

    if ( isset( $options[$option] ) ) {
        return $options[$option];
    }

    return $default;
}

Screenshot

Option Panel

Frequently Asked Questions

What this plugin for?

It's mainly a plugin that demonstrates the Settings API PHP class

Whats the facility?

A plugin or theme developer can build their options panel with Settings API easily

What is Settings API ?

Settings API is a functionality from WordPress that helps developers to save their options data very easily and securely. More about Settings API.

Changelog:

v1.3 (27 September, 2016)
------------------------
- [new] Placeholder support for text and textarea input
- [new] min, max and step support for number field
- [fix] Empty multicheck saving warning
- [improved] Don't show the navigation if only one section exists

v1.1 (23 April, 2015)
------------------------
- [new] Folder structure updated
- [new] composer support added
- [new] Number field added
- [new] URL field added
- [improved] wysiwyg field responsive support. Allow to pass options to wp_editor
- [new] WP Media uploader added

v1.0 (16 July, 2014)
------------------------
- [new] color, password and wysiwyg example added on plugin settings
- [new] Color Picker added
- [improved] Allow to set description for section
- Some other old fixes ;)

More Repositories

1

wp-eloquent

Eloquent ORM for WordPress
PHP
567
star
2

wedocs

A documentation theme for WordPress
PHP
390
star
3

vue-wp-starter

A WordPress Vue.js starter plugin
PHP
301
star
4

wp-backbone

A backbone.js powered WordPress theme
CSS
142
star
5

wp-generators

Some useful WordPress generators
PHP
117
star
6

fb-group-to-wp

Import posts from facebook groups into WordPress
PHP
66
star
7

vue-wp-list-table-component

WordPress List Table component for Vue.js
Vue
60
star
8

woocommerce-bkash

bKash Payment Gateway for WooCommerce
PHP
60
star
9

wedevs-academy

A demo plugin for WordPress tutorial
55
star
10

wp-recaptcha-integration

WordPress reCaptcha integration supporting Ninja Forms and Contact Form 7
PHP
50
star
11

wp-readme-generator

WordPress readme generator
HTML
44
star
12

_bootstraps

A WordPress starter theme based on underscores (_s) from Automattic and bootstrap from twitter.
CSS
37
star
13

bangla-date

Bangla date php class
PHP
33
star
14

wp-php-cs-fixer

WordPress fixers and rules for php-cs-fixer
PHP
31
star
15

wp-docker

A simple opinionated PHP 7.2 Docker & Compose Environment for WordPress
Makefile
29
star
16

meetup

Create local meetup events
PHP
26
star
17

wp-db-backup

WordPress Database Backup CLI Tool
Shell
25
star
18

we-gallery

A very simple gallery plugin for WordPress
JavaScript
20
star
19

wp-react-hmr-demo

A demo WordPress plugin built with React with hot module replacement support.
JavaScript
17
star
20

wp-notification-center

A notification center plugin for WordPress
PHP
14
star
21

wedevs-favorite-post

Yet another favorite post plugin for WordPress
PHP
14
star
22

wp-keyboard-nav

Gmail style keyboard navigation for WordPress
PHP
11
star
23

imdb-post-ratings

A post rating plugin that acts like IMDB post rating
PHP
10
star
24

mailhog-for-wp

MailHog for WordPress
PHP
9
star
25

vue-lumen-starter

Vue frontend app powered by Lumen Framework
Vue
9
star
26

outdated-browser

A WordPress plugin implementation of http://outdatedbrowser.com
PHP
9
star
27

Base-WP-Plugin

PHP
9
star
28

wp-static-api

PHP
8
star
29

ideone-compiler

An ajax remote compiler with IDE One
PHP
8
star
30

plugin-tutorial

This repository will contain codes from the plugin video tutorial series in Bangla
PHP
8
star
31

facebook-account-kit

Facebook Account Kit integration for WordPress
PHP
7
star
32

bbpress-reports

Data driven bbPress forum reporting
PHP
7
star
33

joomla-to-wordpress

A PHP script to convert Joomla site to WordPress
PHP
7
star
34

camptix-bd-payments

Bangladeshi payment gateways for CampTix
PHP
7
star
35

User-Login-Stat

A WordPress plugin that tracks the daily count of registered user login in the site
PHP
6
star
36

vue-ant-admin

A starter Vue admin panel built on Ant Design
Vue
5
star
37

bbpress-reply-by-email-mandrill

Send bbPress replies via Mandrill inbound mail
PHP
5
star
38

laravel-docker

Docker dev environment for Laravel
PHP
5
star
39

object-cache-demo

A demo plugin to demonstrate persistent object caching with WordPress
PHP
5
star
40

clean

clean wp theme
CSS
4
star
41

wp-cli-fb-user-export

Export your users for facebook custom audience
PHP
4
star
42

lumen-starter

Lumen framework starter app
PHP
4
star
43

commenter-email

A WordPress plugin to send email to post commenters
PHP
4
star
44

slate

A clean documentation theme for WordPress
CSS
3
star
45

bbpress-adminbar-notify

A facebook like notification plugin for bbPress
PHP
3
star
46

forge-utils

Utility script to backup and restore WordPress sites in Laravel Forge
Shell
3
star
47

WP-Uploadify

A WordPress plugin that uses uploadify to upload a new attachment from the frontend and adds it as a media attachment
PHP
3
star
48

woo-customers-by-product-purchase

Find customers by product purchase
PHP
3
star
49

wp-cli-maintenance-mode

Put your site into maintenance mode with wp-cli
PHP
3
star
50

kube-test

JavaScript
2
star
51

bbpress-bulk-unsubsribe

Unsubscribe from forum subscriptions at once
PHP
2
star
52

pun-post-like

A punBB extension that creates a internel like system just like as facebook
PHP
2
star
53

github-utils

PHP
2
star
54

tareq1988

2
star
55

bbpress-block-user

Block user in bbPress from creating new topics and replies
PHP
2
star
56

punbb-google-transliteration

A punBB extension that enables writing in the post area with google transliteration
JavaScript
2
star
57

rapportive-php

A nifty way to fetch user information from Rapportive
PHP
2
star
58

fb-homepage-cleaner

A Greasemoneky Scirpt that removes user shared images and hide *people you may know* section from facebook homepage.
JavaScript
1
star
59

We-Miss-You

A punBB extension to send miss you E-mail to the inactive users
PHP
1
star
60

wp-balsamiq-symbols

A symbol library for balsamiq mockups for WordPress
1
star
61

pun-share

A punBB extension to share posts/topics to twitter and facebook
JavaScript
1
star
62

Flash-Grabber

A bash script to grab the cached flash files from a linux machine
Shell
1
star
63

PunBB---Bangla-Date-

A Bangla Date extension for punBB forum engine
PHP
1
star
64

ADB-Push

It's a very simple Linux bash script that transfers your files to your Android device via ADB
Shell
1
star
65

textarea-resizer

A punBB extension that enables the post textarea resizable
1
star
66

aloashbei

A PHP Class to send SMS and retrieve phone location with ease.
PHP
1
star
67

Netbeans-WordPress-Template

Netbeans code template for WordPress for autocompletion the codes
1
star