Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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
You can’t perform that action at this time.