Created
June 16, 2012 16:07
-
-
Save zanematthew/2941796 to your computer and use it in GitHub Desktop.
Venue by Region and Local Venues
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Returns the ID of all Venues in a given Region (full region) | |
*/ | |
public function getVenueByRegion( $region=null ){ | |
$args = array( | |
'post_type' => 'tracks', | |
'posts_per_page' => -1, | |
'post_status' => 'published', | |
'meta_query' => array( | |
array( | |
'key' => 'tracks_state', | |
'value' => $region, | |
'compare' => '=' | |
) | |
) | |
); | |
$query = new WP_Query( $args ); | |
return $query->posts; | |
} | |
/** | |
* Determine local venues based on current location. | |
* | |
* @return Full query_posts for local venues. | |
*/ | |
public function getLocalVenues(){ | |
$location = bmx_rs_get_user_location(); | |
return $this->getVenueByRegion( $location['region_full'] ); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment