array( 'type' => 'html', 'html' => '
' . sprintf( __( 'We highly recommend that you specify a valid %s for The Events Calendar to use. Doing this will help prevent problems with maps, especially for sites that receive a lot of traffic.', 'the-events-calendar' ), '' . __( 'Google Maps API key', 'the-events-calendar' ) . '' ) . '
', ), $this->api_key_option_name => array( 'type' => 'text', 'label' => esc_html__( 'Google Maps API key', 'the-events-calendar' ), 'tooltip' => sprintf( __( '%s to create your Google Maps API key.', 'the-events-calendar' ), '
' . __( 'Click here', 'the-events-calendar' ) . '' ), 'size' => 'medium', 'validation_type' => 'alpha_numeric_with_dashes_and_underscores', 'can_be_empty' => true, 'parent_option' => Tribe__Events__Main::OPTIONNAME, ), ); return array_merge( (array) $addon_fields, $gmaps_api_fields ); } /** * Adds the browser key api key to the Google Maps JavaScript API url if set by the user. * * @param string $js_maps_api_url * * @return string */ public function filter_tribe_events_google_maps_api( $js_maps_api_url ) { $key = tribe_get_option( $this->api_key_option_name ); if ( ! empty( $key ) ) { $js_maps_api_url = add_query_arg( 'key', $key, $js_maps_api_url ); } return $js_maps_api_url; } public function filter_tribe_events_pro_google_maps_api($js_maps_api_url ) { } }