woocommerce_admin_allowed_promo_notes filter-hookWC 7.8.0

Filter allowed promo notes for experimental-activate-promo.

Usage

add_filter( 'woocommerce_admin_allowed_promo_notes', 'wp_kama_woocommerce_admin_allowed_promo_notes_filter' );

/**
 * Function for `woocommerce_admin_allowed_promo_notes` filter-hook.
 * 
 * @param array $promo_notes Array of allowed promo notes.
 *
 * @return array
 */
function wp_kama_woocommerce_admin_allowed_promo_notes_filter( $promo_notes ){

	// filter...
	return $promo_notes;
}
$promo_notes(array)
Array of allowed promo notes.

Changelog

Since 7.8.0 Introduced.

Where the hook is called

Notes::activate_promo_note()
woocommerce_admin_allowed_promo_notes
woocommerce/src/Admin/API/Notes.php 458
$allowed_promo_notes = apply_filters( 'woocommerce_admin_allowed_promo_notes', [] );

Where the hook is used in WooCommerce

woocommerce/src/Internal/Admin/WcPayWelcomePage.php 48
add_filter( 'woocommerce_admin_allowed_promo_notes', [ $this, 'allowed_promo_notes' ] );