WordPress filter hook
woocommerce_new_order_note_data
Defined by WooCommerce and fired by 6 plugins in total, running on 7M+ sites between them.
How to use woocommerce_new_order_note_data
It's a filter: your callback receives the value and 1 more argument, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'woocommerce_new_order_note_data', function( $value, $arg2 ) {
// Change $value here.
return $value;
}, 10, 2 );Argument names come from ALD's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
6 plugins that fire woocommerce_new_order_note_data
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
WooCommerce7+ million installs
apply_filters( 'woocommerce_new_order_note_data', array( 'comment_post_ID' => $this->get_id(), 'comment_author' => $comment_author, 'comment_author_email' => $comment_author_email, 'comment_author_url' => '', 'comment_content' => $note, 'comment_agent' => 'WooCommerce', 'comment_type' => 'order_note', 'comment_parent' => 0, 'comment_approved' => 1, ), array( 'order_id' => $this->get_id(), 'is_customer_note' => $is_customer_note, ) )includes/class-wc-order.php:2097 -
NP Quote Request for WooCommerce8,000+ installs
apply_filters( 'woocommerce_new_order_note_data', compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_agent', 'comment_type', 'comment_parent', 'comment_approved'), array('order_id' => $order->get_id(), 'is_customer_note' => 1) )includes/classes/gpls_woo_rfq_functions.php:1643 -
ALD8,000+ installs
apply_filters( 'woocommerce_new_order_note_data', array( 'comment_post_ID' => $order_id, 'comment_author' => '', 'comment_author_email' => __( 'WooCommerce', 'woocommerce' ), 'comment_author_url' => '', 'comment_content' => $note, 'comment_agent' => 'WooCommerce', 'comment_type' => 'order_note', 'comment_parent' => 0, 'comment_approved' => 1, ), array( 'order_id' => $order_id, 'is_customer_note' => 0, ) )admin/import_list.php:2225 -
DataFeedWatch Connector for WooCommerce600+ installs
apply_filters( 'woocommerce_new_order_note_data', array( 'comment_post_ID' => $orderId, 'comment_author' => $comment_author, 'comment_author_email' => $comment_author_email, 'comment_author_url' => '', 'comment_content' => $note, 'comment_agent' => 'WooCommerce', 'comment_type' => 'order_note', 'comment_parent' => 0, 'comment_approved' => 1, ), array( 'order_id' => $orderId, 'is_customer_note' => $isCustomerNote, ) )bridge2cart/bridge.php:6613 -
ChinaDS100+ installs
apply_filters( 'woocommerce_new_order_note_data', array( 'comment_post_ID' => $order_id, 'comment_author' => '', 'comment_author_email' => __( 'WooCommerce', 'woocommerce' ), 'comment_author_url' => '', 'comment_content' => $note, 'comment_agent' => 'WooCommerce', 'comment_type' => 'order_note', 'comment_parent' => 0, 'comment_approved' => 1, ), array( 'order_id' => $order_id, 'is_customer_note' => 0, ) )admin/import-list.php:1066 -
Api2Cart Bridge Connector40+ installs
apply_filters( 'woocommerce_new_order_note_data', array( 'comment_post_ID' => $orderId, 'comment_author' => $comment_author, 'comment_author_email' => $comment_author_email, 'comment_author_url' => '', 'comment_content' => $note, 'comment_agent' => 'WooCommerce', 'comment_type' => 'order_note', 'comment_parent' => 0, 'comment_approved' => 1, ), array( 'order_id' => $orderId, 'is_customer_note' => $isCustomerNote, ) )bridge2cart/bridge.php:6613
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.