[wp-trac] [WordPress Trac] #36492: Add `WP_Post_Status` class
WordPress Trac
noreply at wordpress.org
Fri May 13 02:49:12 UTC 2016
#36492: Add `WP_Post_Status` class
------------------------------------+------------------------------
Reporter: flixos90 | Owner: DrewAPicture
Type: enhancement | Status: reviewing
Priority: normal | Milestone: Awaiting Review
Component: Posts, Post Types | Version: 3.0
Severity: normal | Resolution:
Keywords: has-patch dev-feedback | Focuses:
------------------------------------+------------------------------
Comment (by boonebgorges):
I think we should hold off on discussion of a base class (or, better, some
technique for extensibility that doesn't rely on inheritance) until we
have clear concept of what a "status" is, in general: what are the
properties that make something a status (rather than a post, or a term,
etc), and what abilities a status should have. As things stand, *post*
statuses are not even very well conceptualized, much less a general
"status" type that could inform other implementations.
[attachment:36492.5.diff] seems OK to me. A couple thoughts and questions:
* I don't think we need to describe default values for object properties
in the documentation for those properties. We already do that in
`set_props()`.
* What is the benefit of the `get_instance()` method? Methods like this
are generally used when the constructor is private - ie for a singleton.
It seems like a mixing of concerns to have the object make reference to
the global `$wp_post_statuses`. I'd remove the method and move that logic
back to `get_post_status_object()`.
* Code formatting: `! $args['internal']`, not `$args['internal']`, etc
--
Ticket URL: <https://core.trac.wordpress.org/ticket/36492#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list