https://github.com/sujin2f/wp_express
Quick Wordpress Development Module
https://github.com/sujin2f/wp_express
wordpress wordpress-development
Last synced: 5 months ago
JSON representation
Quick Wordpress Development Module
- Host: GitHub
- URL: https://github.com/sujin2f/wp_express
- Owner: sujin2f
- License: apache-2.0
- Created: 2016-03-08T18:50:22.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T05:51:09.000Z (over 3 years ago)
- Last Synced: 2025-08-16T16:34:24.917Z (11 months ago)
- Topics: wordpress, wordpress-development
- Language: PHP
- Size: 17.9 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 29
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WordPress Express
[](https://travis-ci.org/sujin2f/wp_express)
[](https://coveralls.io/github/sujin2f/wp_express?branch=master)
Quick Wordpress Development Module which helps you to make new admin pages, custom post types, and taxonomies.
## Initialize
Include autoload.php, and you are ready.
```php
include_once( $your_path_to . '/wp_express/autoload.php' );
```
## Usage
```php
use Sujin\Wordpress\WP_Express\Admin;
use Sujin\Wordpress\WP_Express\Settings_Section;
use Sujin\Wordpress\WP_Express\Fields\Settings\Input;
// Create a new admin page in the root of admin menu
$admin_page_root = Admin::get_instance( 'Admin Root');
// Change position by position id
$admin_page_root->position( 200 );
// Create another admin page under $test_admin_page_1
$admin_page_child = Admin::get_instance( 'Admin Child' )
->position( $root );
// Change position under Settings
$admin_page_child->position( 'settings' );
// Change position under other menu
$admin_page_child->position( 'Plugin Name' );
// Add a link in the Plugins list
$admin_page_child->plugin( 'Akismet' );
// Set menu icon (use WP Dashicons)
$admin_page_child->icon( 'dashicons-buddicons-activity' );
// Create a new setttings section (default location is settings page)
$settings_section = Settings_Section::get_instance( 'Settings Section' );
// Append the settings section into the admin page
$admin_page_child->append( $settings_section );
// Create a new settting field `headline`
$headline = Input::get_instance( 'Headline' );
// Append the input into the settings section
$settings_section->append( $headline );
// Change the input type to date
$headline->type( 'date' );
// Change the input to the multiple value
$headline->single( false );
// Settngs could be the chaining assignment
$headline
->show_in_rest( true )
->single( true )
->append_to( $settings_section );
```
This is the example of creating a new admin page and set the setting block and its text input. You can create a new post type, taxonomy, and its fields.
### Admin Items
- [Admin Menu](doc/admin-items/ADMIN_MENU.md)
- [Settings Section](doc/admin-items/SETTINGS_SECTION.md)
- [Post Type](doc/admin-items/POST_TYPE.md)
- [Meta Box](doc/admin-items/META_BOX.md)
- [Taxonomy](doc/admin-items/TAXONOMY.md)
### Form Fields
- [Attachment](doc/form-fields/ATTACHMENT.md)
- [Checkbox](doc/form-fields/CHECKBOX.md)
- [Editor](doc/form-fields/EDITOR.md)
- [Input](doc/form-fields/INPUT.md)
- [Radio](doc/form-fields/RADIO.md)
- [Select](doc/form-fields/SELECT.md)
- [Textarea](doc/form-fields/TEXTAREA.md)
helpers
### Helpers
- [Argument](doc/helpers/ARGUMENT.md)
- [Assets Loader](doc/helpers/ASSETS_LOADER.md)
- [Autoloader](doc/helpers/AUTOLOADER.md)
- [Enum](doc/helpers/ENUM.md)
- [Google Font Loader](doc/helpers/GOOGLE_FONT_LOADER.md)
- [JSON Schema](doc/helpers/JSON_SCHEMA.md)
- [Multiton/Singleton](doc/helpers/MULTITON_SINGLETON.md)
- [Transient](doc/helpers/TRANSIENT.md)