Automattic\WooCommerce\Internal\Features

FeaturesController::get_feature_definitionsprivateWC 1.0

Generate and cache the feature definitions.

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

Хуков нет.

Возвращает

Массив[].

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

// private - только в коде основоного (родительского) класса
$result = $this->get_feature_definitions();

Код FeaturesController::get_feature_definitions() WC 10.4.3

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

	if ( ! $this->registered_additional_features_via_class_calls ) {
		// This needs to be set to true *before* additional feature definition calls are made,
		// to prevent infinite loops in case one of these calls ends up calling here again.
		$this->registered_additional_features_via_class_calls = true;

		// Additional feature definitions.
		// These used to be tied to the now deprecated woocommerce_register_feature_definitions action,
		// and aren't processed in init_feature_definitions to avoid circular calls in the dependency injection container.
		$container = wc_get_container();
		$container->get( CustomOrdersTableController::class )->add_feature_definition( $this );
		$container->get( CostOfGoodsSoldController::class )->add_feature_definition( $this );

		$this->init_compatibility_info_by_feature();
	}

	return $this->features;
}