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.
|
If possible, let's ship this PR in 7.1. I think the sooner we restore the deleted function, the better. |
The generated single-page admin template now passes the current $hook_suffix to the admin_footer action instead of an empty string. This restores parity with wp-admin/admin-footer.php so hooks relying on the argument fire correctly. Adds the missing CHANGELOG entry required by the Check CHANGELOG diff CI job. Co-Authored-By: Claude <noreply@anthropic.com>
The #75985 bug fix entry was placed under the already-released 0.19.0 section. Move it to the Unreleased section so it is included in the next release notes.
|
Going to merge this PR and backport it to 7.1. This PR ultimately aims to simply resolve backward compatibility issues and improve code quality. To ensure consistency with the 7.1 release and the Gutenberg plugin, I would like to backport this to Gutenberg 23.6 RC as well. |
|
There was a conflict while trying to cherry-pick the commit to the wp/7.1 branch. Please resolve the conflict manually and create a PR to the wp/7.1 branch. PRs to wp/7.1 are similar to PRs to trunk, but you should base your PR on the wp/7.1 branch instead of trunk. |
|
Removing the |
* Correct since annotation for block_core_page_list_get_submenu_visibility().
* Correct since annotation for block_core_navigation_get_submenu_visibility()
* Soft deprecate block_core_navigation_link_render_submenu_icon().
* Use WP_Styles API for inline styles.
* Document the {{PAGE_SLUG}}-wp-admin_init actions.
* Pass hook suffix to admin_footer action.
* Document {{PAGE_SLUG}}_init hook
* Remove duplicate documentation for actions.
* Update CSS comments so they are actually comments 🤦♂️
* Apply suggestions from code review
* Navigation Link: Soft deprecate block_core_navigation_link_build_css_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.
* wp-build: Revert inline-styles helper extraction in wp-admin page template
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.
* Navigation Link: Make deprecated font-size helper self-contained
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.
* wp-build: Add CHANGELOG entry for admin_footer hook_suffix fix
The generated single-page admin template now passes the current $hook_suffix to the admin_footer action instead of an empty string. This restores parity with wp-admin/admin-footer.php so hooks relying on the argument fire correctly.
Adds the missing CHANGELOG entry required by the Check CHANGELOG diff CI job.
* wp-build: Move changelog entry to the Unreleased section
The #75985 bug fix entry was placed under the already-released 0.19.0
section. Move it to the Unreleased section so it is included in the next
release notes.
---------
Co-authored-by: Peter Wilson <519727+peterwilsoncc@users.noreply.github.com>
Co-authored-by: peterwilsoncc <peterwilsoncc@git.wordpress.org>
Co-authored-by: westonruter <westonruter@git.wordpress.org>
Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
Co-authored-by: desrosj <desrosj@git.wordpress.org>
Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
|
This PR was manually backported to the |
|
There was a conflict while trying to cherry-pick the commit to the wp/7.1 branch. Please resolve the conflict manually and create a PR to the wp/7.1 branch. PRs to wp/7.1 are similar to PRs to trunk, but you should base your PR on the wp/7.1 branch instead of trunk. |
* Correct since annotation for block_core_page_list_get_submenu_visibility().
* Correct since annotation for block_core_navigation_get_submenu_visibility()
* Soft deprecate block_core_navigation_link_render_submenu_icon().
* Use WP_Styles API for inline styles.
* Document the {{PAGE_SLUG}}-wp-admin_init actions.
* Pass hook suffix to admin_footer action.
* Document {{PAGE_SLUG}}_init hook
* Remove duplicate documentation for actions.
* Update CSS comments so they are actually comments 🤦♂️
* Apply suggestions from code review
* Navigation Link: Soft deprecate block_core_navigation_link_build_css_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.
* wp-build: Revert inline-styles helper extraction in wp-admin page template
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.
* Navigation Link: Make deprecated font-size helper self-contained
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.
* wp-build: Add CHANGELOG entry for admin_footer hook_suffix fix
The generated single-page admin template now passes the current $hook_suffix to the admin_footer action instead of an empty string. This restores parity with wp-admin/admin-footer.php so hooks relying on the argument fire correctly.
Adds the missing CHANGELOG entry required by the Check CHANGELOG diff CI job.
* wp-build: Move changelog entry to the Unreleased section
The #75985 bug fix entry was placed under the already-released 0.19.0
section. Move it to the Unreleased section so it is included in the next
release notes.
---------
Co-authored-by: Peter Wilson <519727+peterwilsoncc@users.noreply.github.com>
Co-authored-by: peterwilsoncc <peterwilsoncc@git.wordpress.org>
Co-authored-by: westonruter <westonruter@git.wordpress.org>
Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
Co-authored-by: desrosj <desrosj@git.wordpress.org>
Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
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