WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#31180 closed enhancement (fixed)

Add tumblr.com oEmbed support

Reported by: elliottcarlson Owned by:
Milestone: 4.2 Priority: normal
Severity: normal Version:
Component: Embeds Keywords: has-patch
Focuses: Cc:

Description

Tumblr has recently added functionality for embedding posts on third party sites.

This patch adds https://www.tumblr.com/oembed/1.0 as the oEmbed endpoint for URLs matching the http://*.tumblr.com/post/* format. This will account only for standard Tumblr blogs and does not account for those with customized domains - that support would require global oEmbed discovery to be enabled, and should not be part of the core Wordpress whitelist.

Attachments (1)

add_tumblr_oembed.diff (1.3 KB) - added by elliottcarlson 6 years ago.
Patch file

Download all attachments as: .zip

Change History (14)

@elliottcarlson
6 years ago

Patch file

#1 @archimedes.trajano
6 years ago

Looks good, I added one for thecodinglove myself using the My Custom Functions plugin to add it without making any changes to the core.

wp_oembed_add_provider( '#http://(www\.)?thecodinglove.com/post/\d+/\S+#i', 'http://www.tumblr.com/oembed/1.0', true );

The only problem I see is that sometimes the images do not automatically load up and you see some grey placeholder. I haven't seen anyway around it yet.

Last edited 6 years ago by SergeyBiryukov (previous) (diff)

#2 @nacin
6 years ago

Hi Elliott, thanks for stopping by! Sounds good to us. We'll want to due some due diligence on this endpoint and make sure it always returns what we expect, such as when maxwidth and maxheight are all sorts of values (in particular, we set a super tall maxheight in WP), proper handling when they are not integers, etc.

I'm having trouble tracking down an announcement post or developer documentation for this endpoint. Could you share?

For reference, here's the guidelines we usually use when adding oEmbed endpoints: https://make.wordpress.org/core/handbook/design-decisions/#whitelisting-oembed-providers. Obviously, adding Tumblr is a given, and you don't need to go through that checklist to justify it. For established services, the only bullet point I ever worry about is:

Is its oEmbed endpoint clearly established and properly documented? Sometimes, they are just a developer’s pet project that may not be supported.)

#3 @elliottcarlson
6 years ago

Hi nacin;

We will be releasing the documentation for this sometime this week - it's currently in pre-release mode with a few established publishers (though it's not a secret that we are supporting this - hence the ticket). I will be more than happy to follow up with a link to the published documentation once it has been approved via editorial.

Thanks!

Elliott

Last edited 6 years ago by elliottcarlson (previous) (diff)

#4 @DrewAPicture
6 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 4.2

#5 @wonderboymusic
6 years ago

@elliottcarlson - any news? I will do some searching for it online, but drop some links if you have them, please.

#6 follow-up: @wonderboymusic
6 years ago

  • Endpoint works over HTTP and HTTPS
  • Tumblr URLs work as HTTP or HTTPS
  • Supports json as format, does not support xml
  • Ignores maxwidth and maxheight but...
  • Resulting HTML is responsive (at least in 2014 and 2015 themes)

#8 @wonderboymusic
6 years ago

In 31630:

Add oEmbed support for Tumblr.

Props elliottcarlson.
See #31180.

#9 @DrewAPicture
6 years ago

Added Tumblr to the Embeds article in the Codex as "Coming in 4.2".

#10 @wonderboymusic
6 years ago

  • Resolution set to fixed
  • Status changed from new to closed

#11 in reply to: ↑ 6 ; follow-up: @johnbillion
6 years ago

Replying to wonderboymusic:

  • Tumblr URLs work as HTTP or HTTPS

Sure about that? I can't get any Tumblr site (apart from the dashboard at www.) to load over HTTPS.

@elliottcarlson: Are there any plans to enable HTTPS for Tumblr subdomains?

#12 in reply to: ↑ 11 @johnbillion
6 years ago

Replying to johnbillion:

Replying to wonderboymusic:

  • Tumblr URLs work as HTTP or HTTPS

Sure about that? I can't get any Tumblr site (apart from the dashboard at www.) to load over HTTPS.

Sorry I just realised you meant the endpoint works with HTTP or HTTPS URLs, which is correct.

This ticket was mentioned in Slack in #core by netweb. View the logs.


6 years ago

Note: See TracTickets for help on using tickets.