eventsmanager

events list by location

Apr 5th, 2013 (edited)
1,866
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. <?php
  2.  
  3. function em_location_by_region(){
  4.  
  5. //Use two-character country codes as defined in countrycode.org, can be comma-separated e.g. US,GB,ES
  6. $args = array( 'location_id' => 1 );
  7.  
  8. $arr_location = EM_Locations::get($args);
  9.  
  10. foreach( $arr_location as $EM_Location ){
  11. if ( !empty($EM_Location->location_name) ){
  12. echo "<h2>".$EM_Location->location_name."</h2>";
  13. echo do_shortcode('[events_list location="'.$EM_Location->location_id.'"] #_EVENTLINK <br> #_ATTENDEESLIST <br><br> [/events_list]');
  14. echo "<br/>---------------------------------------------------------------------------------------------------<br/>";
  15. }
  16. }
  17.  
  18. }
  19. add_shortcode('location_group', 'em_location_by_region');
  20.  
Advertisement
Add Comment
Please, Sign In to add comment