WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#40758 closed defect (bug) (invalid)

Wordpress supporting oembed standards ?

Reported by: Arena94 Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Embeds Keywords:
Focuses: Cc:

Description

WordPress is making a good use of oembed standards.

However, things are much more complex when embedding wordpress content even for itself.

So, internally, Wordpress code do not support oembed standards ... http://oembed.com/

Such urls do not work

http://mysite.tld/oembed?format=xml&url=http%3A%2F%2Fmysite.tld%2F%3Fp%3D172

http://mysite.tld/oembed?format=json&url=http%3A%2F%2Fmysite.tld%2F%3Fp%3D172

Change History (5)

#1 @ocean90
3 years ago

  • Keywords reporter-feedback added
  • Version trunk deleted

Hello @Arena94, can you elaborate a bit more on this one? Do you mean that WordPress should have a /oembed endpoint? Because that's not really a standard. It's all about the discovery part.

WordPress automatically adds the required link tags to the header so you should see something like this on http://mysite.tld/?p=172:

<link rel="alternate" type="application/json+oembed" href="http://mysite.tld/wp-json/oembed/1.0/embed?url=http%3A%2F%2Fmysite.tld%2F%3Fp%3D172" />
<link rel="alternate" type="text/xml+oembed" href="http://mysite.tld/wp-json/oembed/1.0/embed?url=http%3A%2F%2Fmysite.tld%2F%3Fp%3D172&#038;format=xml" />

#2 @Arena94
3 years ago

Hello,

good point,

here is what i have

<link rel="alternate" type="application/json+oembed" href="http://127.0.0.1/wordpress/?rest_route=%2Foembed%2F1.0%2Fembed&#038;url=http%3A%2F%2F127.0.0.1%2Fwordpress%2F%3Fp%3D172" />
<link rel="alternate" type="text/xml+oembed" href="http://127.0.0.1/wordpress/?rest_route=%2Foembed%2F1.0%2Fembed&#038;url=http%3A%2F%2F127.0.0.1%2Fwordpress%2F%3Fp%3D172&#038;format=xml" />

both links have the following result :

{"code":"rest_missing_callback_param","message":"Missing parameter(s): url","data":{"status":400,"params":url?}}

and what i should have (with a much better result)

http://127.0.0.1/wordpress/?rest_route=/oembed/1.0/embed&url=http%3A%2F%2F127.0.0.1%2Fwordpress%2F%3Fp%3D172

http://127.0.0.1/wordpress/?rest_route=/oembed/1.0/embed&url=http%3A%2F%2F127.0.0.1%2Fwordpress%2F%3Fp%3D172&format=xml

is it ok ?

#3 @ocean90
3 years ago

Thanks, that seems to be caused by some double escaping which converts the & into &#038;. Clicking the link in a HTML context (src or href attribute) should work though.

#4 @Arena94
3 years ago

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

nice
so i close it

#5 @ocean90
3 years ago

  • Keywords reporter-feedback removed
  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.