woocommerce_enable_order_notes_field filter-hookWC 2.1.0

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

Usage

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.

Changelog

Since 2.1.0 Introduced.

Where the hook is called

WC_Meta_Box_Order_Data::output()
woocommerce_enable_order_notes_field
woocommerce/includes/admin/meta-boxes/class-wc-meta-box-order-data.php 614
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 564
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/templates/checkout/form-shipping.php 53
<?php if ( apply_filters( 'woocommerce_enable_order_notes_field', 'yes' === get_option( 'woocommerce_enable_order_comments', 'yes' ) ) ) : ?>

Where the hook is used in WooCommerce

Usage not found.