Skip to content

Backport: Navigation shared icon rendering functions to wp/7.0#79754

Merged
cbravobernal merged 2 commits into
wp/7.0from
codex/test-pr-76372-wp70
Jul 1, 2026
Merged

Backport: Navigation shared icon rendering functions to wp/7.0#79754
cbravobernal merged 2 commits into
wp/7.0from
codex/test-pr-76372-wp70

Conversation

@cbravobernal

Copy link
Copy Markdown
Contributor

What?

Backports #76372 to wp/7.0 so Navigation Link and Navigation Submenu use the shared submenu icon rendering helper.

Why?

The PHP unit test job fails because navigation-submenu.php calls block_core_navigation_render_submenu_icon(), which is unavailable in the failing CI environment. This change uses the shared helper and preserves the Gutenberg-plugin prefixed call path.

Testing

  • npm run build -- --skip-types
  • vendor/bin/phpcs packages/block-library/src/navigation-link/index.php packages/block-library/src/navigation-submenu/index.php packages/block-library/src/navigation/index.php
  • npm run wp-env-test -- run --env-cwd='wp-content/plugins/gutenberg' wordpress vendor/bin/phpunit -c phpunit.xml.dist --filter Render_Block_Navigation_Submenu_Test::test_should_apply_open_on_click_for_legacy_openSubmenusOnClick_attribute
  • npm run wp-env-test -- run --env-cwd='wp-content/plugins/gutenberg' wordpress vendor/bin/phpunit -c phpunit.xml.dist --filter 'Render_Block_Navigation_Test|Block_Library_Navigation_Link_Test|Render_Block_Navigation_Submenu_Test|Block_Core_Navigation_Submenu_Render_Submenu_Icon_Test'

…n blocks (#76372)

* Navigation: Use the shared icon rendering functions for all navigation blocks

* update function to call the prefixed version

* implement IS_GUTENBERG_PLUGIN check
@github-actions github-actions Bot added the [Package] Block library /packages/block-library label Jul 1, 2026
@cbravobernal
cbravobernal marked this pull request as ready for review July 1, 2026 15:20
@github-actions

github-actions Bot commented Jul 1, 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: scruffian <scruffian@git.wordpress.org>
Co-authored-by: andrewserong <andrewserong@git.wordpress.org>
Co-authored-by: aaronjorbin <jorbin@git.wordpress.org>

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

@cbravobernal
cbravobernal requested a review from aaronjorbin July 1, 2026 15:20
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Required label: Any label starting with [Type].
  • Labels found: [Package] Block library.

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

@cbravobernal cbravobernal added the [Type] Bug An existing feature does not function as intended label Jul 1, 2026
@cbravobernal cbravobernal self-assigned this Jul 1, 2026
…in tests (#79300)

WordPress core changed `wp_get_elements_class_name()` from an md5 hash of the
serialized block (`wp-elements-{md5}`) to a sequential id via
`wp_unique_prefixed_id()` (`wp-elements-1`, `wp-elements-2`, …), to avoid class
name collisions between identical blocks.

The element support test asserted the md5 form, so it fails against the newer
core. Gutenberg runs against the current and previous WordPress versions — md5
on older cores, sequential on newer — so the patterns now accept either form to
stay green across all supported versions.

No production change is needed: `lib/block-supports/elements.php` calls
`wp_get_elements_class_name()` with an argument the newer (no-arg) function
ignores, while older cores still require it.

Co-authored-by: andrewserong <andrewserong@git.wordpress.org>
Co-authored-by: talldan <talldanwp@git.wordpress.org>

@aaronjorbin aaronjorbin 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.

Thank you!

@cbravobernal
cbravobernal merged commit a685aba into wp/7.0 Jul 1, 2026
45 checks passed
@cbravobernal
cbravobernal deleted the codex/test-pr-76372-wp70 branch July 1, 2026 16:08
pento pushed a commit to WordPress/wordpress-develop that referenced this pull request Jul 1, 2026
- Backport package version bump (WordPress/gutenberg#79676)
- Revisions: Use CSS outline as secondary non-color indicator for diff blocks (WordPress/gutenberg#78393)
- Editor: Move focus to revisions slider when entering revisions mode (WordPress/gutenberg#79691)
- Avoid dirtying related navigation entities during passive render (WordPress/gutenberg#79000)
- Navigation: Use block context to determine whether Page List is nested in Submenu (WordPress/gutenberg#79048)
- Mark all controlled/mode block changes non-persistent (WordPress/gutenberg#79350)
- Fix wp/7.0 cherry-pick lint errors (WordPress/gutenberg#79737)
- Custom HTML: Fix scrollbar after tab switch in modal (WordPress/gutenberg#78571)
- Template Part: Remove restriction on tabs / inspector fills (WordPress/gutenberg#79181)
- wp-build: Fix black flash on wp-admin pages before hydration (WordPress/gutenberg#78493)
- Navigation: Restore block_core_navigation_submenu_render_submenu_icon() as deprecated shim (WordPress/gutenberg#78484)
- Guard PHP unit test to avoid failures on old wp versions (WordPress/gutenberg#78547)
- Image: Fix missing aria-label on lightbox trigger button for single images (WordPress/gutenberg#78426)
- useCopyToClipboard: Always call onSuccess callback (WordPress/gutenberg#78387)
- Block Editor: Fix blockGap fallback parsing for nested var() values (WordPress/gutenberg#77750)
- Backport: Navigation shared icon rendering functions to wp/7.0 (WordPress/gutenberg#79754)

Reviewed-by cbravobernal.

Fixes #65566.


git-svn-id: https://develop.svn.wordpress.org/branches/7.0@62610 602fd350-edb4-49c9-b593-d223f7449a82
markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request Jul 1, 2026
- Backport package version bump (WordPress/gutenberg#79676)
- Revisions: Use CSS outline as secondary non-color indicator for diff blocks (WordPress/gutenberg#78393)
- Editor: Move focus to revisions slider when entering revisions mode (WordPress/gutenberg#79691)
- Avoid dirtying related navigation entities during passive render (WordPress/gutenberg#79000)
- Navigation: Use block context to determine whether Page List is nested in Submenu (WordPress/gutenberg#79048)
- Mark all controlled/mode block changes non-persistent (WordPress/gutenberg#79350)
- Fix wp/7.0 cherry-pick lint errors (WordPress/gutenberg#79737)
- Custom HTML: Fix scrollbar after tab switch in modal (WordPress/gutenberg#78571)
- Template Part: Remove restriction on tabs / inspector fills (WordPress/gutenberg#79181)
- wp-build: Fix black flash on wp-admin pages before hydration (WordPress/gutenberg#78493)
- Navigation: Restore block_core_navigation_submenu_render_submenu_icon() as deprecated shim (WordPress/gutenberg#78484)
- Guard PHP unit test to avoid failures on old wp versions (WordPress/gutenberg#78547)
- Image: Fix missing aria-label on lightbox trigger button for single images (WordPress/gutenberg#78426)
- useCopyToClipboard: Always call onSuccess callback (WordPress/gutenberg#78387)
- Block Editor: Fix blockGap fallback parsing for nested var() values (WordPress/gutenberg#77750)
- Backport: Navigation shared icon rendering functions to wp/7.0 (WordPress/gutenberg#79754)

Reviewed-by cbravobernal.

Fixes #65566.

Built from https://develop.svn.wordpress.org/branches/7.0@62610


git-svn-id: http://core.svn.wordpress.org/branches/7.0@61890 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Block library /packages/block-library [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants