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.
- Host: GitHub
- URL: https://github.com/wpessential/wpessential-postypes
- Owner: wpessential
- License: gpl-3.0
- Created: 2024-12-30T22:09:10.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-19T14:04:16.000Z (over 1 year ago)
- Last Synced: 2025-07-31T17:53:46.202Z (11 months ago)
- Language: PHP
- Size: 45.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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();
```