SHARE
TWEET

Event tag count

eventsmanager Jun 3rd, 2016 171 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top