An open API service indexing awesome lists of open source software.

https://github.com/wpessential/wpessential-postypes

Help to register the custom post types and taxonomies in WordPress.
https://github.com/wpessential/wpessential-postypes

Last synced: 5 months ago
JSON representation

Help to register the custom post types and taxonomies in WordPress.

Awesome Lists containing this project

README

          

# WPEssential Postypes

Help to register the custom post types and taxonomies in WordPress.

`composer require wpessential/wpessential-postypes`

Add the post type to WordPress registry

```php
$name = 'YOUR_POST_TYPE_NAME';
$cpt = \WPEssential\Library\Cpt::make($name);
$cpt->register();
```

Remove the post type from WordPress registry

```php
$name = 'YOUR_POST_TYPE_NAME';
$cpt = \WPEssential\Library\Cpt::make($name);
$cpt->remove();
```
Add the taxonomy to WordPress registry

```php
$post_type = 'YOUR_POST_TYPE_SLUG';
$name = 'YOUR_TAXONOMY_NAME';
$ctxm = \WPEssential\Library\Ctxm::make($post_type, $name);
$ctxm->register();
```

Remove the taxonomy from WordPress registry

```php
$post_type = 'YOUR_POST_TYPE_SLUG';
$name = 'YOUR_TAXONOMY_NAME';
$ctxm = \WPEssential\Library\Ctxm::make($post_type, $name);
$ctxm->remove();
```