Making WordPress.org


Ignore:
Timestamp:
09/13/2018 06:51:45 PM (6 years ago)
Author:
coreymckrill
Message:

WordCamp Central: Use Google Maps API key when embedding maps

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/themes/wordcamp-central-2012/single-wordcamp.php

    r6458 r7671  
    4848
    4949                            <?php
    50                                 $address = urlencode( implode( " ", explode( "\n", wcpt_get_wordcamp_physical_address() ) ) );
     50                                $address = rawurlencode( implode( " ", explode( "\n", wcpt_get_wordcamp_physical_address() ) ) );
    5151                                $map_url = 'https://maps.googleapis.com/maps/api/staticmap?center=' . $address . '&zoom=14&size=130x70&maptype=roadmap&markers=color:blue%7Clabel:A%7C' . $address . '&sensor=false';
     52
     53                                $api_key = apply_filters( 'wordcamp_google_maps_api_key', '' );
     54
     55                                if ( $api_key ) {
     56                                    $map_url = add_query_arg( array(
     57                                        'key' => $api_key,
     58                                    ), $map_url );
     59                                }
     60
    5261                                $map_link = 'https://maps.google.com/maps?q=' . $address;
    5362                                $venue_link = wcpt_get_wordcamp_venue_url();
Note: See TracChangeset for help on using the changeset viewer.