Skip to content

Misc fixes for WordPress-Develop 7.0 merges#75985

Merged
t-hamano merged 23 commits into
trunkfrom
fix/75984-misc-fixes
Jul 18, 2026
Merged

Misc fixes for WordPress-Develop 7.0 merges#75985
t-hamano merged 23 commits into
trunkfrom
fix/75984-misc-fixes

Conversation

@peterwilsoncc

Copy link
Copy Markdown
Contributor

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

@github-actions github-actions Bot added the [Package] Block library /packages/block-library label Feb 26, 2026
@github-actions

github-actions Bot commented Feb 27, 2026

Copy link
Copy Markdown

Flaky tests detected in a7db588.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/28078360772
📝 Reported issues:

@peterwilsoncc peterwilsoncc left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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' );

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not quite correct but I am having trouble figuring out the difference between page and admin page templates.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@peterwilsoncc
peterwilsoncc marked this pull request as ready for review February 27, 2026 01:01
@github-actions

github-actions Bot commented Feb 27, 2026

Copy link
Copy Markdown

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: peterwilsoncc <peterwilsoncc@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@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>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@peterwilsoncc peterwilsoncc added the [Type] Code Quality Issues or PRs that relate to code quality label Feb 27, 2026
@peterwilsoncc peterwilsoncc changed the title Fix/75984 misc fixes Misc fixes for WordPress-Develop 7.0 merges Feb 27, 2026

@westonruter westonruter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tweak for sourceURL.

Comment thread packages/wp-build/templates/page-wp-admin.php.template Outdated
Co-authored-by: Weston Ruter <weston@ruter.net>
Comment thread packages/wp-build/templates/page-wp-admin.php.template Outdated
Comment thread packages/wp-build/templates/page.php.template Outdated
Co-authored-by: Weston Ruter <weston@ruter.net>
Comment on lines +126 to +142
/**
* 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();
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason this cannot be moved to deprecated.php in wordpress-develop instead now that it's deprecated and unmaintained going forward?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@t-hamano

Copy link
Copy Markdown
Contributor

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() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding the block_core_navigation_submenu_render_submenu_icon function, please note that it is being restored by #78484.

cc @westonruter @ramonjd

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or here if it's more convenient 😄

t-hamano and others added 2 commits May 31, 2026 20:22
# 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 t-hamano left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what I restored. This function was deleted by #74855, but I believe it needs to be restored to maintain full backward compatibility.

Comment on lines +199 to +202
wp_add_inline_style(
'{{PAGE_SLUG}}-wp-admin-prerequisites',
{{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_inline_styles()
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in bcc48d5

@t-hamano

Copy link
Copy Markdown
Contributor

If possible, let's ship this PR in 7.1. I think the sooner we restore the deleted function, the better.

@t-hamano t-hamano added Backport to WP 7.1 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta No Core Sync Required Indicates that any changes do not need to be synced to WordPress Core and removed Backport to WP Minor Release Pull request that needs to be backported to a WordPress minor release labels Jul 15, 2026
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>
@t-hamano t-hamano added Backwards Compatibility Issues or PRs that impact backwards compatability Backport to Gutenberg RC Pull request that needs to be backported to a Gutenberg release candidate (RC) labels Jul 17, 2026
t-hamano and others added 2 commits July 18, 2026 20:27
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.
@t-hamano

Copy link
Copy Markdown
Contributor

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.

@t-hamano
t-hamano merged commit 82f67e2 into trunk Jul 18, 2026
58 checks passed
@t-hamano
t-hamano deleted the fix/75984-misc-fixes branch July 18, 2026 12:33
@github-project-automation github-project-automation Bot moved this from 🔎 Needs Review to ✅ Done in WordPress 7.1 Editor Tasks Jul 18, 2026
@github-actions github-actions Bot added this to the Gutenberg 23.7 milestone Jul 18, 2026
@github-actions

Copy link
Copy Markdown

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.

# Checkout the wp/7.1 branch instead of trunk.
git checkout wp/7.1

# Create a new branch for your PR.
git checkout -b my-branch

# Cherry-pick the commit.
git cherry-pick 82f67e2ac32f81d1645a2a41dd991a5cde120ccf

# Check which files have conflicts.
git status

# Resolve the conflict...
# Add the resolved files to the staging area.
git status
git add .
git cherry-pick --continue

# Push the branch to the repository
git push origin my-branch

# Create a PR and set the base to the wp/7.1 branch.
# See https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-base-branch-of-a-pull-request.

@t-hamano

Copy link
Copy Markdown
Contributor

Removing the Backport to Gutenberg RC label from this PR and adding it to #80444 instead. This is because cherry-picking a manual backport pull request created for wp/7.1 is less likely to cause conflicts than cherry-picking a failed automatic cherry-pick.

@t-hamano t-hamano removed the Backport to Gutenberg RC Pull request that needs to be backported to a Gutenberg release candidate (RC) label Jul 18, 2026
t-hamano added a commit that referenced this pull request Jul 18, 2026
* 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>
@t-hamano

Copy link
Copy Markdown
Contributor

This PR was manually backported to the wp/7.1 branch by #80444.

@t-hamano t-hamano added Backported to WP Core Pull request that has been successfully merged into WP Core and removed Backport to WP 7.1 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta labels Jul 18, 2026
@github-actions

Copy link
Copy Markdown

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.

# Checkout the wp/7.1 branch instead of trunk.
git checkout wp/7.1

# Create a new branch for your PR.
git checkout -b my-branch

# Cherry-pick the commit.
git cherry-pick 82f67e2ac32f81d1645a2a41dd991a5cde120ccf

# Check which files have conflicts.
git status

# Resolve the conflict...
# Add the resolved files to the staging area.
git status
git add .
git cherry-pick --continue

# Push the branch to the repository
git push origin my-branch

# Create a PR and set the base to the wp/7.1 branch.
# See https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-base-branch-of-a-pull-request.

t-hamano added a commit that referenced this pull request Jul 21, 2026
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backported to WP Core Pull request that has been successfully merged into WP Core Backwards Compatibility Issues or PRs that impact backwards compatability No Core Sync Required Indicates that any changes do not need to be synced to WordPress Core [Package] Block library /packages/block-library [Type] Code Quality Issues or PRs that relate to code quality

Projects

Development

Successfully merging this pull request may close these issues.

6 participants