WC_Admin_Marketplace_Promotions::get_active_promotions()public staticWC 9.0

Get active Marketplace promotions from the transient. Use woocommerce_marketplace_suppress_promotions to suppress promotions.

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

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

Возвращает

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

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

$result = WC_Admin_Marketplace_Promotions::get_active_promotions();

Список изменений

С версии 9.0 Введена.

Код WC_Admin_Marketplace_Promotions::get_active_promotions() WC 9.4.2

public static function get_active_promotions() {
	/**
	 * Filter to suppress the requests for and showing of marketplace promotions.
	 *
	 * @since 8.8
	 */
	if ( apply_filters( 'woocommerce_marketplace_suppress_promotions', false ) ) {
		return array();
	}

	$promotions = get_transient( self::TRANSIENT_NAME );
	if ( ! $promotions ) {
		return array();
	}

	$promotions = self::merge_promos( $promotions );

	return self::filter_out_inactive_promotions( $promotions );
}