palmtree / wp-custom-post-type
WordPress 自定义文章类型
v4.0.0
2022-05-30 11:01 UTC
Requires
- php: >=8.0
- palmtree/argparser: ^2.0.0
- palmtree/nameconverter: ^2.0.0
Requires (Dev)
- palmtree/php-cs-fixer-config: ^2.0
- roots/wordpress: ^5.6.0
README
库,用于在WordPress中创建自定义文章类型。
需求
- PHP >= 7.1
安装
使用Composer将包添加到依赖项
composer require palmtree/wp-custom-post-type
用法
基本用法
<?php use Palmtree\WordPress\CustomPostType\CustomPostType; $project = new CustomPostType('project'); $callToAction = new CustomPostType([ 'post_type' => 'cta', 'public' => false, ]);
高级用法
<?php use Palmtree\WordPress\CustomPostType\CustomPostType; $project = new CustomPostType([ 'post_type' => 'project', 'front' => 'my-projects', 'taxonomies' => [ [ 'name' => 'Project Tags', 'hierarchical' => false, ], [ 'name' => 'Project Categories', 'singluar_name' => 'Project Category', ] ], ]);
许可证
在MIT许可证下发布