Changeset 35426 for trunk/src/wp-includes/media.php
- Timestamp:
- 10/28/2015 09:54:04 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r35419 r35426 870 870 871 871 /** 872 * Private, do not use 872 * Caches and returns the base URL of the uploads directory. 873 * 874 * @since 4.4.0 875 * @access private 876 * 877 * @return string The base URL, cached. 873 878 */ 874 879 function _wp_upload_dir_baseurl() { … … 884 889 885 890 /** 886 * Private, do not use 887 */ 888 function _wp_get_image_size_from_meta( $size, $image_meta ) { 889 if ( $size === 'full' ) { 891 * Get the image size as array from its meta data. 892 * 893 * Used for responsive images. 894 * 895 * @since 4.4.0 896 * @access private 897 * 898 * @param string $size_name Image size. Accepts any valid image size name (thumbnail, medium, etc.). 899 * @param array $image_meta The image meta data. 900 * @return array|bool Array of width and height values in pixels (in that order) 901 * or false if the size doesn't exist. 902 */ 903 function _wp_get_image_size_from_meta( $size_name, $image_meta ) { 904 if ( $size_name === 'full' ) { 890 905 return array( 891 906 absint( $image_meta['width'] ), 892 907 absint( $image_meta['height'] ), 893 908 ); 894 } elseif ( ! empty( $image_meta['sizes'][$size ] ) ) {909 } elseif ( ! empty( $image_meta['sizes'][$size_name] ) ) { 895 910 return array( 896 absint( $image_meta['sizes'][$size ]['width'] ),897 absint( $image_meta['sizes'][$size ]['height'] ),911 absint( $image_meta['sizes'][$size_name]['width'] ), 912 absint( $image_meta['sizes'][$size_name]['height'] ), 898 913 ); 899 914 }
Note: See TracChangeset
for help on using the changeset viewer.