Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /***
- * paste in your theme functions.php
- * after adding in your functions.php, go to Events > Bookings > Recent Bookings or by clicking an specific
- * click on the Gear icon and drag&drop field "Private Notes"
- *
- * This snippet will show the bookings private notes to the Bookings Summary page at Events > Bookings (Booking Notes section)
- *
- ***/
- function my_em_bookings_table_cols_template_attendee2($template, $EM_Bookings_Table){
- $template['private_notes'] = 'Private Notes';
- return $template;
- }
- add_action('em_bookings_table_cols_template', 'my_em_bookings_table_cols_template_attendee2',10,2);
- function my_em_booking_notes_template($val, $col, $EM_Booking, $EM_Bookings_Table, $csv){
- if( $col == 'private_notes' ){
- $temp = $EM_Booking->get_notes();
- $val .= '<ul>';
- foreach ($temp as $key => $value):
- $author = get_the_author_meta( 'display_name', $temp[$key]['author'] );
- $val .= '<li><ul>';
- $val .= '<li>'.'Author: '.$author.'</li>';
- $val .= '<li>'.'Notes: '.$temp[$key]['note'].'</li>';
- $val .= '</ul></li>';
- endforeach;
- $val .= '</ul>';
- }
- return $val;
- }
- add_filter('em_bookings_table_rows_col','my_em_booking_notes_template', 10, 5);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement