Changeset 1096
- Timestamp:
- 01/07/2015 07:32:23 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/official-wordpress-events/official-wordpress-events.php
r1095 r1096 164 164 if ( $meetups ) { 165 165 foreach ( $meetups as $meetup ) { 166 $location = array();167 166 $start_timestamp = ( $meetup->time / 1000 ) + ( $meetup->utc_offset / 1000 ); // convert to seconds 168 167 169 168 if ( isset( $meetup->venue ) ) { 170 foreach ( array( 'city', 'state', 'country' ) as $part ) { 171 if ( ! empty( $meetup->venue->$part ) ) { 172 if ( in_array( $part, array( 'state', 'country' ) ) ) { 173 $location[] = strtoupper( $meetup->venue->$part ); 174 } else { 175 $location[] = $meetup->venue->$part; 176 } 177 } 178 } 179 $location = implode( ', ', $location ); 169 $location = $this->format_meetup_venue_location( $meetup->venue ); 180 170 } else { 181 171 $location = $this->reverse_geocode( $meetup->group->group_lat, $meetup->group->group_lon ); … … 275 265 276 266 /** 267 * Format a meetup venue's location 268 * 269 * @param object $venue 270 * 271 * @return string 272 */ 273 protected function format_meetup_venue_location( $venue ) { 274 $location = array(); 275 276 foreach ( array( 'city', 'state', 'country' ) as $part ) { 277 if ( ! empty( $venue->$part ) ) { 278 if ( in_array( $part, array( 'state', 'country' ) ) ) { 279 $location[] = strtoupper( $venue->$part ); 280 } else { 281 $location[] = $venue->$part; 282 } 283 } 284 } 285 286 return implode( ', ', $location ); 287 } 288 289 /** 277 290 * Wrapper for wp_remote_get() 278 291 *
Note: See TracChangeset
for help on using the changeset viewer.