daily pastebin goal
68%
SHARE
TWEET

Events list group name

eventsmanager Jul 24th, 2014 428 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. add_filter('em_event_output_placeholder','my_em_groupname_placeholders',1,3);
  2. function my_em_groupname_placeholders($replace, $EM_Event, $result){
  3.         switch( $result ){
  4.                 case '#_EVENTBPGROUPNAME':
  5.                         $replace = "";
  6.                         $groups = groups_get_groups(array('show_hidden'=>true, 'per_page'=>0));
  7.                         $user_groups = $groups['groups'];
  8.                         foreach($user_groups as $BP_Group){
  9.                                 if ($BP_Group->id == $EM_Event->group_id){
  10.                                         $replace = $BP_Group->name;
  11.                                 }
  12.                         }
  13.         }
  14.         return $replace;
  15. }
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
 
Top