Skip to content

Latest commit

 

History

History
53 lines (42 loc) · 1.04 KB

README.md

File metadata and controls

53 lines (42 loc) · 1.04 KB

🌴 WordPress Custom Post Types

License

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