eventsmanager

Custom Conditional Placeholder For Events Category

Mar 25th, 2020
307
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. Events Category Custom Conditional Placeholder
  3.  
  4. e.g. should be place under Events > Settings > Formatting > Event Categories > Categories list item format Or Single category page format
  5.  
  6. */
  7. add_action('em_category_output_condition', 'my_em_custom_category_output_condition', 100, 4);
  8. function my_em_custom_category_output_condition($replacement, $condition, $match, $EM_Taxonomy_Term){
  9. if( is_object($EM_Taxonomy_Term) && preg_match('/^has_category_notes/',$condition, $matches) ){
  10. if( !empty(trim($EM_Taxonomy_Term->description)) ){
  11. $replacement = preg_replace("/\{\/?$condition\}/", '', $match);
  12. }else{
  13. $replacement = '';
  14. }
  15. }
  16. return $replacement;
  17. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×