承接 elcontraption/wp-post-type 相关项目开发

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

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

elcontraption/wp-post-type

最新稳定版本:0.2.0

Composer 安装命令:

composer require elcontraption/wp-post-type

包简介

A WordPress custom post type creator class.

README 文档

README

A WordPress custom post type creator class.

Installation

Via composer:

composer require elcontraption/wp-post-type

Create a post type

Create an 'event' post type:

use \ElContraption\WpPostType\PostType;

$events = new PostType('event');

The first argument may either be a string representing the name of the post type (typically singular), or an array defining singular, and plural names:

$events = new PostType(array(

    // These are required when passing an array for the first parameter
    'singular' => 'Gallery',
    'plural' => 'Galleries',

    // Optional
    'name' => 'gallery'
));

Labels

Labels are assigned based on the singular and plural names. You may override any post type label by passing an array of labels for the second parameter:

$labels = array(

    // Override the 'add_new' label
    'add_new' => 'My Custom Label'
);

$events = new PostType('event', $labels);

Arguments

The default WordPress post type arguments are respected, which means your custom post type will not be public by default see defaults. You may set your own arguments by passing an array for the third parameter:

$args = array(

    // Make this post type public
    'public' => true
);

$events = new PostType('event', $labels, $args);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-03-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固