Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks

Appearance::has_homepage()public staticWC 1.0

Check if the site has a homepage set up.

{} Это метод класса: Appearance{}

Хуков нет.

Возвращает

null. Ничего.

Использование

$result = Appearance::has_homepage();

Код Appearance::has_homepage() WC 7.1.0

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

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

	if ( ! $homepage_id ) {
		return false;
	}

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

	return $completed;
}