@startuml
title WordPress Post Statuses
!theme vibrant
skinparam nodesep 50
skinparam ranksep 100

Publish: Viewable by everyone
Future: Scheduled to be\npublished in a\nfuture date
Draft: Incomplete post
Pending: Awaiting to be\npublished

[*] --> Draft: Author role\nand above
Draft --> Publish: Publish Post
Publish --> Draft: Unpublish Post
Draft --> Future: Schedule Post
Future --> Draft: Unschedule Post
Future --> Publish: On scheduled\ntime arrival
Publish --> Future: Unpublish and\nreschedule Post

[*] -l-> Pending: Contributor role\nsubmits for review
Pending --> Publish: Published by user\nwith permissions
Publish --> Pending: Unpublish Post\nfor re-review
Draft --> Pending: Request Review
Future --> Pending: Request Review
Pending --> Future: Schedule Post

Publish --> [*]

@enduml

The state diagram represents the status transitions for WordPress posts. Here is a description of each status transition:

  1. Draft: This status indicates that the post is still being created or edited. Only users with the author role or higher have access to the draft.
  2. Publish: When a draft post is ready, it can be published to make it viewable by everyone. This transition occurs when the author chooses to publish the post.
  3. Unpublish: If a published post needs to be taken down temporarily, the author can choose to unpublish it, which reverts the post back to the draft status.
  4. Future: When an author wants to schedule a post to be published in the future, they can set a specific date and time. The post will transition to the future status until the scheduled time arrives.
  5. Unschedule: If a post was scheduled for future publication but the author decides to cancel the schedule, the post transitions back to the draft status.
  6. On scheduled time arrival: When the scheduled time for a future post arrives, the post automatically transitions to the publish status and becomes viewable by everyone.
  7. Unpublish and reschedule: If a post is already published and the author wants to modify the schedule, they can choose to unpublish the post and reschedule it for a different future date.
  8. Pending: Users with the contributor role can submit their drafts for review. The post transitions to the pending status until it is reviewed by a user with publishing permissions.
  9. Published by user with permissions: After a post in the pending status is reviewed and approved by a user with publishing permissions, it transitions to the publish status and becomes viewable by everyone.
  10. Unpublish Post for re-review: If a published post needs to be revised and re-reviewed, the author can choose to unpublish it, and it transitions back to the pending status.
  11. Request Review: Authors of draft or future posts can request a review by changing the status to pending, indicating that they want the post to be reviewed before publishing.
  12. Schedule Post: Authors can request to schedule a draft or future post for publication at a specific date and time. The post transitions to the future status, indicating that it is scheduled for future publication.
  13. Schedule Post (Pending): If a post in the pending status is requested to be scheduled for publication, it transitions to the future status and remains pending until the scheduled time arrives.
  14. Publish –> [*]: This transition represents the end of a post’s lifecycle. If a post is published, it can be considered complete and does not have any further state transitions.

Overall, the state diagram showcases the different stages a WordPress post can go through, from draft to published, with various options for scheduling, reviewing, and unpublishing.

Leave a Reply

Your email address will not be published. Required fields are marked *