Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * usage: {has_location_31} TEST {/has_location_31} where 31 is the Location ID
- */
- add_action('em_event_output_condition', 'my_em_event_output_condition', 1, 4);
- function my_em_event_output_condition($replacement, $condition, $match, $EM_Event){
- if( preg_match('/^has_location_([a-zA-Z0-9_\-,]+)$/',$condition, $location_id_match) ){
- if( $EM_Event->get_location()->location_id == $location_id_match[1] ){
- $replacement = preg_replace("/\{\/?$condition\}/", '', $match);
- }else{
- $replacement = '';
- }
- }
- return $replacement;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement