Automattic\WooCommerce\Internal\Features

FeaturesController::register_additional_features()publicWC 1.0

Function to trigger the (now deprecated) woocommerce_register_feature_definitions

This function must execute immediately before the before_woocommerce_init is fired, so that feature compatibility declarations happening in that action find all the features properly declared already.

Метод класса: FeaturesController{}

Хуки из метода

Возвращает

null. Ничего (null).

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

$FeaturesController = new FeaturesController();
$FeaturesController->register_additional_features();

Код FeaturesController::register_additional_features() WC 9.8.1

public function register_additional_features() {
	if ( $this->registered_additional_features_via_action ) {
		return;
	}

	if ( empty( $this->features ) ) {
		$this->init_feature_definitions();
	}

	/**
	 * The action for registering features.
	 *
	 * @since 8.3.0
	 *
	 * @param FeaturesController $features_controller The instance of FeaturesController.
	 *
	 * @deprecated 9.9.0 Features should be defined directly in get_feature_definitions.
	 */
	do_action( 'woocommerce_register_feature_definitions', $this );

	$this->init_compatibility_info_by_feature();

	$this->registered_additional_features_via_action = true;
}