Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add revisioning of post meta, including ‘footnotes’ by default #4859

Closed
wants to merge 117 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
b8bf5ef
Add revisioning of post meta, including ‘footnotes’ by default
adamsilverstein Jul 17, 2023
6667610
correct typo in `src/wp-includes/default-filters.php`
adamsilverstein Jul 17, 2023
15e9e4e
add tests for meta revisioning
adamsilverstein Jul 17, 2023
b892323
Try: revisioning in the rest endpoint directly, after meta is saved
adamsilverstein Jul 17, 2023
6235af5
Add _wp_save_post_revision_meta helper that copies revisioned meta to…
adamsilverstein Jul 18, 2023
3a87749
remove direct REST API integration, move save to wp_after_insert_post
adamsilverstein Jul 18, 2023
05d0f86
Clean up revisions save
adamsilverstein Jul 18, 2023
19e1f8a
phpcbf
adamsilverstein Jul 18, 2023
0b86da9
Ensure `$revisions[0]->post_id ` is set before using
adamsilverstein Jul 18, 2023
52dd943
Test work
adamsilverstein Jul 18, 2023
ef14c11
Expected revision count is 6
adamsilverstein Jul 19, 2023
31a6d61
Merge branch 'trunk' into ticket/20564
adamsilverstein Jul 21, 2023
da8abe6
Add REST API tests for revisioning of post meta.
adamsilverstein Jul 25, 2023
d2f0db1
Merge branch 'trunk' into ticket/20564
adamsilverstein Jul 25, 2023
6c9bece
Remove footnote specific revisioning of meta
adamsilverstein Jul 25, 2023
2e74964
phpcbf
adamsilverstein Jul 25, 2023
268385f
Fix test setup
adamsilverstein Jul 25, 2023
4fd4302
Save revisioned meta in `_wp_put_post_revision`
adamsilverstein Jul 25, 2023
3722d1e
Enable setting revisioning in register_meta
adamsilverstein Jul 25, 2023
b26a695
phpcs
adamsilverstein Jul 26, 2023
5d6e5b9
remove unused $revisioned_keys
adamsilverstein Jul 26, 2023
b4fa33f
Add testing for enabling revisions in `register_meta`
adamsilverstein Jul 26, 2023
1603c55
phpcbf
adamsilverstein Jul 26, 2023
d244a39
Use a separate global for revisioned keys `$wp_revisioned_meta_keys`
adamsilverstein Jul 26, 2023
d86ec77
Merge branch 'trunk' into ticket/20564
adamsilverstein Jul 26, 2023
a80620a
Meta test cleanup to match new defaults
adamsilverstein Jul 26, 2023
885640d
Adjust expected for `test_should_register_persisted_preferences_meta`
adamsilverstein Jul 26, 2023
ea4f181
Refine REST tests for meta revisioning
adamsilverstein Jul 26, 2023
e63334b
Avoid duplicate keys in `wp_revisioned_meta_keys`
adamsilverstein Jul 26, 2023
f4234f8
remove unused `original_post_id`
adamsilverstein Jul 26, 2023
1f1e5a0
REST posts endpoint: update revision meta when saving meta
adamsilverstein Jul 26, 2023
6c5061b
test work
adamsilverstein Jul 26, 2023
5bd7e7b
Hook `wp_save_revisioned_meta_fields` on `_wp_put_post_revision` so i…
adamsilverstein Jul 27, 2023
65bfe81
Test cleanup
adamsilverstein Jul 27, 2023
7254e3a
Improve footnote display, show number and content
adamsilverstein Jul 27, 2023
8c3fba2
Save the revisioned meta directly in the REST endpoint
adamsilverstein Jul 27, 2023
26a9d0b
spacing
adamsilverstein Jul 27, 2023
210573b
Merge branch 'trunk' into ticket/20564
adamsilverstein Jul 27, 2023
485f20b
add meta to revisions endpoint
adamsilverstein Jul 31, 2023
167261e
test revisions endpoint returns meta
adamsilverstein Jul 31, 2023
5b5dc0d
new revision meta fields class
adamsilverstein Jul 31, 2023
f8d0d30
INCLUDE class-wp-rest-revision-meta-fields
adamsilverstein Aug 1, 2023
ea9b8ce
Revision existing meta even when update/insert lacks meta
adamsilverstein Aug 1, 2023
15e8bbd
Test that the revisions endpoint includes meta
adamsilverstein Aug 1, 2023
1e54aa3
Merge branch 'trunk' into ticket/20564
adamsilverstein Aug 1, 2023
a3fa561
phpcbf
adamsilverstein Aug 1, 2023
877420e
Merge branch 'trunk' into ticket/20564
adamsilverstein Aug 17, 2023
f57b79b
Update REST tests to reflect changed schema
adamsilverstein Aug 17, 2023
cad9272
phpcbf
adamsilverstein Aug 18, 2023
57c872a
Improve tests
adamsilverstein Aug 18, 2023
ca01058
Finetune tests based on git action failures
adamsilverstein Aug 18, 2023
92590aa
test
adamsilverstein Aug 18, 2023
6fd9a9e
restore footnotes.php from trunk
adamsilverstein Aug 24, 2023
f83d353
Merge branch 'trunk' into ticket/20564
adamsilverstein Aug 24, 2023
7f70990
Update wp-api-generated fixtures
adamsilverstein Aug 24, 2023
432a810
fix generated
adamsilverstein Aug 24, 2023
d80b7b4
Try: move hooking of revisions
adamsilverstein Aug 24, 2023
7160abb
fire after hooks in revisions controller test
adamsilverstein Aug 24, 2023
96301da
Try only adding revision on update.
TimothyBJacobs Aug 24, 2023
e2d0cc7
Use actions properly
TimothyBJacobs Aug 24, 2023
5f07145
Revert "Try only adding revision on update."
TimothyBJacobs Aug 24, 2023
afc1109
Don't rewrite everything
TimothyBJacobs Aug 24, 2023
ac279e3
Correct logic
TimothyBJacobs Aug 24, 2023
4205d65
Check if the legacy hook is being used
TimothyBJacobs Aug 24, 2023
e7b4495
Separate single and multi meta tests. Use native meta fields handler.
TimothyBJacobs Aug 24, 2023
68f6410
Regenerate fixtures
TimothyBJacobs Aug 24, 2023
ee35085
Use post meta fields directly
TimothyBJacobs Aug 24, 2023
61bfafc
Respect the object subtype.
TimothyBJacobs Aug 24, 2023
c27258a
Always pass a post array
TimothyBJacobs Aug 24, 2023
20874e3
Remove manually revisioning meta. This happens automatically now.
TimothyBJacobs Aug 24, 2023
68a419b
Correct has meta key assertion
TimothyBJacobs Aug 24, 2023
3ee633f
Add clarifying comment and some more fail safes
TimothyBJacobs Aug 24, 2023
1e17f5b
Merge branch 'trunk' into ticket/20564
adamsilverstein Aug 27, 2023
982c553
Merge branch 'trunk' into ticket/20564
adamsilverstein Aug 28, 2023
d04574a
Test cleanup, add page and cpt tests
adamsilverstein Aug 29, 2023
3a8f6fc
omyac
adamsilverstein Aug 29, 2023
192e7c0
Merge branch 'trunk' into ticket/20564
adamsilverstein Sep 8, 2023
225a91b
Clean up default filters after trunk merge
adamsilverstein Sep 8, 2023
c2482fd
Avoid duplicate revisions since hook change
adamsilverstein Sep 9, 2023
2331d36
Merge branch 'trunk' into ticket/20564
adamsilverstein Sep 11, 2023
5c48c7a
Restore hooks on wp_insert_post for revision - issue was plugin related
adamsilverstein Sep 11, 2023
e211ca1
Ensure meta data is revisioned with autosaves
adamsilverstein Sep 12, 2023
7247e93
Cleanup, only check meta when passed
adamsilverstein Sep 12, 2023
891a0e4
Merge branch 'trunk' into ticket/20564
adamsilverstein Sep 19, 2023
c35cc5f
Merge branch 'trunk' into ticket/20564
adamsilverstein Sep 22, 2023
826bebb
Merge branch 'trunk' into ticket/20564
adamsilverstein Sep 25, 2023
750dcdc
Hook wp_autosave_post_revisioned_meta_fields on wp_creating_autosave
adamsilverstein Sep 25, 2023
0b88e50
Improve error checking
adamsilverstein Sep 25, 2023
2c02dbc
Update src/wp-includes/rest-api/endpoints/class-wp-rest-revisions-con…
adamsilverstein Sep 25, 2023
b5ba2d3
Update src/wp-includes/revision.php
adamsilverstein Sep 25, 2023
95508d9
Hook revision restore on action
adamsilverstein Sep 25, 2023
b0b880b
Test revisioning of meta with a default value
adamsilverstein Sep 25, 2023
f04a319
phpcs
adamsilverstein Sep 25, 2023
e231886
phpcbf
adamsilverstein Sep 25, 2023
e1950b0
Autosaves controller - get_metadata_raw is used to avoid retrieving t…
adamsilverstein Sep 25, 2023
6f6e3ce
Update src/wp-includes/revision.php
adamsilverstein Sep 25, 2023
b77bf22
Check post_type available in wp_save_revisioned_meta_fields
adamsilverstein Sep 25, 2023
b6e221a
Ensure post_type available in wp_restore_post_revision_meta
adamsilverstein Sep 25, 2023
40febf2
typo - missing closing parenthesis
adamsilverstein Sep 25, 2023
69c6107
phpcbf
adamsilverstein Sep 25, 2023
f9b760b
If the object_type is set, require a type that supports revisions wh…
adamsilverstein Sep 25, 2023
8360faa
Test enabling revisions for meta when object type doesn’t support rev…
adamsilverstein Sep 25, 2023
a1971f7
phpcbf
adamsilverstein Sep 25, 2023
99b2aa8
Update src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-con…
adamsilverstein Sep 26, 2023
b94e1a6
Update src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-con…
adamsilverstein Sep 26, 2023
e09f011
Update src/wp-admin/includes/post.php
adamsilverstein Sep 26, 2023
01a4788
Update src/wp-admin/includes/post.php
adamsilverstein Sep 26, 2023
8e7b72a
spacing
adamsilverstein Sep 26, 2023
d6c6ca2
Guard against _wp_put_post_revision returning 0
adamsilverstein Sep 26, 2023
73f6a23
Update src/wp-includes/meta.php
adamsilverstein Sep 26, 2023
3db644c
tabs vs spaces
adamsilverstein Sep 26, 2023
95c9e9d
Update src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-con…
adamsilverstein Sep 26, 2023
9bab9a9
Improve error message
adamsilverstein Sep 26, 2023
dc0b907
Merge branch 'trunk' into ticket/20564
adamsilverstein Sep 26, 2023
ab2d500
Merge branch 'trunk' into ticket/20564
adamsilverstein Sep 26, 2023
8bf1727
phpcbf
adamsilverstein Sep 26, 2023
c7904ce
phpcbf pt 2
adamsilverstein Sep 26, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix test setup
  • Loading branch information
adamsilverstein committed Jul 25, 2023
commit 268385fcd150229c311998025a4bbec889e18722
2 changes: 1 addition & 1 deletion tests/phpunit/tests/post/metaRevisions.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class MetaRevisionTests extends WP_UnitTestCase {
/**
* {@inheritDoc}
*/
protected function setUp() {
public function setUp() {
parent::setUp();

// Reset for current test.
Expand Down