Update: Increase footnotes meta priority and separate footnotes meta registration.#58882
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
There was a problem hiding this comment.
Maybe??
| function wp_register_footnotes_post_meta() { | |
| function register_block_core_footnotes_post_meta() { |
I'm unclear why the post types are limited to public. If someone has a private post type using the block editor, they probably want access to footnotes.
That said, if there are reasons then post types can be public but not actually public. You'll need to change the code below to:
$post_types = get_post_types( array( 'show_in_rest' => true ) );
$post_types = array_filter( $post_types, 'is_post_type_viewable' ) );Outside the diff sorry so can't do an inline suggestion
There was a problem hiding this comment.
Hi @peterwilsoncc, your points are well taken! Footnotes work even on non-public post types, so I removed the public filter. I also updated the function name. Thank you for the suggestions 👍
e19d9e9 to
d6efccb
Compare
|
Flaky tests detected in d6efccb. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7878017123
|
mcsf
left a comment
There was a problem hiding this comment.
LGTM, thanks for this. Let's not forget about upstream
…registration from the block registration.
Co-authored-by: Miguel Fonseca <150562+mcsf@users.noreply.github.com>
11d1e5a to
a197383
Compare
…registration. (#58882) Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org> Co-authored-by: peterwilsoncc <peterwilsoncc@git.wordpress.org> Co-authored-by: mcsf <mcsf@git.wordpress.org>
|
I just cherry-picked this PR to the cherry-pick-beta-2 branch to get it included in the next release: 245b544 |
…registration. (#58882) Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org> Co-authored-by: peterwilsoncc <peterwilsoncc@git.wordpress.org> Co-authored-by: mcsf <mcsf@git.wordpress.org>
| } | ||
| // Most post types are registered at priority 10, so use priority 20 here in | ||
| // order to catch them. | ||
| /** |
There was a problem hiding this comment.
@jorgefilipecosta Sorry, I missed this at the time -- comments should start with /* (a single asterisk) rather than a double asterisk). The latter is used for docblocks only to allow them to be picked up by parser for developer.wordpress.org
Are you able to do a follow up commit.
There was a problem hiding this comment.
Sure doing a follow up fix, thank you for catching this 👍
|
Note that as part of curating the Gutenberg 17.8 changelog, I added the labels [Type] Enhancement and [Block] Footnotes to this PR to better categorize it. Please let me know if there is a different label that would be a better fit. |
This PR does two actions:
Most post types are registered on init with a priority of 10 having a priority of 20 makes sure the footnotes meta is registered for all of the post types with a priority of 20. While also allowing plugins to change the footnotes meta if they have an advanced need ( as long as they use a priority higher than 20).
Testing Instructions