[wp-trac] [WordPress Trac] #62094: /wp-json/oembed/1.0/embed returns too big thumbnail_url

WordPress Trac noreply at wordpress.org
Mon Sep 30 15:20:29 UTC 2024


#62094: /wp-json/oembed/1.0/embed returns too big thumbnail_url
-------------------------------------------------+-------------------------
 Reporter:  colinleroy                           |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  Embeds                               |     Version:  4.4
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-unit-tests needs-    |     Focuses:
  testing-info                                   |
-------------------------------------------------+-------------------------

Comment (by colinleroy):

 Thank you for your feedback!

 I've updated the PR with a unit test. I hope it's what you expected.

 For a manual reproduction, create a post or page; add a large image in the
 post, and set it as Featured Image. Publish the post, and check its <link
 rel="alternate" title="oEmbed (JSON)" type="application/json+oembed"
 href="...">

 With this patch, it'll look like:

 {{{
 {
   "version": "1.0",
   "provider_name": "colin at colino.net",
   "provider_url": "https://www.colino.net/wordpress",
   "author_name": "Colin",
   "author_url": "https://www.colino.net/wordpress/archives/author/colin/",
   "title": "F*** capitalism in general and f*** Youtube in particular",
   "type": "link",
   "width": 600,
   "height": 338,
   "thumbnail_url": "https://www.colino.net/wordpress/wp-
 content/uploads/image-97-768x576.png",
   "thumbnail_width": 600,
   "thumbnail_height": 450
 }
 }}}

 Without the patch,

 {{{
 {
   "version": "1.0",
   "provider_name": "colin at colino.net",
   "provider_url": "https://www.colino.net/wordpress",
   "author_name": "Colin",
   "author_url": "https://www.colino.net/wordpress/archives/author/colin/",
   "title": "F*** capitalism in general and f*** Youtube in particular",
   "type": "link",
   "width": 600,
   "height": 338,
   "thumbnail_url": "https://www.colino.net/wordpress/wp-
 content/uploads/image-97.png",
   "thumbnail_width": 600,
   "thumbnail_height": 450
 }
 }}}

 In the second case, the served thumbnail_url is the full-size image.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/62094#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list