[wp-trac] [WordPress Trac] #46777: Pass attachment ID to image_resize_dimensions to allow reliable per image cropping

WordPress Trac noreply at wordpress.org
Tue Apr 2 18:48:30 UTC 2019


#46777: Pass attachment ID to image_resize_dimensions to allow reliable per image
cropping
----------------------------+-----------------------------
 Reporter:  arkimedia       |      Owner:  (none)
     Type:  enhancement     |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Media           |    Version:  trunk
 Severity:  normal          |   Keywords:  has-patch
  Focuses:  administration  |
----------------------------+-----------------------------
 This patch passes optional attachment ID parameter to
 `image_resize_dimensions` filter. The purpose of this patch is to allow
 plugin developers to hook into `image_resize_dimensions` filter and
 implement reliable per image cropping.

 Currently many plugins rely on ugly "capture ID" hacks like WP Smartcrop
 plugin: https://plugins.svn.wordpress.org/wp-smartcrop/trunk/wp-
 smartcrop.php
 See `capture_attachment_id ` method for details.

 The patch doesn't change the default crop behaviour, but makes cropping
 functionality extendable.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/46777>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list