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.


Built from https://develop.svn.wordpress.org/trunk@53057


git-svn-id: http://core.svn.wordpress.org/trunk@52646 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Peter Wilson 2022-04-04 01:25:08 +00:00
parent 8ddb40d7a0
commit 881e4f054b
2 changed files with 2 additions and 2 deletions

View File

@ -5750,7 +5750,7 @@ final class WP_Customize_Manager {
}
}
}
return 0 !== count( get_pages() );
return 0 !== count( get_pages( array( 'number' => 1 ) ) );
}
/**

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.0-alpha-53056';
$wp_version = '6.0-alpha-53057';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.