wearenolte/wp-cpt
最新稳定版本:1.0.5
Composer 安装命令:
composer require wearenolte/wp-cpt
包简介
Create custom post types easier.
关键字:
README 文档
README
This library will allow you to create more easily custom post types for wordpress without too much effort.
Installation
The easiest way to install this package is by using composer from your terminal:
composer require wearenolte/wp-cpt
Or by adding the following lines on your composer.json file
"require": { "wearenolte/wp-cpt": "dev-master" }
This will download the file from the packagist site and the latest version located on master branch of the repository.
After that you can need to include the autoload.php file in order to
be able to autoload the class during the object creation.
include '/vendor/autoload.php';
Then you only need to create a new Cpt object with the required params
for your custom post type, if you are using the library in a theme you
might need to add the function in the init action as an example:
add_action( 'init', function() { $testimonials = new \Lean\Cpt([ 'singular' => 'Testimonial', 'plural' => 'Testimonials', 'post_type' => 'testimonials', 'slug' => 'testimonial', ]); $testimonials->init(); });
The example above allow you to create a new testimonial post type on your theme.
统计信息
- 总下载量: 25.92k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-02-24