Make WordPress Core

Opened 9 years ago

Closed 5 years ago

#23622 closed feature request (maybelater)

Support Google Maps / Docs / Spreadsheet embeds

Reported by: Otto42 Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Embeds Keywords: needs-refresh
Focuses: Cc:


Google Maps and Drive (docs, spreadhseets, and presentations) all can do embeds, but don't support oEmbed. Still, I think they're big enough for the core to have support for natively. We already have Google Video support, and it's pretty much dead now.

Initial patch attached.

  • To get a Maps URL, view a Google Map, then select the "Link" icon in the left menu bar, top-right corner.
  • To get a docs/sheet/presentation URL, open the item, select "File->Publish To Web. Once it's published and visible to the web, the dialog will give a link for you to copy/paste.

This uses the normal embed handler, meaning that either the [embed] shortcode or just pasting the URL on a line by itself will trigger the embed. Width and height parameters are supported, and Presentations has special parameters to allow full-screen viewing.

Attachments (1)

23622.diff (3.2 KB) - added by Otto42 9 years ago.
Add Google Maps and Drive support for embeds

Download all attachments as: .zip

Change History (20)

9 years ago

Add Google Maps and Drive support for embeds

#1 @wpsmith
9 years ago

  • Cc t@… added

#2 @bananastalktome
9 years ago

  • Cc bananastalktome@… added

#3 @toscho
9 years ago

  • Cc info@… added

#4 @MadtownLems
9 years ago

  • Cc jason.lemahieu@… added

I'm ecstatic to see this considered for Core. I've taken a look at your code, and took it for a test drive. I had no issues embedding maps, docs, spreadsheets, or presentations.

I was even able to embed a google form after I extracted the proper URL from the iframe source code it tried giving me (something in the form of https://docs.google.com/spreadhsett/embeddedform?formkey=abc123)

Version 0, edited 9 years ago by MadtownLems (next)

#5 @Otto42
9 years ago

I think the regexp's need a bit more tweaking before going into core. If somebody could do the legwork and find as many real-world examples of possible URLs for these sorts of items and make a list, that would certainly help.

#6 @MadtownLems
9 years ago

For what it's worth, I did testing against both a traditional Google account, as well as an account that's part of a Google Apps for EDU setup.

While the Google Apps for EDU account will often give you publicly viewable URLs that contain the domain name, such as http://docs.google.com/a/my-university.edu/spreadsheet/ccc?key=abc123, it looks like those portions of the URLs are removed after using the Publish to Web option.

TL;DR - works with Google Apps for EDU :)

#7 @MadtownLems
9 years ago

I've done some more playing, and have had success with expanding the amount of things that can be easily embedded, including files (such as videos, PDFs, Word docs, etc), forms, and entire Drive folders.

My current iteration uses this in the RegEx: (document|spreadsheet|presentation|forms|file|folder)

Any thoughts/concerns about allowing embeds of these additional types as well?

#8 @mordauk
9 years ago

  • Cc pippin@… added

I haven't tested this yet, but I love the idea of it being in core.

#9 @mordauk
9 years ago

Initial tests of maps works great.

#10 @sunnyratilal
9 years ago

  • Cc sunnyratilal5@… added

#11 @MadtownLems
9 years ago

Is there a particular reason you're not looking at including Google Calendars as part of this?
(If so, I'm guessing it's due to the ginormous number of options available when displaying calendars?)

#12 @Otto42
9 years ago

Yes. Basically, I can't find any way to embed a Google Calendar. No options for any form of embedding in the interface that I can find.

#13 @MadtownLems
9 years ago

Have you looked at the Google Embeddable Calendar Helper?


#14 @MadtownLems
8 years ago

FYI - Google is rolling out 'New' Google Maps, which currently have a different URL structure, not covered by this patch. Additionally, it even appears that users logged into google are getting URLS with www.google.com/maps/, despite having the 'Classic' interface. The only way I'm getting maps.google.com URLs, supported by this patch, are when I'm not logged into Google at all.

#15 @emiliengerbois
8 years ago

Hi everybody,
it's such a great function you built! congrats and thanks!
are there any news about MadtownLems questions on new Google Urls ?
thxs again

#16 @wonderboymusic
8 years ago

  • Keywords needs-refresh added
  • Milestone changed from Awaiting Review to Future Release

#17 @atomicjack
6 years ago

I reckon it might be time to look into getting this implemented; times are getting on.

#18 @Otto42
6 years ago

Yeah, but unfortunately, Google keeps changing their products around and not offering solid ways to implement this sort of thing without relying on their also-ever-changing APIs. Supporting this long term is problematic, as is keeping backward compatibility.

Maybe one day Google will support an actual standard like oEmbed and make this feasible. Not there yet though.

#19 @swissspidy
5 years ago

  • Milestone Future Release deleted
  • Resolution set to maybelater
  • Status changed from new to closed

There is still no easy way to embed Google maps or docs using an actual standard like oEmbed. Closing as maybelater.

Note: See TracTickets for help on using tickets.