-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Update: Increase footnotes meta priority and separate footnotes meta registration. #58882
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. |
* | ||
* @since 6.5.0 | ||
*/ | ||
function wp_register_footnotes_post_meta() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for this. Let's not forget about upstream
…registration from the block registration.
Co-authored-by: Miguel Fonseca <[email protected]>
11d1e5a
to
a197383
Compare
…registration. (#58882) Co-authored-by: jorgefilipecosta <[email protected]> Co-authored-by: peterwilsoncc <[email protected]> Co-authored-by: mcsf <[email protected]>
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 <[email protected]> Co-authored-by: peterwilsoncc <[email protected]> Co-authored-by: mcsf <[email protected]>
@@ -105,8 +105,10 @@ function register_block_core_footnotes_post_meta() { | |||
} | |||
} | |||
} | |||
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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