wp_enqueue_script Abhängigkeiten
-
Hallo,
ich habe ein Problem mit wp_enqueue_script unzwar möchte ich die javascript google-maps-api laden und durch das laden wird die callbackfunction initMap() aufgerufen. Es wird alles wunderbar geladen, aber er findet die funktion initMap() nicht.
wp_register_script("google_maps_api", "https://maps.googleapis.com/maps/api/js?key=".get_field("google_map_api_key", "option")."&callback=initMap", array(), "1.0.0", true); wp_register_script("google_maps_multiple_locations", MY_PLUGIN_URL . "js/google_map_multiple_locations.js", array("jquery"), "1.0.0", true); wp_enqueue_script("google_maps_api"); wp_enqueue_script("google_maps_multiple_locations");
Was muss ich machen, damit die google_maps_api erst nach google_maps_multiple_locations eingebunden wird?
Ansicht von 3 Antworten - 1 bis 3 (von insgesamt 3)
Ansicht von 3 Antworten - 1 bis 3 (von insgesamt 3)
- Das Thema „wp_enqueue_script Abhängigkeiten“ ist für neue Antworten geschlossen.