Skip to content
Browse files

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

See #188, closes #184.
  • Loading branch information...
1 parent 6752ef0 commit 9af47bab03e8c1599f96f566c86b58a5ffa2141e @obenland obenland committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 image.php
2 image.php
@@ -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 );

4 comments on commit 9af47ba


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.


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?


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.


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.
Something went wrong with that request. Please try again.