[wp-trac] [WordPress Trac] #36492: Add `WP_Post_Status` class

WordPress Trac noreply at wordpress.org
Thu Apr 28 07:31:07 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 DrewAPicture):

 @flixos90 I've iterated on 36492.2.diff with [attachment:36492.3.diff].
 Changes mostly comprise coding standards and docs fixes. Some notes not
 implemented in the new patch:

 My primary concern with the current approach is that we're doing argument
 handling in the constructor.

 Outside of the Customizer APIs and list table classes, we don't usually do
 much argument handling in constructors, as they're typically relegated to
 populating properties in core classes.

 With that in mind, I think we'd do well to implement a base/sub-class
 pattern with something like `WP_Status` – as [comment:211:ticket:12706
 suggested] by @johnjamesjacoby in !#12706 – that could be then extended
 for the posts, or users, or comments, or * use cases.

 Implementing argument handling in the constructor could throw up some
 roadblocks when it comes to implementing a base class.

 All that said, I wouldn't really have a problem with committing a
 `WP_Post_Status` first-run, though I would package it with a `WP_Status`
 base class in the same release. There's enough cross-over and possibility
 for standardized methods of handling underlying status architecture
 elsewhere in core to give the base/sub-class approach due consideration.
 Post statuses is an excellent place to start.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36492#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list