wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.
_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
Od4.4.0
Przestarzałyn/a
› _wp_get_image_size_from_meta ( $size_name, $image_meta )
| Dostęp: |
|
| Parametry: (2) |
|
| Powrót: |
|
| Zdefiniowane na: |
|
| Codex: |
Gets the image size as array from its meta data.
Used for responsive images.Powiązane Funkcje: wp_get_image_mime, wp_getimagesize, wp_get_image_editor, get_date_from_gmt, wp_create_image_subsizes
Źródło
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;
}