Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- This snippet will add custom placeholder to display the contents of #_BOOKINGATTENDEES
- - create php file and folders under wp-contents/mu-plugins/functions.php
- - edit functions.php and paste the snippet below then save
- - you can now use #_MYBOOKINGATTENDEES under Events > Settings > Formatting > Events eg. default single events page format
- =========
- NOTE:
- =========
- by default you need to change the formats of #_BOOKINGATTENDEES under events-manager-pro/templates/placeholders/bookingattendees-ticket.php
- to use templates: http://wp-events-plugin.com/documentation/using-template-files/
- eg. wp-content/themes/Your Theme/plugins/events-manager-pro/placeholders/bookingattendees-ticket.php
- */
- add_filter('em_event_output_placeholder','my_em_booking_attendees',1,3);
- function my_em_booking_attendees($replace, $EM_Event, $result){
- global $wp_query, $wp_rewrite;
- switch( $result ){
- case '#_MYBOOKINGATTENDEES':
- $EM_Bookings = $EM_Event->get_bookings();
- $replace = '';
- foreach( $EM_Bookings as $EM_Booking ){
- $replace .= str_replace("\r\n","<br>",$EM_Booking->output('#_BOOKINGATTENDEES'));
- }
- break;
- }
- return $replace;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement