wpseek.com
WordPress开发者和主题制作者的搜索引擎



wp_sizes_attribute_includes_valid_auto › WordPress Function

Since6.7.0
已弃用n/a
wp_sizes_attribute_includes_valid_auto ( $sizes_attr )
参数:
  • (string) $sizes_attr The 'sizes' attribute value.
    Required: Yes
返回:
  • (bool) True if the 'auto' keyword is present, false otherwise.
定义在:
文档:

Checks whether the given 'sizes' attribute includes the 'auto' keyword as the first item in the list.

Per the HTML spec, if present it must be the first entry.


源码

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" ) );
}