[wp-trac] [WordPress Trac] #40370: add_image_sizes does not create the "crop position" versions of the image

WordPress Trac noreply at wordpress.org
Fri Jun 28 07:27:08 UTC 2019


#40370: add_image_sizes does not create the "crop position" versions of the image
-------------------------------------------------+-------------------------
 Reporter:  piejesus                             |       Owner:  (none)
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Media                                |     Version:  2.9
 Severity:  normal                               |  Resolution:  invalid
 Keywords:  needs-unit-tests good-first-bug      |     Focuses:
  has-patch                                      |
-------------------------------------------------+-------------------------
Changes (by subhankara):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 Hi,

 I think you need to regenerate all post thumbnails.

 add_image_size( string $name, int $width, int $height, bool|array $crop =
 false );

 Before uploading all images are not regenerate automatically. You need to
 regenerate manually or add plugin https://wordpress.org/plugins
 /regenerate-thumbnails/

 But after adding this code all images are regenerate automatically you do
 not need to regenerate again.

 And you can use this function to show the Image url :

 wp_get_attachment_image_src(get_post_thumbnail_id( POST_ID )
 ,'CUSTOM_SIZE');

 Thanks,
 Subhankar

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


More information about the wp-trac mailing list