Changeset 29836
- Timestamp:
- 10/05/2014 05:49:32 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r29776 r29836 700 700 list($src, $width, $height) = $image; 701 701 $hwstring = image_hwstring($width, $height); 702 if ( is_array($size) ) 703 $size = join('x', $size); 702 $size_class = $size; 703 if ( is_array( $size_class ) ) { 704 $size_class = join( 'x', $size_class ); 705 } 704 706 $attachment = get_post($attachment_id); 705 707 $default_attr = array( 706 708 'src' => $src, 707 'class' => "attachment-$size ",709 'class' => "attachment-$size_class", 708 710 'alt' => trim(strip_tags( get_post_meta($attachment_id, '_wp_attachment_image_alt', true) )), // Use Alt field first 709 711 ); … … 720 722 * @since 2.8.0 721 723 * 722 * @param mixed $attr Attributes for the image markup. 723 * @param int $attachment Image attachment post. 724 * @param array $attr Attributes for the image markup. 725 * @param WP_Post $attachment Image attachment post. 726 * @param string|array $size Requested size. 724 727 */ 725 $attr = apply_filters( 'wp_get_attachment_image_attributes', $attr, $attachment );728 $attr = apply_filters( 'wp_get_attachment_image_attributes', $attr, $attachment, $size ); 726 729 $attr = array_map( 'esc_attr', $attr ); 727 730 $html = rtrim("<img $hwstring");
Note: See TracChangeset
for help on using the changeset viewer.