WordPress.org

Ready to get started?Download WordPress

Forums

WordPress breaks script URLs that contains & (1 post)

  1. philbertdezwart
    Member
    Posted 2 years ago #

    I'm trying to use the Google MAP API.
    The URL to use the Javascript library is:
    http://maps.googleapis.com/maps/api/js?v=3.4&key=<your_API_key>&sensor=false

    However, when I try to enqueue this:

    // enforce google map API presence
    function put_googlemaps_in_trouwlocatie () {
    		wp_enqueue_script( 'googlemaps', 'http://maps.googleapis.com/maps/api/js?v=3.4&key=<your_API_key>&sensor=false' );
    }
    
    add_action('init', 'put_googlemaps_in_trouwlocatie');

    The URL gets mangled because all (ampersand)s get replaced by (ampersand)#038;

    How can I enqueue this script without breaking the URL?
    I have tried this while all other plugins were disabled. I'm at a loss here.

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 2 years ago by philbertdezwart
  • This topic is not resolved
  • WordPress version: 3.2.1