Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //functions.php file in your theme
- //1. First, add a new column "custom". It has to be named : '_custom_key_' followed by whatever your want (no spaces.)
- // for exemple : _custom_key_whatever
- function my_custom_csv_columns($keys)
- {
- $keys[] = '_custom_key_whatever';
- return $keys;
- }
- add_filter( 'wqep_included_order_keys_filter', 'my_custom_csv_columns' );
- //2. Then, populate the columns with the data you want (for example, several post meta concatenated)
- // The first parameter to add_filter must be 'wqep_order' followed by the column key. For this example : 'wqep_order_custom_key_whatever'
- add_filter( 'wqep_order_custom_key_whatever', 'my_custom_key_whatever', 10, 2 );
- function my_custom_key_whatever($val, $order)
- {
- //set $val to whatever you want. $order is a WC_Order object, id is $order->id
- // for example retrieve a post meta of the order
- return $val;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement