kostyandrew/aspect-post
最新稳定版本:1.0.0
Composer 安装命令:
composer require kostyandrew/aspect-post
包简介
PHP Class for WordPress which help create type of post, taxonomies and metabox
README 文档
README
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'));
统计信息
- 总下载量: 22
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-03-10