Created
January 16, 2024 15:11
-
-
Save webdados/86f77a29757bf5f03ab2fe510f54219b to your computer and use it in GitHub Desktop.
Show user email on WooCommerce order notes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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