Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Add order notes to the orders CSV export in Paid Memberships Pro
- Add this code your active theme's functions.php or a custom plugin.
- This may get moved into core at some point. We were worried about exporting the notes into the CSV
- because it can contain arbitrary text that could break the formatting of the CSV. With this code
- the export seems to handle quotes and commas fine when loading the CSV in Excel.
- */
- //function and hook to add notes column to CSV export
- function my_pmpro_orders_csv_extra_columns($columns)
- {
- $columns['notes'] = 'my_orders_csv_notes';
- return $columns;
- }
- add_filter('pmpro_orders_csv_extra_columns', 'my_pmpro_orders_csv_extra_columns');
- //call back to return order notes
- function my_orders_csv_notes($order)
- {
- return $order->notes;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement