From 5f4ec1003fc9ca40a2395ae8283d6fa3c6666d7f Mon Sep 17 00:00:00 2001 From: Dave Smith Date: Fri, 23 Sep 2022 09:36:14 +0100 Subject: [PATCH 1/2] Removes unstable limit attribute --- docs/reference-guides/core-blocks.md | 2 +- packages/block-library/src/page-list/block.json | 6 +----- packages/block-library/src/page-list/index.php | 5 ----- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index 165cdff2902e91..85c4f157e8811b 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -429,7 +429,7 @@ Display a list of all pages. ([Source](https://github.com/WordPress/gutenberg/tr - **Name:** core/page-list - **Category:** widgets - **Supports:** ~~html~~, ~~reusable~~ -- **Attributes:** __unstableMaxPages +- **Attributes:** ## Paragraph diff --git a/packages/block-library/src/page-list/block.json b/packages/block-library/src/page-list/block.json index 89309cad22b040..3068a1fb8bc008 100644 --- a/packages/block-library/src/page-list/block.json +++ b/packages/block-library/src/page-list/block.json @@ -7,11 +7,7 @@ "description": "Display a list of all pages.", "keywords": [ "menu", "navigation" ], "textdomain": "default", - "attributes": { - "__unstableMaxPages": { - "type": "number" - } - }, + "attributes": {}, "usesContext": [ "textColor", "customTextColor", diff --git a/packages/block-library/src/page-list/index.php b/packages/block-library/src/page-list/index.php index 89a8ea1b071be3..75a62bab2756cb 100644 --- a/packages/block-library/src/page-list/index.php +++ b/packages/block-library/src/page-list/index.php @@ -299,11 +299,6 @@ function render_block_core_page_list( $attributes, $content, $block ) { $nested_pages = block_core_page_list_nest_pages( $top_level_pages, $pages_with_children ); - // Limit the number of items to be visually displayed. - if ( ! empty( $attributes['__unstableMaxPages'] ) ) { - $nested_pages = array_slice( $nested_pages, 0, $attributes['__unstableMaxPages'] ); - } - $is_navigation_child = array_key_exists( 'showSubmenuIcon', $block->context ); $open_submenus_on_click = array_key_exists( 'openSubmenusOnClick', $block->context ) ? $block->context['openSubmenusOnClick'] : false; From 2f22ddb707012901ecb64e0bd5b95f126ef831cb Mon Sep 17 00:00:00 2001 From: Dave Smith Date: Fri, 23 Sep 2022 09:43:10 +0100 Subject: [PATCH 2/2] Remove attribute from Nav block --- packages/block-library/src/navigation/index.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/block-library/src/navigation/index.php b/packages/block-library/src/navigation/index.php index 5173f96040b4d0..33e1ebdbab56d4 100644 --- a/packages/block-library/src/navigation/index.php +++ b/packages/block-library/src/navigation/index.php @@ -307,9 +307,6 @@ function block_core_navigation_get_fallback_blocks() { $page_list_fallback = array( array( 'blockName' => 'core/page-list', - 'attrs' => array( - '__unstableMaxPages' => 4, - ), ), );