WC_Admin_Marketplace_Promotions::get_active_promotions
Get active Marketplace promotions from the transient. Use woocommerce_marketplace_suppress_promotions to suppress promotions.
Method of the class: WC_Admin_Marketplace_Promotions{}
Hooks from the method
Returns
null. Nothing (null).
Usage
$result = WC_Admin_Marketplace_Promotions::get_active_promotions();
Changelog
| Since 9.0 | Introduced. |
WC_Admin_Marketplace_Promotions::get_active_promotions() WC Admin Marketplace Promotions::get active promotions code WC 10.6.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 );
}