woocommerce_enable_order_notes_field хук-фильтрWC 2.1.0

Allows 3rd parties to alter whether the customer note should be displayed on the admin.

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

add_filter( 'woocommerce_enable_order_notes_field', 'wp_kama_woocommerce_enable_order_notes_field_filter' );

/**
 * Function for `woocommerce_enable_order_notes_field` filter-hook.
 * 
 * @param bool $string TRUE if the note should be displayed. FALSE otherwise.
 *
 * @return bool
 */
function wp_kama_woocommerce_enable_order_notes_field_filter( $string ){

	// filter...
	return $string;
}
$string(true|false)
TRUE if the note should be displayed. FALSE otherwise.

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

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

Где вызывается хук

WC_Meta_Box_Order_Data::output()
woocommerce_enable_order_notes_field
woocommerce/includes/admin/meta-boxes/class-wc-meta-box-order-data.php 572
if ( apply_filters( 'woocommerce_enable_order_notes_field', 'yes' === get_option( 'woocommerce_enable_order_comments', 'yes' ) ) ) :
woocommerce/templates/checkout/form-shipping.php 53
<?php if ( apply_filters( 'woocommerce_enable_order_notes_field', 'yes' === get_option( 'woocommerce_enable_order_comments', 'yes' ) ) ) : ?>
woocommerce/includes/admin/meta-boxes/class-wc-meta-box-order-data.php 528
if ( apply_filters( 'woocommerce_enable_order_notes_field', 'yes' === get_option( 'woocommerce_enable_order_comments', 'yes' ) ) && $order->get_customer_note() ) { // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment

Где используется хук в WooCommerce

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