Opened 3 weeks ago
Last modified 12 days ago
#66312 reopened enhancement
Editor: Support the current state for Navigation Submenu in theme.json
| Reported by: | onemaggie | Owned by: | audrasjb |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.2 |
| Component: | Editor | Version: | |
| Severity: | normal | Keywords: | gutenberg-merge has-patch has-unit-tests |
| Cc: | Focuses: |
Description
Follow-up to #64806.https://github.com/WordPress/gutenberg/pull/76367 lets themes style the current link inside a Navigation Submenu dropdown with -current on core/navigation-submenu in theme.json, including its :hover, :focus, :focus-visible and :active states.This ticket tracks the WP_Theme_JSON backport, which adds core/navigation-submenu to VALID_BLOCK_PSEUDO_SELECTORS and VALID_BLOCK_CUSTOM_STATES. The block's selectors.states selector arrives with the package sync.
Change History (9)
This ticket was mentioned in PR #14284 on WordPress/wordpress-develop by @onemaggie.
3 weeks ago
#1
- Keywords has-patch has-unit-tests added
#2
@
3 weeks ago
I’m going through the 7.2 tickets ahead of beta 1.
Thank you for the work on this, @onemaggie. I see the Gutenberg PR has had some activity recently, which is great to see.
With beta 1 only a few days away, is 7.2 a realistic target?
@onemaggie commented on PR #14284:
3 weeks ago
#5
hey @audrasjb did you commit this to core? the GB PR didn't make it in. It had some feedback that I couldn't address in time for the release
#6
@
2 weeks ago
- Resolution fixed
- Status closed → reopened
r64600 was committed before the corresponding Gutenberg PR was merged and synced to Core, so Core is now in an inconsistent state.
I think we should either revert r64600, or merge the Gutenberg PR and get it into 7.2 via a cherry-pick to the wp/7.2 branch and a package sync. However, since this ticket is an enhancement and we are past Beta 1, we should first confirm with the release leads whether bringing the Gutenberg change into 7.2 is allowed.
cc @Mamaduka @peterwilsoncc
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Backports the
WP_Theme_JSONchanges from Gutenberg #76367, a follow-up to https://github.com/WordPress/wordpress-develop/pull/11174 ([62641]).Themes can style the current link inside a Navigation Submenu dropdown with
-currentoncore/navigation-submenuin theme.json, including its:hover,:focus,:focus-visibleand:activestates.The block's
selectors.statesselector arrives with the Gutenberg package sync, so the new test usesget_styles_for_block()with explicit style nodes, like the existing custom state tests.Testing
vendor/bin/phpcs src/wp-includes/class-wp-theme-json.php tests/phpunit/tests/theme/wpThemeJson.phptest_block_custom_states_navigation_submenucovers-currentand-currentwith:hover. It fails without the constant changes.Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Translating the Gutenberg changes to their WordPress Core counterparts, adding a test, running validation, and drafting the pull request.