wc_print_notice()
Print a single notice immediately.
Хуки из функции
Возвращает
null
. Ничего.
Использование
wc_print_notice( $message, $notice_type, $data );
- $message(строка) (обязательный)
- The text to display in the notice.
- $notice_type(строка)
- The singular name of the notice type - either error, success or notice.
По умолчанию: 'success' - $data(массив)
- Optional notice data. @since 3.9.0.
По умолчанию: array()
Список изменений
С версии 2.1 | Введена. |
Код wc_print_notice() wc print notice WC 7.3.0
function wc_print_notice( $message, $notice_type = 'success', $data = array() ) { if ( 'success' === $notice_type ) { $message = apply_filters( 'woocommerce_add_message', $message ); } $message = apply_filters( 'woocommerce_add_' . $notice_type, $message ); wc_get_template( "notices/{$notice_type}.php", array( 'messages' => array( $message ), // @deprecated 3.9.0 'notices' => array( array( 'notice' => $message, 'data' => $data, ), ), ) ); }