woocommerce_email_log_add_order_note filter-hookWC 10.9.0

Filter whether to add an order note for this transactional email attempt.

Return false to suppress the order note for a particular email or globally, while still allowing the WooCommerce logger entry to be written.

Usage

add_filter( 'woocommerce_email_log_add_order_note', 'wp_kama_woocommerce_email_log_add_order_note_filter', 10, 4 );

/**
 * Function for `woocommerce_email_log_add_order_note` filter-hook.
 * 
 * @param bool     $enabled  Whether to add the order note.
 * @param string   $email_id The email type ID.
 * @param WC_Email $email    The WC_Email instance.
 * @param WC_Order $order    The order the note would be added to.
 *
 * @return bool
 */
function wp_kama_woocommerce_email_log_add_order_note_filter( $enabled, $email_id, $email, $order ){

	// filter...
	return $enabled;
}
$enabled(true|false)
Whether to add the order note.
$email_id(string)
The email type ID.
$email(WC_Email)
The WC_Email instance.
$order(WC_Order)
The order the note would be added to.

Changelog

Since 10.9.0 Introduced.

Where the hook is called

EmailLogger::maybe_add_order_note()
woocommerce_email_log_add_order_note
woocommerce/src/Internal/Email/EmailLogger.php 170
if ( ! apply_filters( 'woocommerce_email_log_add_order_note', true, $email_id, $email, $wc_object ) ) {

Where the hook is used in WooCommerce

Usage not found.