@@ 13-15 (lines=3) @@ | ||
10 | ||
11 | $this->image_alt = get_post_meta( $this->image->ID, '_wp_attachment_image_alt', true ); |
|
12 | // If no Alt value, use the caption |
|
13 | if ( empty( $this->image_alt ) && ! empty( $this->image->post_excerpt ) ) { |
|
14 | $this->image_alt = trim( strip_tags( $this->image->post_excerpt ) ); |
|
15 | } |
|
16 | // If still no Alt value, use the title |
|
17 | if ( empty( $this->image_alt ) && ! empty( $this->image->post_title ) ) { |
|
18 | $this->image_alt = trim( strip_tags( $this->image->post_title ) ); |
|
@@ 17-19 (lines=3) @@ | ||
14 | $this->image_alt = trim( strip_tags( $this->image->post_excerpt ) ); |
|
15 | } |
|
16 | // If still no Alt value, use the title |
|
17 | if ( empty( $this->image_alt ) && ! empty( $this->image->post_title ) ) { |
|
18 | $this->image_alt = trim( strip_tags( $this->image->post_title ) ); |
|
19 | } |
|
20 | ||
21 | $this->orig_file = wp_get_attachment_url( $this->image->ID ); |
|
22 | $this->link = $needs_attachment_link ? get_attachment_link( $this->image->ID ) : $this->orig_file; |