wpessential/wpessential-postypes

WPEssential Postypes helping in registry of custom post types and taxonomies in WordPress.

0.2.3 2025-03-19 13:57 UTC

This package is auto-updated.

Last update: 2025-05-19 14:21:20 UTC


README

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

composer require wpessential/wpessential-postypes

Add the post type to WordPress registry

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

Remove the post type from WordPress registry

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

Add the taxonomy to WordPress registry

$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

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