Misc fixes for WordPress-Develop 7.0 merges#75985
Conversation
|
Flaky tests detected in a7db588. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/28078360772
|
peterwilsoncc
left a comment
There was a problem hiding this comment.
Notes on actions docs inline cc @youknowriad
@westonruter are you able to confirm I've got the sourceURL syntax for the inline styles correct.
| /** | ||
| * Fires as the {{PAGE_SLUG}} screen is initialized. | ||
| */ | ||
| do_action( '{{PAGE_SLUG}}-wp-admin_init' ); |
There was a problem hiding this comment.
This might be better as a wp-admin_init-{$page_slug} so it can be documented once as a dynamic hook. Otherwise the docs parser will be full of near identical items. With generated files an approach will need to be figured out to avoid duplicate docs within the code base.
MIght also need a generic version that passes the page slug as a parameter.
|
|
||
| // Fire init action for extensions to register routes and menu items | ||
| /** | ||
| * Fire init action for extensions to register routes and menu items. |
There was a problem hiding this comment.
This is not quite correct but I am having trouble figuring out the difference between page and admin page templates.
There was a problem hiding this comment.
Page is a full takeover of the screen (like the site editor) and admin page is just a regular page that keeps the wp-admin sidebar and top bar like the font library.
|
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. |
Co-authored-by: Weston Ruter <weston@ruter.net>
Co-authored-by: Weston Ruter <weston@ruter.net>
| /** | ||
| * Returns the top-level submenu SVG chevron icon. | ||
| * | ||
| * @since 5.9.0 | ||
| * @deprecated 7.0.0 Use block_core_navigation_render_submenu_icon() instead. | ||
| * | ||
| * @return string | ||
| */ | ||
| function block_core_navigation_link_render_submenu_icon() { | ||
| _deprecated_function( | ||
| __FUNCTION__, | ||
| '7.0.0', | ||
| 'block_core_navigation_render_submenu_icon' | ||
| ); | ||
| return block_core_navigation_render_submenu_icon(); | ||
| } | ||
|
|
There was a problem hiding this comment.
Is there a reason this cannot be moved to deprecated.php in wordpress-develop instead now that it's deprecated and unmaintained going forward?
There was a problem hiding this comment.
Typically block library and other package functions are deprecated in place. If you do a search for _deprecated_ you'll see a bunch of references. I think it's build related so their gutenberg_ counterparts are built and fire the deprecations for users running the plugin.
|
Is it okay to punt this PR to 7.1? It seems like a code quality improvement. |
| * | ||
| * @return string | ||
| */ | ||
| function block_core_navigation_link_render_submenu_icon() { |
There was a problem hiding this comment.
Regarding the block_core_navigation_submenu_render_submenu_icon function, please note that it is being restored by #78484.
There was a problem hiding this comment.
Or here if it's more convenient 😄
# Conflicts: # packages/block-library/src/navigation-link/index.php # packages/wp-build/templates/page-wp-admin.php.template # packages/wp-build/templates/page.php.template
…font_sizes() trunk removed this long-standing public function (@SInCE 5.9.0) when its logic moved to the shared helper block_core_shared_navigation_build_css_font_sizes(). Since this PR's goal is to preserve backward compatibility, restore it as a soft-deprecated shim that forwards to the shared helper, mirroring the block_core_navigation_link_render_submenu_icon() deprecation. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
t-hamano
left a comment
There was a problem hiding this comment.
I resolved the conflicts to move this PR forward.
| * @param array $context Navigation block context. | ||
| * @return array Font size CSS classes and inline styles. | ||
| */ | ||
| function block_core_navigation_link_build_css_font_sizes( $context ) { |
There was a problem hiding this comment.
This is what I restored. This function was deleted by #74855, but I believe it needs to be restored to maintain full backward compatibility.
| wp_add_inline_style( | ||
| '{{PAGE_SLUG}}-wp-admin-prerequisites', | ||
| {{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_inline_styles() | ||
| ); |
There was a problem hiding this comment.
I believe this PR is primarily intended to improve code quality and fix backward compatibility issues for the 7.0 release. However, as this code introduces a new function, I think it would be better to discuss it in a separate PR.
| /** | ||
| * Fires as the {{PAGE_SLUG}} screen is initialized. | ||
| */ |
| /** | ||
| * Fires for {{PAGE_SLUG}} page extensions to register routes and menu items. | ||
| */ |
There was a problem hiding this comment.
Same for the other changes below.
| } | ||
|
|
||
| /** | ||
| * Get the inline styles for the page. |
There was a problem hiding this comment.
| * Get the inline styles for the page. | |
| * Get the inline styles for the {{PAGE_SLUG}} page. |
|
It might be best to revisit this PR after #78826 has been merged. As a result, the purpose of this PR should be solely to fix incorrect |
# Conflicts: # packages/wp-build/templates/page-wp-admin.php.template # packages/wp-build/templates/page.php.template
…plate The wp_admin_inline_styles() function and its wp_add_inline_style() wiring introduced a new function unrelated to this PR's scope (code quality and 7.0 backward-compatibility fixes). Restore the original inline <style> output so the helper can be discussed separately. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
I've updated this PR because #78826 has been merged. Additionally, I've removed the newly added function, so I believe this PR is ready to be backported to 7.0.1. |
The trunk merge removed block_core_shared_navigation_build_css_font_sizes() (and its file) when font-size propagation was dropped from navigation items. The backward-compat shim block_core_navigation_link_build_css_font_sizes() still forwarded to that now-missing helper, which would fatal when called and left the deprecation notice pointing at a function that no longer exists. Inline the original @SInCE 5.9.0 logic so the shim is self-contained, drop the invalid replacement reference, and document that it is retained solely for third-party callers. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
What?
Miscellaneous fixes for WordPress-Develop merges during the 7.0.0 release cycle.
Anyone should feel free to push to this branch/ping me with things I've missed.
See #75984
Why?
Various code quality fixes.
How?
Code quality
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast