Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks

Appearance::has_homepage()public staticWC 1.0

Check if the site has a homepage set up.

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

No Hooks.

Return

null. Nothing.

Usage

$result = Appearance::has_homepage();

Code of Appearance::has_homepage() WC 6.6.1

public static function has_homepage() {
	if ( 'classic' === get_option( 'classic-editor-replace' ) ) {
		return true;
	}

	$homepage_id = get_option( 'woocommerce_onboarding_homepage_post_id', false );

	if ( ! $homepage_id ) {
		return false;
	}

	$post      = get_post( $homepage_id );
	$completed = $post && 'publish' === $post->post_status;

	return $completed;
}