Skip to content

Misc fixes for WordPress-Develop 7.0 merges#75985

Open
peterwilsoncc wants to merge 17 commits into
trunkfrom
fix/75984-misc-fixes
Open

Misc fixes for WordPress-Develop 7.0 merges#75985
peterwilsoncc wants to merge 17 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

Comment on lines +137 to +139
/**
* Fires as the {{PAGE_SLUG}} screen is initialized.
*/

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.

See also #78826

Comment on lines +137 to +139
/**
* Fires for {{PAGE_SLUG}} page extensions to register routes and menu items.
*/

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.

See also #78826

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.

Same for the other changes below.

}

/**
* Get the inline styles for the page.

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.

Suggested change
* Get the inline styles for the page.
* Get the inline styles for the {{PAGE_SLUG}} page.

@t-hamano

t-hamano commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

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 @since tags and restore deleted functions.

t-hamano and others added 2 commits June 2, 2026 20:48
# 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>
@t-hamano

t-hamano commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

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.

@t-hamano t-hamano added the Backport to WP Minor Release Pull request that needs to be backported to a WordPress minor release label Jun 2, 2026
t-hamano and others added 3 commits June 3, 2026 21:50
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backport to WP Minor Release Pull request that needs to be backported to a WordPress minor release [Package] Block library /packages/block-library [Type] Code Quality Issues or PRs that relate to code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants