承接 moxie-leean/cpt 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

moxie-leean/cpt

最新稳定版本:0.2.0

Composer 安装命令:

composer require moxie-leean/cpt

包简介

Craate custom post types more easily

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 moxie-leean/cpt

Or by adding the following lines on your composer.json file

"require": {
  "moxie-leean/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 \Leean\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.

统计信息

  • 总下载量: 710
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-01-23