Footnotes: fix accidental override#53663
Merged
tellthemachines merged 2 commits intotrunkfrom Aug 16, 2023
Merged
Conversation
ellatrix
commented
Aug 15, 2023
| add_action( "rest_after_insert_{$post_type}", 'wp_add_footnotes_revisions_to_post_meta' ); | ||
| } | ||
| add_action( 'rest_after_insert_post', 'wp_add_footnotes_revisions_to_post_meta' ); | ||
| add_action( 'rest_after_insert_page', 'wp_add_footnotes_revisions_to_post_meta' ); |
Member
Author
There was a problem hiding this comment.
Worth noting that we could move this to the register_block_core_footnotes function, which runs on init, but I'm scared to move code around at this point. It's an option though.
Member
Author
There was a problem hiding this comment.
We anyway went for hardcoding these for this release.
Contributor
There was a problem hiding this comment.
This is fine for now; it'll have to change anyway once we add support for other post types so we can leave bigger changes till then 😄
tellthemachines
approved these changes
Aug 15, 2023
| add_action( "rest_after_insert_{$post_type}", 'wp_add_footnotes_revisions_to_post_meta' ); | ||
| } | ||
| add_action( 'rest_after_insert_post', 'wp_add_footnotes_revisions_to_post_meta' ); | ||
| add_action( 'rest_after_insert_page', 'wp_add_footnotes_revisions_to_post_meta' ); |
Contributor
There was a problem hiding this comment.
This is fine for now; it'll have to change anyway once we add support for other post types so we can leave bigger changes till then 😄
carolinan
approved these changes
Aug 15, 2023
mcsf
approved these changes
Aug 15, 2023
tellthemachines
pushed a commit
that referenced
this pull request
Aug 16, 2023
* Footnotes: fix accidental override * Remove double quotes
tellthemachines
added a commit
that referenced
this pull request
Aug 16, 2023
* Footnotes: Fix recursion into updating attributes when attributes is not an object (#53257) * Fix crash by moving editor style logic into a hook with useMemo (#53596) * Move editor style logic into a hook whith useMemo * Remove unnecessary useMemo * Move the whole logic inside the 'useMemo' * Add missing useSelect dep --------- Co-authored-by: George Mamadashvili <georgemamadashvili@gmail.com> * Adding an is_array check before using count in case $footnotes is not countable (#53660) * Footnotes: fix accidental override (#53663) * Footnotes: fix accidental override * Remove double quotes * Footnotes: autosave is not slashing JSON (#53664) * Footnotes: autosave saves decoded JSON * wp_slash * Curly quote * Slash on save and restore * Ensure the preview dropdown popover closes (<16.3) for e2e tests --------- Co-authored-by: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Co-authored-by: Noah Allen <noahtallen@gmail.com> Co-authored-by: George Mamadashvili <georgemamadashvili@gmail.com> Co-authored-by: Ramon <ramonjd@users.noreply.github.com> Co-authored-by: Ella <4710635+ellatrix@users.noreply.github.com> Co-authored-by: ramon <ramonjd@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
We're accidentally overriding the $post_type global 🤦♀️
Fixes https://core.trac.wordpress.org/ticket/59105.
Why?
How?
Avoid the foreach loop setting the $post_type global
Alternatively, we could move this to
register_block_core_footnotes, but I opted for moving as little code as possible.Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast