PostTypes icon indicating copy to clipboard operation
PostTypes copied to clipboard

Create Registrar classes

Open jjgrainger opened this issue 3 years ago • 0 comments

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).
  • PostType and Taxonomy classes 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.

jjgrainger avatar Jun 13 '22 21:06 jjgrainger