Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#60410 closed enhancement (fixed)

TT4: Wrap Navigation block in Row within the header.html template part

Reported by: tomjcafferkey Owned by: swissspidy
Priority: normal Milestone: 6.5
Component: Bundled Theme Version: 6.5
Severity: normal Keywords: has-patch commit
Cc: Focuses:

Description

Now that the Block Hooks API has been released as part of WordPress 6.4 3PDs may want to insert their own blocks into the header of the TT4 theme, specifically after the Navigation block. This currently causes problems because the Navigation block and it's siblings are treated as flex items due to its parent being a Row block.

Change History (8)

This ticket was mentioned in PR #6001 on WordPress/wordpress-develop by @tomjcafferkey.


3 years ago
#1

  • Keywords has-patch added; needs-patch removed

Now that the Block Hooks API has been released as part of WordPress 6.4 3PDs may want to insert their own blocks into the header, specifically after the Navigation block. This currently causes problems because the Navigation block and it's siblings are treated as flex items due to its parent being a Row block.

This PR wraps the Navigation block within a Row block of its own. By default the behaviour of the header should remain the same and introduce no regressions but this now means plugins are able to use the Block Hooks API to automatically insert their own blocks using the Navigation as an anchor block without them being treated as flex items (e.g. Mini Cart or My Account blocks)

Trac ticket: https://core.trac.wordpress.org/ticket/60410#ticket

## Testing instructions

  1. Ensure that the TT4 default header behaves the same on various viewport sizes and browsers, and no regressions have been introduced by this change.

#2 @poena
3 years ago

  • Keywords needs-testing added
  • Milestone Awaiting Review6.5

#3 @poena
3 years ago

I have tested this on WordPress 6.4.3 on MacOS with Safari, Firefox, Chrome,
with different browser widths and different type of menus (short, long, links only, varied blocks like search, login/out, site logo.)

I have only tested for regressions in the layout and I do not see any.
I did not test block hooks with the new design.

#4 @poena
3 years ago

  • Keywords commit added; needs-testing removed

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


3 years ago

#6 @swissspidy
3 years ago

  • Owner set to swissspidy
  • Status newreviewing

#7 @swissspidy
3 years ago

  • Resolutionfixed
  • Status reviewingclosed

In 57621:

Twenty Twenty-Four: Wrap header navigation block in row.

Makes it easier to add siblings using the block hooks API without them being treated as flex items due to its parent being a row block.

Props tomjcafferkey, poena.
Fixes #60410.

Note: See TracTickets for help on using tickets.