Backport: Navigation shared icon rendering functions to wp/7.0#79754
Conversation
…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
|
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. |
|
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.
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. |
…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>
- 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
- 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
What?
Backports #76372 to
wp/7.0so Navigation Link and Navigation Submenu use the shared submenu icon rendering helper.Why?
The PHP unit test job fails because
navigation-submenu.phpcallsblock_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-typesvendor/bin/phpcs packages/block-library/src/navigation-link/index.php packages/block-library/src/navigation-submenu/index.php packages/block-library/src/navigation/index.phpnpm 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_attributenpm 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'