[wp-trac] [WordPress Trac] #48003: Function wp_prepare_attachment_for_js() missing other sizes

WordPress Trac noreply at wordpress.org
Wed Oct 9 01:57:05 UTC 2019


#48003: Function wp_prepare_attachment_for_js() missing other sizes
--------------------------+------------------------------
 Reporter:  kkatusic      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Media         |     Version:  5.2.3
 Severity:  minor         |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+------------------------------

Comment (by iCaleb):

 I'll wait for a second opinion to close this, just to make sure I'm not
 missing something.

 To resolve your particular problem though, I'd recommend either using the
 `image_size_names_choose` filter to register the custom image sizes you
 need this function to return. Or modify `$response['sizes']` in the output
 with the `wp_prepare_attachment_for_js` filter:
 https://github.com/WordPress/WordPress/blob/ecf00fc84407249ae2a699e3b3d31571194efa34
 /wp-includes/media.php#L3585

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


More information about the wp-trac mailing list