Advertisement
Guest User

Untitled

a guest
Nov 24th, 2015
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. /*
  2. Add order notes to the orders CSV export in Paid Memberships Pro
  3.  
  4. Add this code your active theme's functions.php or a custom plugin.
  5.  
  6. This may get moved into core at some point. We were worried about exporting the notes into the CSV
  7. because it can contain arbitrary text that could break the formatting of the CSV. With this code
  8. the export seems to handle quotes and commas fine when loading the CSV in Excel.
  9. */
  10. //function and hook to add notes column to CSV export
  11. function my_pmpro_orders_csv_extra_columns($columns)
  12. {
  13. $columns['notes'] = 'my_orders_csv_notes';
  14. return $columns;
  15. }
  16. add_filter('pmpro_orders_csv_extra_columns', 'my_pmpro_orders_csv_extra_columns');
  17.  
  18. //call back to return order notes
  19. function my_orders_csv_notes($order)
  20. {
  21. return $order->notes;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement