From 728832ad2b17616c8dab107019bf26a0f44e3c2a Mon Sep 17 00:00:00 2001 From: Dave Smith Date: Wed, 5 Oct 2022 15:21:26 +0100 Subject: [PATCH] Removes __unstableMaxPages attribute from Page List block (and Nav block) (#44415) * Removes unstable limit attribute * Remove attribute from Nav block --- docs/reference-guides/core-blocks.md | 2 +- packages/block-library/src/navigation/index.php | 3 --- packages/block-library/src/page-list/block.json | 6 +----- packages/block-library/src/page-list/index.php | 5 ----- 4 files changed, 2 insertions(+), 14 deletions(-) diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index e0d40a35d12167..11d6e281514740 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/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, - ), ), ); 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 fbb83a1fd9407f..ceffd4730a32db 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;