WordPress at Your Fingertips
function is not described

WP_Customize_Manager::has_published_pages() public WP 4.7.0

Return whether there are published pages.

Used as active callback for static front page section and controls.

{} It's a method of the class: WP_Customize_Manager{}

No Hooks.

Return

true|false. Whether there are published (or to be published) pages.

Usage

$WP_Customize_Manager = new WP_Customize_Manager();
$WP_Customize_Manager->has_published_pages();

Changelog

Since 4.7.0 Introduced.

Code of WP_Customize_Manager::has_published_pages() WP 5.8.1

public function has_published_pages() {

	$setting = $this->get_setting( 'nav_menus_created_posts' );
	if ( $setting ) {
		foreach ( $setting->value() as $post_id ) {
			if ( 'page' === get_post_type( $post_id ) ) {
				return true;
			}
		}
	}
	return 0 !== count( get_pages() );
}