Permalink
Browse files

_s: Use the_title_attrinute() when we don't need to specify a post.

See #188, closes #184.
  • Loading branch information...
obenland committed Mar 26, 2013
1 parent 6752ef0 commit 9af47bab03e8c1599f96f566c86b58a5ffa2141e
Showing with 1 addition and 1 deletion.
  1. +1 −1 image.php
View
@@ -76,7 +76,7 @@
}
?>
- <a href="<?php echo $next_attachment_url; ?>" title="<?php echo esc_attr( strip_tags( get_the_title() ) ); ?>" rel="attachment"><?php
+ <a href="<?php echo $next_attachment_url; ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php
$attachment_size = apply_filters( '_s_attachment_size', array( 1200, 1200 ) ); // Filterable image size.
echo wp_get_attachment_image( $post->ID, $attachment_size );
?></a>

4 comments on commit 9af47ba

@mfields

This comment has been minimized.

Show comment
Hide comment
@mfields

mfields Mar 26, 2013

Contributor

What do you think about reverting this and then adding an ID to the call to get_the_title()? Since the link points to $next_attachment_url I'm not sure it makes sense to use the title of the current image for the link.

Contributor

mfields replied Mar 26, 2013

What do you think about reverting this and then adding an ID to the call to get_the_title()? Since the link points to $next_attachment_url I'm not sure it makes sense to use the title of the current image for the link.

@obenland

This comment has been minimized.

Show comment
Hide comment
@obenland

obenland Mar 30, 2013

Member

Weird, I didn't get a notification about your comment.

Yeah, I thought about that but decided to stick with the previous behavior. The link text is the current image, the title would be for the next image - I would find it pretty confusing to hover over a picture of John and then see a title saying "Bill and Tina" (because the next image happens to be a picture of Bill and Tina).

What do you think?

Member

obenland replied Mar 30, 2013

Weird, I didn't get a notification about your comment.

Yeah, I thought about that but decided to stick with the previous behavior. The link text is the current image, the title would be for the next image - I would find it pretty confusing to hover over a picture of John and then see a title saying "Bill and Tina" (because the next image happens to be a picture of Bill and Tina).

What do you think?

@mfields

This comment has been minimized.

Show comment
Hide comment
@mfields

mfields Mar 31, 2013

Contributor

Maybe if it said something like "Next Image: Bill and Tina" it would be less confusing? I think that the title attribute, when used for links, should describe where the user will go when the activate the link.

Contributor

mfields replied Mar 31, 2013

Maybe if it said something like "Next Image: Bill and Tina" it would be less confusing? I think that the title attribute, when used for links, should describe where the user will go when the activate the link.

@obenland

This comment has been minimized.

Show comment
Hide comment
@obenland

obenland Apr 1, 2013

Member

You say "the title attribute, when used for links": We could make that when an if and remove the title all together.

Member

obenland replied Apr 1, 2013

You say "the title attribute, when used for links": We could make that when an if and remove the title all together.

Please sign in to comment.