[wp-trac] [WordPress Trac] #44427: Introduce lazy-loading API for media and other elements

WordPress Trac noreply at wordpress.org
Mon Jul 27 20:51:54 UTC 2020


#44427: Introduce lazy-loading API for media and other elements
-------------------------------------------------+-------------------------
 Reporter:  mor10                                |       Owner:  flixos90
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:  5.5
Component:  Media                                |     Version:  5.4
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests 2nd-        |     Focuses:
  opinion early needs-testing has-dev-note       |  performance
-------------------------------------------------+-------------------------

Comment (by johnstonphilip):

 @azaozz Would it be possible to describe the function's purpose with more
 clarity in the docblock's description?

 While the current description is good, I wonder if it might help future
 developers wondering where to put similar new HTML features, and also help
 to set the expectation for people who might use this function for various
 purposes.

 Here's one possible iteration of a description for the docblock:

 {{{
 /**
  * Modifies specific HTML tags in post content to include new browser and
 HTML technologies
  * that may not have existed at the time of post creation. These
 modifications currently include
  * adding `srcset`, `sizes`, and `loading` attributes to `img` HTML tags.
 Future similar
  * optimizations should be added/expected here.
  *
  * @since 5.5.0
  *
  * @see wp_img_tag_add_width_and_height_attr()
  * @see wp_img_tag_add_srcset_and_sizes_attr()
  * @see wp_img_tag_add_loading_attr()
  *
  * @param string $content The HTML content to be filtered.
  * @param string $context Optional. Additional context to pass to the
 filters.
  *                        Defaults to `current_filter()` when not set.
  * @return string Converted content with images modified.
  */
 function wp_filter_content_tags( $content, $context = null ) {
 }}}

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


More information about the wp-trac mailing list