Post Types

To register custom post types and taxonomies we recommend looking at Extended CPTs by John Blackbourn. Extended CPTs is a library which provides extended functionality to WordPress custom post types and taxonomies. This allows developers to quickly build post types and taxonomies without having to write the same code again and again.

Require the extended-cpts package, with Composer, in the root directory of your project.

$ composer require johnbillion/extended-cpts

Now you can register new custom post types and taxonomies with the register_extended_post_type and register_extended_taxonomy helper functions.

add_action('init', function() {

  register_extended_taxonomy('location', 'event');

Visit the documentation to read more about the plugin.