WordPress.org

Make WordPress Core

Changeset 23523


Ignore:
Timestamp:
02/28/2013 06:33:39 PM (5 years ago)
Author:
lancewillett
Message:

Twenty Thirteen: usability improvement for better viewing of images on attachment pages. Props DrewAPicture and obenland, fixes #23543.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentythirteen/functions.php

    r23498 r23523  
    562562
    563563/**
     564 * Usability improvement for better viewing of images on attachment pages.
     565 *
     566 * Moves the focus down to the main content area to by appending an in-page
     567 * anchor to attachment link URLs.
     568 *
     569 * @since Twenty Thirteen 1.0
     570 *
     571 * @param string $url The image attachment URL
     572 * @return string URL with extra anchor appended.
     573 */
     574function twentythirteen_attachment_link( $url ) {
     575    if ( wp_attachment_is_image() )
     576        $url .= '#main';
     577
     578    return $url;
     579}
     580add_filter( 'attachment_link', 'twentythirteen_attachment_link' );
     581
     582/**
    564583 * Add postMessage support for site title and description for the Customizer.
    565584 *
Note: See TracChangeset for help on using the changeset viewer.