Opened 9 years ago

Closed 8 years ago

#1459 closed defect (bug) (fixed)

WP oEmbeds don't work on

Reported by: iandunn's profile iandunn Owned by: iandunn's profile iandunn
Milestone: Priority: normal
Component: WordCamp Site & Plugins Keywords: good-first-bug has-patch commit


Trying to embed a post via oEmbed doesn't work. The {post_url}/embed endpoint outputs the content, but the client doesn't actually embed it.


Attachments (3)

1459.patch (1.3 KB) - added by SergeyBiryukov 9 years ago.
meta-1459.2.patch (551 bytes) - added by SergeyBiryukov 8 years ago.
meta-1459.3.patch (1.0 KB) - added by prettyboymp 8 years ago.
Proposal to automatically whitelist any registered namespaces to wp-api v2

Download all attachments as: .zip

Change History (15)

#1 @Otto42
9 years ago

The json+oembed endpoints are returning incorrect results.

[{"code":"json_no_route","message":"No route was found matching the URL and request method"}]

#3 @iandunn
9 years ago

  • Owner set to iandunn
  • Status changed from new to accepted

Yup, that'd be my guess too.

9 years ago

#4 @SergeyBiryukov
9 years ago

  • Keywords has-patch added; needs-patch removed

The issue is that WP-API v1.2.4 does not support the WordPress 4.4 embed functionality:

Perhaps we could map the route so that the oEmbed API endpoint would be handled by core?

1459.patch fixes the issue in my testing.

This ticket was mentioned in Slack in #core-restapi by dd32. View the logs.

9 years ago

#6 follow-up: @iandunn
8 years ago

I couldn't get this working on my sandbox; it looks like wp_filter_oembed_result() is returning false because the iframe is stripped out of $html by wp_kses(). That doesn't make sense, since it's in $allowed_tags, but maybe something else in my environment (and unrelated to this patch) is interfering. I'll take another look when I have some more time.

#7 in reply to: ↑ 6 @SergeyBiryukov
8 years ago

Replying to iandunn:

I'll take another look when I have some more time.

FWIW, I tested with WP Meta Environment.

#8 @SergeyBiryukov
8 years ago

  • Keywords commit added

Refreshed the patch after [2358], which basically implements the same idea.

#9 @ryelle
8 years ago

I saw marktimemedia mention this in Slack today, so I went debugging (totally missed iandunn's follow up/this ticket) and came up with the same solution as SergeyBiryukov (also using the meta environment). Is there anything I can do to help test this more?

#10 @iandunn
8 years ago

I still haven't been able to get it working in my sandbox, and I also tested meta-1459.2.patch in production for awhile since it's unlikely to cause any problems, but I couldn't get it working there either.

I'm not sure why it's working with your copy of the Meta Environment and also Sergey's, but not my sandbox or production. I don't have any ideas of what to suggest since it's working for you locally. I'll probably just have to dig into comment:6 again when I have some time.

If you have any ideas or suggestions, though, I'm definitely open to trying other things.

8 years ago

Proposal to automatically whitelist any registered namespaces to wp-api v2

#11 @iandunn
8 years ago

In 3104:

WordCamp JSON API: Automatically route all v2 requests to the Core handler.

See #1459
Props prettyboymp

#12 @iandunn
8 years ago

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

Great idea @prettyboymp :)

It also looks like the original oEmbed issue is fixed now too.

Note: See TracTickets for help on using tickets.