Menu Adam R Brown

WP hooks navigation: Home/browse • Actions index • Filters index

Source View: wp_img_tag_add_auto_sizes

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
6474  *
6475  * @see https://html.spec.whatwg.org/multipage/rendering.html#img-contain-size
6476  * @see https://core.trac.wordpress.org/ticket/62413
6477  * @see https://core.trac.wordpress.org/ticket/62731
6478  */
6479 function wp_print_auto_sizes_contain_css_fix() {
6480      _deprecated_function( __FUNCTION__, '6.9.0', 'wp_enqueue_img_auto_sizes_contain_css_fix' );
6481
6482      /** This filter is documented in wp-includes/media.php */
6483      $add_auto_sizes = apply_filters( 'wp_img_tag_add_auto_sizes', true );
6484      if ( ! $add_auto_sizes ) {
6485           return;
6486      }
6487
6488      ?>
6489      <style>img:is([sizes="auto" i], [sizes^="auto," i]) { contain-intrinsic-size: 3000px 1500px }</style>
6490      <?php
6491 }
6492