wpseek.com
WordPress开发者和主题制作者的搜索引擎
_wp_get_image_size_from_meta is private and should not be used in themes or plugins directly.
_wp_get_image_size_from_meta › WordPress Function
Since4.4.0
已弃用n/a
› _wp_get_image_size_from_meta ( $size_name, $image_meta )
| 访问: |
|
| 参数: (2) |
|
| 返回: |
|
| 定义在: |
|
| 文档: |
Gets the image size as array from its meta data.
Used for responsive images.Related Functions: wp_get_image_mime, wp_getimagesize, wp_get_image_editor, get_date_from_gmt, wp_create_image_subsizes
源码
function _wp_get_image_size_from_meta( $size_name, $image_meta ) {
if ( 'full' === $size_name ) {
return array(
absint( $image_meta['width'] ),
absint( $image_meta['height'] ),
);
} elseif ( ! empty( $image_meta['sizes'][ $size_name ] ) ) {
return array(
absint( $image_meta['sizes'][ $size_name ]['width'] ),
absint( $image_meta['sizes'][ $size_name ]['height'] ),
);
}
return false;
}