WC_Install::is_new_install()

Is this a brand new WC install?


Description Description

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


Return Return

(boolean)


Top ↑

Source Source

File: includes/class-wc-install.php

	public static function is_new_install() {
		$product_count = array_sum( (array) wp_count_posts( 'product' ) );

		return is_null( get_option( 'woocommerce_version', null ) ) || ( 0 === $product_count && -1 === wc_get_page_id( 'shop' ) );
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.2.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.