From f99389a125599da16399d30a717505aba7f8fdfa Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Mon, 4 Apr 2022 01:23:55 +0000 Subject: [PATCH] Customizer: Improve performance checking for published pages. Improve the performance of `WP_Customize_Manager::has_published_pages()` by limiting the database query to a single published page, down from querying all published pages. Props nagpai, dlh, tyxla. Fixes #55425. git-svn-id: https://develop.svn.wordpress.org/trunk@53057 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-customize-manager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/class-wp-customize-manager.php b/src/wp-includes/class-wp-customize-manager.php index aaeb9d081d..816665fa2d 100644 --- a/src/wp-includes/class-wp-customize-manager.php +++ b/src/wp-includes/class-wp-customize-manager.php @@ -5750,7 +5750,7 @@ final class WP_Customize_Manager { } } } - return 0 !== count( get_pages() ); + return 0 !== count( get_pages( array( 'number' => 1 ) ) ); } /**