[wp-trac] [WordPress Trac] #28463: Need core concept of the first publication of a post/comment.

WordPress Trac noreply at wordpress.org
Thu Jun 5 17:21:57 UTC 2014


#28463: Need core concept of the first publication of a post/comment.
--------------------------+-----------------------------
 Reporter:  andy          |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Because status transitions are permitted to occur in a cyclic fashion, it
 is possible to publish a post/comment more than once. The first
 publication event has unique significance, e.g. to push-based subscription
 delivery systems, but this concept is not represented anywhere in
 WordPress.

 Restricting status transitions to a directed acyclic graph is a non-
 starter.

 What I have done in plugins (and Nacin also suggests) is to mark the
 initial publication in meta: if transitioning to publish/approved, try
 adding the meta; if the add succeeds, this is the initial publication. I
 suspect that a significant number of plugins duplicate this.

 It would be even more useful to keep the history of changes to post_status
 in revisions rather than put "inherit" in that field. This would have
 repercussions in the already complex system for revisions, which has no
 facility for dealing with changes to non-content fields. It may also
 conflict with the existing uses of the "inherit" status, such as calling
 get_post_status() on a revision with the intention of getting the parent's
 status.

 Status revisions may have other uses as well (see #23314, #12706) but
 comment revisions don't exist yet. Ultimately what I want is a hook that
 fires only on the initial publication of a post or comment. The
 add_post_meta/add_comment_meta system can accomplish this much more
 easily.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/28463>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list