From e87b6c5fcb28027e6c2ed6fc214ad62d06c10e5a Mon Sep 17 00:00:00 2001 From: Jonny Harris Date: Thu, 25 Nov 2021 23:31:35 +0000 Subject: [PATCH 1/3] Use WP_Query --- .../block-library/src/navigation/index.php | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/packages/block-library/src/navigation/index.php b/packages/block-library/src/navigation/index.php index 5e58ff198a7a5a..8a23f0ca9b7a16 100644 --- a/packages/block-library/src/navigation/index.php +++ b/packages/block-library/src/navigation/index.php @@ -145,17 +145,22 @@ function block_core_navigation_get_first_non_empty_navigation() { // see: // - https://github.com/WordPress/wordpress-develop/blob/ba943e113d3b31b121f77a2d30aebe14b047c69d/src/wp-includes/nav-menu.php#L613-L619. // - https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters. - $navigation_posts = get_posts( - array( - 'post_type' => 'wp_navigation', - 'order' => 'ASC', - 'orderby' => 'name', - 'posts_per_page' => 1, // only the first post. - 's' => '