daily pastebin goal
58%
SHARE
TWEET

Show private notes to bookings summary

eventsmanager May 8th, 2015 385 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /***
  2.  * paste in your theme functions.php
  3.  * after adding in your functions.php, go to Events > Bookings > Recent Bookings or by clicking an specific
  4.  * click on the Gear icon and drag&drop field "Private Notes"
  5.  *
  6.  * This snippet will show the bookings private notes to the Bookings Summary page at Events > Bookings
  7.  *
  8.  ***/
  9. function my_em_bookings_table_cols_template_attendee2($template, $EM_Bookings_Table){
  10.         $template['private_notes'] = 'Private Notes';
  11.         return $template;
  12. }
  13. add_action('em_bookings_table_cols_template', 'my_em_bookings_table_cols_template_attendee2',10,2);
  14.  
  15. function my_em_booking_notes_template($val, $col, $EM_Booking, $EM_Bookings_Table, $csv){
  16.        
  17.         if( $col == 'private_notes' ){
  18.                 $temp = $EM_Booking->get_notes();
  19.                 $val .= '<ul>';
  20.                 foreach ($temp as $key => $value):
  21.                         $author = get_the_author_meta( 'display_name', $temp[$key]['author'] );
  22.                         $val .= '<li><ul>';
  23.                         $val .= '<li>'.'Author: '.$author.'</li>';
  24.                         $val .= '<li>'.'Notes: '.$temp[$key]['note'].'</li>';
  25.                         $val .= '</ul></li>';
  26.                 endforeach;
  27.                 $val .= '</ul>';
  28.         }
  29.        
  30.         return $val;
  31. }
  32. add_filter('em_bookings_table_rows_col','my_em_booking_notes_template', 10, 5);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top