Permalink
Browse files

Twenty Thirteen: usability improvement for better viewing of images o…

…n attachment pages. Props DrewAPicture and obenland, fixes #23543.

git-svn-id: http://core.svn.wordpress.org/trunk@23523 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
1 parent 46a8e6e commit 6d5ecce9230f937f82d31ba29f1db4cde8cc34b4 @nanobar nanobar committed Feb 28, 2013
Showing with 19 additions and 0 deletions.
  1. +19 −0 wp-content/themes/twentythirteen/functions.php
@@ -561,6 +561,25 @@ function twentythirteen_aside_date( $content ) {
add_filter( 'the_content', 'twentythirteen_aside_date', 8 ); // After embeds, before everything else.
/**
+ * Usability improvement for better viewing of images on attachment pages.
+ *
+ * Moves the focus down to the main content area to by appending an in-page
+ * anchor to attachment link URLs.
+ *
+ * @since Twenty Thirteen 1.0
+ *
+ * @param string $url The image attachment URL
+ * @return string URL with extra anchor appended.
+ */
+function twentythirteen_attachment_link( $url ) {
+ if ( wp_attachment_is_image() )
+ $url .= '#main';
+
+ return $url;
+}
+add_filter( 'attachment_link', 'twentythirteen_attachment_link' );
+
+/**
* Add postMessage support for site title and description for the Customizer.
*
* @since Twenty Thirteen 1.0

0 comments on commit 6d5ecce

Please sign in to comment.