WordPress.org

Make WordPress Core

Ticket #42920: 42920.diff

File 42920.diff, 1.2 KB (added by desrosj, 2 years ago)

Initial patch.

  • src/wp-includes/media.php

     
    378378
    379379        $html = '<img src="' . esc_attr( $img_src ) . '" alt="' . esc_attr( $alt ) . '" ' . $title . $hwstring . 'class="' . $class . '" />';
    380380
     381        if ( current_theme_supports( 'html5', 'picture' ) ) {
     382                $html = '<picture>' . $html . '</picture>';
     383        }
     384
    381385        /**
    382386         * Filters the HTML content for the image tag.
    383387         *
     
    925929                        $html .= " $name=" . '"' . $value . '"';
    926930                }
    927931                $html .= ' />';
     932
     933                if ( current_theme_supports( 'html5', 'picture' ) ) {
     934                        $html = '<picture>' . $html . '</picture>';
     935                }
    928936        }
    929937
    930938        return $html;
  • src/wp-includes/theme.php

     
    23052305 * @since 4.1.0 The `title-tag` feature was added
    23062306 * @since 4.5.0 The `customize-selective-refresh-widgets` feature was added
    23072307 * @since 4.7.0 The `starter-content` feature was added
     2308 * @since 5.0.0 The 'html5 feature now accepts `picture`.
    23082309 *
    23092310 * @global array $_wp_theme_features
    23102311 *