woocommerce_enable_order_notes_field
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
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' ) ) ) : ?>