Last active
February 5, 2019 20:31
-
-
Save 2Fwebd/7a0f06139205dc7eca723d1dd1e3caf3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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/[email protected]/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