Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action( 'init', 'force_rebuild_of_coords', 20 );
- function force_rebuild_of_coords() {
- $venues = new WP_Query( array(
- 'post_type' => TribeEvents::VENUE_POST_TYPE,
- 'post_status' => 'publish',
- 'posts_per_page' => -1
- ) );
- foreach ( $venues->posts as $venue ) {
- $data = array(
- 'Address' => get_post_meta( $venue->ID, '_VenueAddress', true ),
- 'City' => get_post_meta( $venue->ID, '_VenueCity', true ),
- 'Province' => get_post_meta( $venue->ID, '_VenueProvince', true ),
- 'State' => get_post_meta( $venue->ID, '_VenueState', true ),
- 'Zip' => get_post_meta( $venue->ID, '_VenueZip', true ),
- 'Country' => get_post_meta( $venue->ID, '_VenueCountry', true )
- );
- update_post_meta( $venue->ID, '_VenueGeoAddress', uniqid() );
- TribeEventsGeoLoc::instance()->save_venue_geodata( $venue->ID, $data );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement