WC_Install::is_new_install() public WC 3.2.0
Is this a brand new WC install?
A brand new install has no version yet. Also treat empty installs as 'new'.
{} Это метод класса: WC_Install{}
Хуков нет.
Возвращает
true/false.
Использование
$result = WC_Install::is_new_install();
Список изменений
С версии 3.2.0 | Введена. |
Код WC_Install::is_new_install() WC Install::is new install WC 5.0.0
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' ) );
}