palmtree / wp-custom-post-type
WordPress Custom Post Types
Installs: 3 597
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
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
Library to assist in the creation of custom post types within WordPress.
Requirements
- PHP >= 7.1
Installation
Use composer to add the package to your dependencies:
composer require palmtree/wp-custom-post-type
Usage
Basic Usage
<?php use Palmtree\WordPress\CustomPostType\CustomPostType; $project = new CustomPostType('project'); $callToAction = new CustomPostType([ 'post_type' => 'cta', 'public' => false, ]);
Advanced Usage
<?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', ] ], ]);
License
Released under the MIT license