sujin/wp-express

Quick Wordpress Development Module.

4.0.5 2020-07-08 22:28 UTC

README

Build Status Coverage Status

logo.png

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.

include_once( $your_path_to . '/wp_express/autoload.php' );

Usage

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

Form Fields

helpers

Helpers