WordPress.org

Make WordPress Core

Ticket #17385: author-link-hiding.diff

File author-link-hiding.diff, 2.1 KB (added by iandstewart, 7 years ago)
  • wp-content/themes/twentyeleven/style.css

     
    710710.entry-meta a {
    711711        font-weight: bold;
    712712}
     713.single-author .entry-meta .by-author {
     714        position: absolute !important;
     715        clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
     716        clip: rect(1px, 1px, 1px, 1px);
     717}
    713718.entry-content,
    714719.entry-summary {
    715720        padding: 1.625em 0 0;
  • wp-content/themes/twentyeleven/functions.php

     
    558558                        break;
    559559        endswitch;
    560560}
    561 endif; // ends check for twentyeleven_comment()
    562  No newline at end of file
     561endif; // ends check for twentyeleven_comment()
     562
     563if ( ! function_exists( 'twentyeleven_posted_on' ) ) :
     564/**
     565 * Prints HTML with meta information for the current post-date/time and author.
     566 *
     567 * @since Twenty Eleven 1.0
     568 */
     569function twentyeleven_posted_on() {
     570        printf( __( '<span class="sep">Posted on </span><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s" pubdate>%4$s</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s">%7$s</a></span></span>', 'twentyeleven' ),
     571                esc_url( get_permalink() ),
     572                esc_attr( get_the_time() ),
     573                esc_attr( get_the_date( 'c' ) ),
     574                esc_html( get_the_date() ),
     575                esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
     576                sprintf( esc_attr__( 'View all posts by %s', 'twentyeleven' ), get_the_author() ),
     577                esc_html( get_the_author() )
     578        );
     579}
     580endif;
     581
     582/**
     583 * Adds Twenty Eleven author class to the array of body classes.
     584 *
     585 * @since Twenty Eleven 1.0
     586 */
     587function twentyeleven_author_class( $classes ) {
     588
     589        if ( ! is_multi_author() ) {
     590                $classes[] = 'single-author';
     591        }
     592       
     593        return $classes;
     594}
     595add_filter( 'body_class', 'twentyeleven_author_class' );