Automattic\WooCommerce\Utilities

FeaturesUtil::log_deprecated_feature_usageprivate staticWC 1.0

Log usage of a deprecated feature.

This method ensures logging only happens once per request to avoid spam.

Method of the class: FeaturesUtil{}

No Hooks.

Returns

null. Nothing (null).

Usage

$result = FeaturesUtil::log_deprecated_feature_usage( $feature_id, $deprecated_since ): void;
$feature_id(string) (required)
The feature id being checked.
$deprecated_since(string) (required)
The version since which the feature is deprecated.

FeaturesUtil::log_deprecated_feature_usage() code WC 10.5.0

private static function log_deprecated_feature_usage( string $feature_id, string $deprecated_since ): void {
	static $logged = array();

	if ( isset( $logged[ $feature_id ] ) ) {
		return;
	}
	$logged[ $feature_id ] = true;

	wc_deprecated_function(
		"FeaturesUtil::feature_is_enabled('{$feature_id}')",
		$deprecated_since
	);
}