Automattic\WooCommerce\Internal\Admin\WCPayPromotion

Init::get_wc_pay_promotion_spec()public staticWC 1.0

Get WC Pay promotion spec.

Method of the class: Init{}

No Hooks.

Return

null. Nothing.

Usage

$result = Init::get_wc_pay_promotion_spec();

Init::get_wc_pay_promotion_spec() code WC 7.1.0

public static function get_wc_pay_promotion_spec() {
	$promotions            = self::get_promotions();
	$wc_pay_promotion_spec = array_values(
		array_filter(
			$promotions,
			function( $promotion ) {
				return isset( $promotion->plugins ) && in_array( 'woocommerce-payments', $promotion->plugins, true );
			}
		)
	);

	return current( $wc_pay_promotion_spec );
}