WC_Install::is_new_install()public staticWC 3.2.0

Is this a brand new WC install?

A brand new install has no version yet. Also treat empty installs as 'new'.

Method of the class: WC_Install{}

No Hooks.

Return

true|false.

Usage

$result = WC_Install::is_new_install();

Changelog

Since 3.2.0 Introduced.

WC_Install::is_new_install() code WC 8.7.0

public static function is_new_install() {
	return is_null( get_option( 'woocommerce_version', null ) )
		|| (
			-1 === wc_get_page_id( 'shop' )
			&& 0 === array_sum( (array) wp_count_posts( 'product' ) )
		);
}