Make WordPress Core

Opened 10 years ago

Last modified 20 months ago

#28463 new feature request

Need core concept of the first publication of a post/comment.

Reported by: andy's profile andy Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords: dev-feedback needs-patch
Focuses: Cc:

Description

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.

Change History (5)

#1 @DrewAPicture
10 years ago

  • Type changed from defect (bug) to enhancement

#2 @DrewAPicture
9 years ago

  • Component changed from General to Posts, Post Types
  • Keywords dev-feedback added
  • Type changed from enhancement to feature request

#3 @chriscct7
8 years ago

  • Keywords needs-patch added

This ticket was mentioned in Slack in #core by swissspidy. View the logs.


8 years ago

#5 @desrosj
20 months ago

  • Milestone set to Awaiting Review

Re-adding a milestone.

This still seems like a good thing to consider adding if someone is willing to work on a patch.

Note: See TracTickets for help on using tickets.