Advertisement
eventsmanager

events list by location

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