Automattic\WooCommerce\Internal\Admin\WCPayPromotion

Init::get_promotions()public staticWC 1.0

Go through the specs and run them.

Method of the class: Init{}

No Hooks.

Return

null. Nothing.

Usage

$result = Init::get_promotions();

Init::get_promotions() code WC 7.1.1

public static function get_promotions() {
	$suggestions = array();
	$specs       = self::get_specs();

	foreach ( $specs as $spec ) {
		$suggestion    = EvaluateSuggestion::evaluate( $spec );
		$suggestions[] = $suggestion;
	}

	return array_values(
		array_filter(
			$suggestions,
			function( $suggestion ) {
				return ! property_exists( $suggestion, 'is_visible' ) || $suggestion->is_visible;
			}
		)
	);

}