Automattic\WooCommerce\Internal\Admin\Notes

MarketingJetpack::has_backups()protected staticWC 1.0

Check if this blog already has a Jetpack Backups product.

Method of the class: MarketingJetpack{}

No Hooks.

Return

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

Usage

$result = MarketingJetpack::has_backups();

MarketingJetpack::has_backups() code WC 7.1.1

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 );
}