Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action('em_event_output_condition', 'my_em_general_notag_event_output_condition', 1, 4);
- function my_em_general_notag_event_output_condition($replacement, $condition, $match, $EM_Event){
- if( preg_match('/^no_tags$/',$condition, $matches) ){
- $tags = get_the_terms($EM_Event->post_id, EM_TAXONOMY_TAG);
- if( is_array($tags) && count($tags) > 0 ){
- $replacement = "";
- }else{
- $replacement = preg_replace("/\{\/?$condition\}/", '', $match);
- }
- }
- return $replacement;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement