From 7dd8d6bf6d37bc2df44cf018a319e6d82859f473 Mon Sep 17 00:00:00 2001 From: tellthemachines Date: Fri, 19 Sep 2025 14:36:53 +1000 Subject: [PATCH 1/2] Try adding content roles to navigation blocks --- docs/reference-guides/core-blocks.md | 2 +- packages/block-library/src/navigation-link/block.json | 3 ++- packages/block-library/src/navigation-submenu/block.json | 3 ++- packages/block-library/src/navigation/block.json | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index fe2a5f65aaebf1..36d2add3e80667 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -517,7 +517,7 @@ A collection of blocks that allow visitors to get around your site. ([Source](ht - **Name:** core/navigation - **Category:** theme - **Allowed Blocks:** core/navigation-link, core/search, core/social-links, core/page-list, core/spacer, core/home-link, core/site-title, core/site-logo, core/navigation-submenu, core/loginout, core/buttons -- **Supports:** align (full, wide), ariaLabel, inserter, interactivity, layout (allowSizingOnChildren, default, ~~allowInheriting~~, ~~allowSwitching~~, ~~allowVerticalAlignment~~), spacing (blockGap, units), typography (fontSize, lineHeight), ~~html~~, ~~renaming~~ +- **Supports:** align (full, wide), ariaLabel, contentRole, inserter, interactivity, layout (allowSizingOnChildren, default, ~~allowInheriting~~, ~~allowSwitching~~, ~~allowVerticalAlignment~~), spacing (blockGap, units), typography (fontSize, lineHeight), ~~html~~, ~~renaming~~ - **Attributes:** __unstableLocation, backgroundColor, customBackgroundColor, customOverlayBackgroundColor, customOverlayTextColor, customTextColor, hasIcon, icon, maxNestingLevel, openSubmenusOnClick, overlayBackgroundColor, overlayMenu, overlayTextColor, ref, rgbBackgroundColor, rgbTextColor, showSubmenuIcon, templateLock, textColor ## Custom Link diff --git a/packages/block-library/src/navigation-link/block.json b/packages/block-library/src/navigation-link/block.json index 2762bd24e446a6..5f2d10b97dabe8 100644 --- a/packages/block-library/src/navigation-link/block.json +++ b/packages/block-library/src/navigation-link/block.json @@ -14,7 +14,8 @@ "textdomain": "default", "attributes": { "label": { - "type": "string" + "type": "string", + "role": "content" }, "type": { "type": "string" diff --git a/packages/block-library/src/navigation-submenu/block.json b/packages/block-library/src/navigation-submenu/block.json index e767b60aec3a6c..be56628e6142eb 100644 --- a/packages/block-library/src/navigation-submenu/block.json +++ b/packages/block-library/src/navigation-submenu/block.json @@ -9,7 +9,8 @@ "textdomain": "default", "attributes": { "label": { - "type": "string" + "type": "string", + "role": "content" }, "type": { "type": "string" diff --git a/packages/block-library/src/navigation/block.json b/packages/block-library/src/navigation/block.json index c65e0c6224616e..249193e1cc234a 100644 --- a/packages/block-library/src/navigation/block.json +++ b/packages/block-library/src/navigation/block.json @@ -138,7 +138,8 @@ } }, "interactivity": true, - "renaming": false + "renaming": false, + "contentRole": true }, "editorStyle": "wp-block-navigation-editor", "style": "wp-block-navigation" From 085e6d5b71d713b93ee686ef6d672176e8f13fb6 Mon Sep 17 00:00:00 2001 From: tellthemachines Date: Mon, 22 Sep 2025 10:01:40 +1000 Subject: [PATCH 2/2] Add contentRole to Page list block --- docs/reference-guides/core-blocks.md | 2 +- packages/block-library/src/page-list/block.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index 36d2add3e80667..6c8bc80bbf7b4d 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -557,7 +557,7 @@ Display a list of all pages. ([Source](https://github.com/WordPress/gutenberg/tr - **Name:** core/page-list - **Category:** widgets - **Allowed Blocks:** core/page-list-item -- **Supports:** color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ +- **Supports:** color (background, gradients, link, text), contentRole, interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ - **Attributes:** isNested, parentPageID ## Page List Item diff --git a/packages/block-library/src/page-list/block.json b/packages/block-library/src/page-list/block.json index 8802022382241a..317502b1200b49 100644 --- a/packages/block-library/src/page-list/block.json +++ b/packages/block-library/src/page-list/block.json @@ -76,7 +76,8 @@ "padding": false, "margin": false } - } + }, + "contentRole": true }, "editorStyle": "wp-block-page-list-editor", "style": "wp-block-page-list"