WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\Domain\Services

FeatureGating::load_flag() public WC 1.0

Set correct flag.

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

No Hooks.

Return

null. Nothing.

Usage

$FeatureGating = new FeatureGating();
$FeatureGating->load_flag();

Code of FeatureGating::load_flag() WC 5.9.0

public function load_flag() {
	if ( 0 === $this->flag ) {
		$default_flag = defined( 'WC_BLOCKS_IS_FEATURE_PLUGIN' ) ? self::FEATURE_PLUGIN_FLAG : self::CORE_FLAG;

		if ( file_exists( __DIR__ . '/../../../blocks.ini' ) ) {
			$allowed_flags = [ self::EXPERIMENTAL_FLAG, self::FEATURE_PLUGIN_FLAG, self::CORE_FLAG ];
			$woo_options   = parse_ini_file( __DIR__ . '/../../../blocks.ini' );
			$this->flag    = is_array( $woo_options ) && in_array( intval( $woo_options['woocommerce_blocks_phase'] ), $allowed_flags, true ) ? $woo_options['woocommerce_blocks_phase'] : $default_flag;
		} else {
			$this->flag = $default_flag;
		}
	}
}