WebDevStudios / oops-wp

A collection of abstract classes, interfaces, and traits to promote object-oriented programming practices in WordPress.
57 stars 9 forks source link

Add abstract ContentType class, from which both PostType and Taxonomy should extend #6

Closed jmichaelward closed 5 years ago

jmichaelward commented 5 years ago

Custom post type and taxonomy registration in WordPress, at their core, are very similar - each requires a slug, a set of arguments, and some labels. Taxonomies, of course, need to know which post types they support, so there are differences, but in general, we should be able to define the shared aspects of these two class types and include them with the library.

The result of this issue should be a new abstract class that defines these shared elements. A PostType in the 1.0.0 release will need to extend this class.

jmichaelward commented 5 years ago

I'm working on this in tandem with #3. Feature branch at feature/content-type-abstraction, but each will have its own issue branch until merged, which should be approved in sequence.

Example class here: https://github.com/WebDevStudios/oops-wp/blob/issue/%236-add-abstract-contenttype-class/src/Structure/Content/ContentType.php

jmichaelward commented 5 years ago

This work has been completed and merged. Closing.