Skip to content

Revisions: ensure wp_insert_post saves a revision for newly published posts. - #1336

Closed
adamsilverstein wants to merge 11 commits into
WordPress:trunkfrom
adamsilverstein:ticket/30854
Closed

adamsilverstein wants to merge 11 commits into
WordPress:trunkfrom
adamsilverstein:ticket/30854

Conversation

@adamsilverstein

@adamsilverstein adamsilverstein commented Jun 4, 2021 •

Copy link
Copy Markdown
Member

Trac ticket: https://core.trac.wordpress.org/ticket/30854

Testing Instructions

Test in WordPress Playground


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

# Conflicts:
#	tests/phpunit/tests/post/revisions.php
@adamsilverstein adamsilverstein changed the title Changes from 30854.3.diff Revisions: ensure wp_insert_post saves a revision for newly published posts. Nov 9, 2021
@peterwilsoncc
peterwilsoncc changed the base branch from master to trunk November 16, 2021 23:21
# Conflicts:
#	tests/phpunit/tests/post/revisions.php
@peterwilsoncc

Copy link
Copy Markdown
Contributor

@adamsilverstein I'll push a few things to your branch for a conflict resolution and some minor nitpick fixes.

# Conflicts:
#	src/wp-includes/theme.php
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@adamsilverstein

Copy link
Copy Markdown
Member Author

Closing this one in favor of #12272, let's continue review over there: #12272

Claude compared the two branches, here is the short version:

This branch only hooks new_to_publish, so it never covered the private, future, pending and custom statuses raised in https://core.trac.wordpress.org/ticket/30854#comment:39, and the REST test failures from comment 42 were never resolved. #12272 saves the initial revision for any status from wp_save_post_revision_on_insert(), sets a revision author when there is no current user, and updates the REST, global styles and template revisions tests added since 2021.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants