wc_set_notices()WC 2.6.0

Set all notices at once.

No Hooks.

Return

null. Nothing (null).

Usage

wc_set_notices( $notices );
$notices(array[]) (required)
Array of notices.

Changelog

Since 2.6.0 Introduced.

wc_set_notices() code WC 9.3.3

function wc_set_notices( $notices ) {
	if ( ! did_action( 'woocommerce_init' ) ) {
		wc_doing_it_wrong( __FUNCTION__, __( 'This function should not be called before woocommerce_init.', 'woocommerce' ), '2.6' );
		return;
	}

	WC()->session->set( 'wc_notices', $notices );
}