Skip to content

PHP Class for WordPress which help create type of post, taxonomies, metabox, page option. + helpers

License

Notifications You must be signed in to change notification settings

kostyandrew/aspect-post

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ASPECT-Post

PHP Class for WordPress which help create type of post, taxonomies and metabox

You can use standard arguments and labels setting WordPress using setArgument and setLabel methods

Creating post type:

use \Aspect\Type;
$slides = new Type('slide');
$slides
  ->addSupport('thumbnail') // add support thumbnail
  ->setArgument('public', true) // public argument
  ->setArgument('show_in_nav_menus', false); // hide in creating menu

Creating taxonomy:

use \Aspect\Taxonomy;
$slides_type = new Taxonomy('type');
$slides_type
  ->attachTo($slides); // post type where will be created taxonomy

Creating metabox:

use \Aspect\Box;
$slides_settings = new Box('slide setting');
$slides_settings
  ->attachTo($slides); // post type

Creating metabox input:

use \Aspect\Input;
$text_color = new Input('text color');
$text_color
  ->attachTo($slides_settings) // metabox
  ->attach('white', 'black') // values for select
  ->setType('select') // type of input
  ->setArgument('default', 'black'); // default

Get value of metabox field:

$text_color = Input::get('text color')->getValue($slide_id, 'attr', Box::get('slide setting'));

About

PHP Class for WordPress which help create type of post, taxonomies, metabox, page option. + helpers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages