Checks whether the given ‘sizes’ attribute includes the ‘auto’ keyword as the first item in the list.
Description
Per the HTML spec, if present it must be the first entry.
Parameters
$sizes_attrstringrequired- The
'sizes'attribute value.
Source
function wp_sizes_attribute_includes_valid_auto( string $sizes_attr ): bool {
list( $first_size ) = explode( ',', $sizes_attr, 2 );
return 'auto' === strtolower( trim( $first_size, " \t\f\r\n" ) );
}
Changelog
| Version | Description |
|---|---|
| 6.7.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.