WordPress at Your Fingertips
function is not described

WC_WCCOM_Site_Installer::activate_product() private WC 3.7.0

Activate product given its product ID.

{} It's a method of the class: WC_WCCOM_Site_Installer{}

No Hooks.

Return

\WP_Error|null.

Usage

$result = WC_WCCOM_Site_Installer::activate_product( $product_id );
$product_id(int) (required)
Product ID.

Changelog

Since 3.7.0 Introduced.

Code of WC_WCCOM_Site_Installer::activate_product() WC 5.6.0

private static function activate_product( $product_id ) {
	$steps = self::get_state( 'steps' );
	if ( ! $steps[ $product_id ]['activate'] ) {
		return null;
	}

	if ( 'plugin' === $steps[ $product_id ]['product_type'] ) {
		return self::activate_plugin( $product_id );
	}
	return self::activate_theme( $product_id );
}