Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // function to create #_CUSTEVENTPRICE
- function my_em_ticket_price($replace, $EM_Event, $result) {
- if ( $result == '#_CUSTEVENTPRICE' ) {
- global $EM_Event;
- $is_open = $EM_Event->get_bookings()->is_open(); // whether there are any available tickets right now
- if ( $is_open ) { // if bookings are enabled and available
- $ticketprice = do_shortcode('[event id="'.$EM_Event->event_id.'"]#_EVENTPRICEMIN[/event]');
- } else { // if bookings are enabled but not available
- global $post;
- $ticketprice = get_post_meta($post->ID, 'Registration fee', true); // get value from custom attribute
- }
- $replace = $ticketprice;
- }
- return $replace;
- }
- add_filter('em_event_output_placeholder','my_em_ticket_price', 1, 4);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement