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
This commit is contained in:
Peter Wilson 2022-04-04 01:23:55 +00:00
parent ecfb9d6a3e
commit f99389a125

View File

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