Skip to content

Instantly share code, notes, and snippets.

@webdados
Created January 16, 2024 15:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webdados/86f77a29757bf5f03ab2fe510f54219b to your computer and use it in GitHub Desktop.
Save webdados/86f77a29757bf5f03ab2fe510f54219b to your computer and use it in GitHub Desktop.
Show user email on WooCommerce order notes
<?php
/* Also show the user email on the WooCommerce order notes */
add_filter( 'woocommerce_get_order_note', function( $note, $data ) {
if ( $note['added_by'] !== 'system' ) {
$note['added_by'] .= ' (' . $data->comment_author_email . ')';
}
return $note;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment