Created
May 14, 2015 15:27
-
-
Save WillBrubaker/c94e2e55a83dc9e8658d to your computer and use it in GitHub Desktop.
Adds user roles to the customer export when using WooCommerce Customer/Order CSV Export
This file contains hidden or 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
add_filter( 'wc_customer_order_csv_export_customer_headers', 'wooninja_customer_headers' ); | |
function wooninja_customer_headers( $column_headers ) { | |
$column_headers['user_role'] = 'user_role'; | |
return $column_headers; | |
} | |
add_filter( 'wc_customer_order_csv_export_customer_row', 'wooninja_customer_role', 10, 2 ); | |
function wooninja_customer_role( $customer_data, $user ) { | |
$customer_data['user_role'] = implode( ' ', $user->roles ); | |
return $customer_data; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment