Automattic\WooCommerce\Internal\Admin\Notes

MarketingJetpack::has_backups()protected staticWC 1.0

Check if this blog already has a Jetpack Backups product.

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

Хуков нет.

Возвращает

true|false. Whether or not this blog has backups.

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

$result = MarketingJetpack::has_backups();

Код MarketingJetpack::has_backups() WC 7.1.0

protected static function has_backups() {
	$product_ids = [];

	$plan = get_option( 'jetpack_active_plan' );
	if ( ! empty( $plan ) ) {
		$product_ids[] = $plan['product_id'];
	}

	$products = get_option( 'jetpack_site_products' );
	if ( ! empty( $products ) ) {
		foreach ( $products as $product ) {
			$product_ids[] = $product['product_id'];
		}
	}

	return (bool) array_intersect( self::BACKUP_IDS, $product_ids );
}