[wp-trac] [WordPress Trac] #50137: New IMG sizes (1536x1536 & 2048x2048) names fail in JS/REST

WordPress Trac noreply at wordpress.org
Mon May 11 15:18:00 UTC 2020


#50137: New IMG sizes (1536x1536 & 2048x2048) names fail in JS/REST
--------------------------+-----------------------------------
 Reporter:  bahia0019     |       Owner:  (none)
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Media         |     Version:
 Severity:  normal        |  Resolution:  worksforme
 Keywords:                |     Focuses:  javascript, rest-api
--------------------------+-----------------------------------
Changes (by ocean90):

 * status:  new => closed
 * version:  5.4.1 =>
 * resolution:   => worksforme
 * milestone:  Awaiting Review =>


Comment:

 Hi @bahia0019, thanks for the ticket. To access the property you have to
 use the bracket notation:
 `slide.media_details.sizes['1536x1536'].source_url`.

 The new sizes are not meant to be selectable in the UI as they are only
 used to generate more suitable `srcset` attributes.

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


More information about the wp-trac mailing list