Skip to content

Instantly share code, notes, and snippets.

@2Fwebd
Last active February 5, 2019 20:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 2Fwebd/7a0f06139205dc7eca723d1dd1e3caf3 to your computer and use it in GitHub Desktop.
Save 2Fwebd/7a0f06139205dc7eca723d1dd1e3caf3 to your computer and use it in GitHub Desktop.
<?php
/**
* Add the Vue.js library, the Google MAP API and our own component
*
* We are using a CDN for the library
*/
public function addScripts()
{
// Vue.js library
wp_enqueue_script(
'woffice-vue',
'https://cdn.jsdelivr.net/npm/vue@2.5.17/dist/vue.js',
[],
'2.5.17'
);
// Map API from Google
wp_enqueue_script(
'woffice-google-maps-api-v3',
'https://maps.googleapis.com/maps/api/js?'. http_build_query(array(
'v' => '3',
'libraries' => 'places',
'language' => 'en',
'key' => $this->publicApiKey
)),
array(),
false,
true
);
// We add our component
wp_enqueue_script(
'woffice-members-map',
get_template_directory_uri() . '/js/wofficeMembersMap.js',
array(),
'1.0.0',
true
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment