Skip to content

appristas/peasy-admin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Peasy Admin

An easy-pease API to build custom admin pages

Motivation

The existing Settings API in WP requires us to write lots of callbacks even for the simplest stuff. The reason behind this plugin is to simplify the way admin pages are being created. The plugins abstracts away all the quirks of Settings API and provides an easy to use API for building admin pages.

Installation

You can install this plugin in two ways:

  1. Install the plugin from Wordpress Plugins

  2. To install the plugin using Composer and wpackagist, add the following line to composer.json:

    "wpackagist-plugin/peasy-admin": "^1.2.0"

Getting Started

As the Settings API, Peasy Admin consists of the following elements: AdminPage, Section, and Field. First, let's create an admin page. It is recommended to use peasy_init action to ensure that the page will be generated without worrying about the order of plugins:

add_action( 'peasy_init', function() {
    $admin_page = new PeasyAdmin\AdminPage( 'My Admin Page', 'my-admin-page' );
    $admin_page->setup();
} );

AdminPage class requires title and slug parameters to create the admin page. setup method is needed to transform Peasy API into settings API. Therefore, all the sections and fields must be defined before setup.

Reference

Check out the Wiki for usage, examples, and API reference.

Contributing

This project adheres to the Open Code of Conduct. By participating, you are expected to honor this code.

Bugs

If you have encountered a bug, please use Github Issues to submit a an issue.

Submitting a Pull Request

Before submitting pull request please conform to Wordpress PHP Coding Standards. Naming class names and file names are an exception to these guidelines until we can find a better solution.

  1. Fork this repository
  2. Create a new branch from master
  3. Commit your changes
  4. Push to the newly created branch
  5. Submit a pull request
  6. Sit back, relax, and wait for a response 😃

License

This project is licensed under GPLv3. Please read the LICENSE file for details.

About

An easy-pease API to build custom admin pages

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors