Make WordPress Core

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

Backports the WP_Theme_JSON changes 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 -current on core/navigation-submenu in theme.json, including its :hover, :focus, :focus-visible and :active states.

The block's selectors.states selector arrives with the Gutenberg package sync, so the new test uses get_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.php
  • test_block_custom_states_navigation_submenu covers -current and -current with :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.

#2 @im3dabasia1
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?

#3 @audrasjb
3 weeks ago

  • Owner set to audrasjb
  • Status new → accepted

self assigning for commit

#4 @audrasjb
3 weeks ago

  • Resolution → fixed
  • Status accepted → closed

In 64600:

Editor: Support the current state for Navigation Submenu in theme.json.

This changeset backports the WP_Theme_JSON changes from GB76367, and is a follow-up to #64806.

Themes can 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.

The block's selectors.states selector arrives with the Gutenberg package sync, so the new test uses get_styles_for_block() with explicit style nodes, like the existing custom state tests.

Developed in:

Follow-up to #62641.

Props onemaggie.
Fixes #66312.
See #64806.

​@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 @wildworks
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

This ticket was mentioned in ​Slack in #core by audrasjb. ​View the logs.


12 days ago

#8 @audrasjb
12 days ago

As per today's bug scrub:
I mistakenly committed it before the change was made on Gutenberg side.
I think the best way is to revert it from Core. On it before beta 2.

#9 @audrasjb
12 days ago

In 64801:

Editor: Revert [64600].

This changeset was committed ahead of the related Gutenberg PR.

Unprops audrasjb.
See #66312, #64806.

Note: See TracTickets for help on using tickets.