Advertisement
eventsmanager

Event tag count

Jun 3rd, 2016
709
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. add_filter('em_tag_output_placeholder','my_tag_count_placeholder',1,3);
  2. function my_tag_count_placeholder($replace, $EM_Tag, $result){
  3. switch( $result ){
  4. case '#_TAGCOUNT':
  5. $replace = '0';
  6. $tagCount = EM_Events::count(array( 'tag'=>$EM_Tag->term_id, 'scope' => 'future' ));
  7. if( $tagCount > 0 ){
  8. $replace = $tagCount;
  9. }
  10. break;
  11. }
  12. return $replace;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement