Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Events Category Custom Conditional Placeholder
- e.g. should be place under Events > Settings > Formatting > Event Categories > Categories list item format Or Single category page format
- */
- add_action('em_category_output_condition', 'my_em_custom_category_output_condition', 100, 4);
- function my_em_custom_category_output_condition($replacement, $condition, $match, $EM_Taxonomy_Term){
- if( is_object($EM_Taxonomy_Term) && preg_match('/^has_category_notes/',$condition, $matches) ){
- if( !empty(trim($EM_Taxonomy_Term->description)) ){
- $replacement = preg_replace("/\{\/?$condition\}/", '', $match);
- }else{
- $replacement = '';
- }
- }
- return $replacement;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement