Changeset 35491
- Timestamp:
- 11/03/2015 12:18:07 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r35481 r35491 931 931 * @since 4.4.0 932 932 * 933 * @param int $attachment_id Optional.Image attachment ID.933 * @param int $attachment_id Image attachment ID. 934 934 * @param array|string $size Image size. Accepts any valid image size, or an array of width and height 935 935 * values in pixels (in that order). Default 'medium'. … … 1060 1060 * @since 4.4.0 1061 1061 * 1062 * @param array $sources An array of image URLs and widths. 1062 * @param array $sources An array of sources to include in the 'srcset'. Each source 1063 * consists of an array containing the URL and the descriptor 1064 * type and value (default: the image width): 1065 * 1066 * image width => array( 1067 * 'url' => string, 1068 * 'descriptor' => string ('w' or 'x'), 1069 * 'value' => integer (width or pixel density) 1070 * }, 1071 * 1063 1072 * @param int $attachment_id Image attachment ID. 1064 1073 * @param array $size_array Array of width and height values in pixels (in that order). … … 1099 1108 $width = 0; 1100 1109 1101 if ( is_numeric( $size ) ) { 1102 $width = absint( $size ); 1103 } elseif ( is_array( $size ) ) { 1110 if ( is_array( $size ) ) { 1104 1111 $width = absint( $size[0] ); 1105 1112 } elseif ( is_string( $size ) ) { 1106 1113 if ( ! $image_meta && $attachment_id ) { 1107 $image_meta = wp_get_attachment_metadata( $attachment_id);1114 $image_meta = get_post_meta( $attachment_id, '_wp_attachment_metadata', true ); 1108 1115 } 1109 1116
Note: See TracChangeset
for help on using the changeset viewer.