Library to assist in the creation of custom post types within WordPress.
- PHP >= 7.1
Use composer to add the package to your dependencies:
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',
]
],
]);
Released under the MIT license