PostType class should throw an exception if $slug is not defined. #17
Labels
good first issue
Good for newcomers
priority: P1
This is an important issue, but not critical
size: small
Issue should take less than 4 hours to complete
PostType
objects do not currently throw an exception if a$slug
property is not defined, which can be confusing to developers when trying to extend thePostType
class.The
Taxonomy
class runs a requirements check before attempting to register a taxonomy, which alerts developers if the$slug
or$object_types
properties are missing. That implementation probably needs a little work (clearly the conditional in theregister
method there never actually passes if an exception is thrown), but it could serve as a model for how to address this missing exceptions in thePostType
class. See: https://github.com/WebDevStudios/oops-wp/blob/master/src/Structure/Content/Taxonomy.php#L53The text was updated successfully, but these errors were encountered: