[wp-trac] [WordPress Trac] #34430: Improve the performance of wp_make_content_images_responsive()

WordPress Trac noreply at wordpress.org
Mon Nov 2 18:18:14 UTC 2015


#34430: Improve the performance of wp_make_content_images_responsive()
------------------------------------------------+------------------------
 Reporter:  joemcgill                           |       Owner:  joemcgill
     Type:  defect (bug)                        |      Status:  assigned
 Priority:  normal                              |   Milestone:  4.4
Component:  Media                               |     Version:  trunk
 Severity:  normal                              |  Resolution:
 Keywords:  has-patch needs-testing needs-docs  |     Focuses:
------------------------------------------------+------------------------

Comment (by jaspermdegroot):

 Following [35465], in 34430.10.diff:
 - Correction in inline doc: The {{{$attachment_id}}} param of
 {{{wp_get_attachment_image_srcset()}}} is not optional.
 - Added a more comprehensive description of the {{{$sources}}} param of
 the {{{wp_calculate_image_srcset}}} filter.
 - In {{{wp_get_attachment_image_srcset()}}}: Check if the meta data array
 contains sizes instead of just checking if it's an array. Consistent with
 what we do in {{{wp_image_add_srcset_and_sizes()}}}.
 - In {{{wp_get_attachment_image_srcset()}}}: Check if
 wp_get_attachment_metadata() has returned an array to prevent errors when
 using SVGs.
 - In {{{wp_get_attachment_image_sizes()}}}: call {{{get_post_meta()}}}
 directly like we do in {{{wp_get_attachment_image()}}} and
 {{{wp_make_content_images_responsive()}}}.
 - In {{{wp_get_attachment_image_sizes()}}}:  Removed the check if
 {{{$size}}} is a number since it only accepts an array.

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


More information about the wp-trac mailing list