PostTypes
PostTypes copied to clipboard
Create Registrar classes
This PR refactors Post Type and Taxonomy classes by moving the logic to handle registering types to WordPress to their own separate Registrar classes. This is a large change but will help towards making the codebase more maintainable.
- Provide a separation between classes that handle setting data (
PostTypes\PostType) and those that handle the logic to register objects to WordPress (PostTypes\Registrar\PostType\Registrar). PostTypeandTaxonomyclasses can focus more on interface and providing a clean API for engineers to use.- "Registrar" classes can focus on the logic of registering post types and taxonomies to WordPress.
- Separation will improve test coverage by separating code that can be tested in isolation and code that requires integration with WordPress.
- Makes the code cleaner to read and easier to maintain.