WordPress.org

Making WordPress.org

Changeset 4200


Ignore:
Timestamp:
10/07/2016 06:17:36 AM (5 years ago)
Author:
dd32
Message:

Plugin Directory: Trial switching out the Author Byline to utilise the plugin header Author fields.

This improves the consistency with how WordPress itself displays plugins both in the plugin listing, and in the plugin installer.

See #1719.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/plugin-single.php

    r3862 r4200  
    6161        <?php the_title( '<h1 class="plugin-title">', '</h1>' ); ?>
    6262
    63         <span class="byline"><?php printf( esc_html_x( 'By %s', 'post author', 'wporg-plugins' ), '<span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . esc_html( Template::encode( get_the_author() ) ) . '</a></span>' ); ?></span>
     63        <span class="byline"><?php
     64            $url = get_post_meta( get_the_ID(), 'header_author_uri', true );
     65            $author = get_post_meta( get_the_ID(), 'header_author', true ) ?: get_the_author();
     66
     67            printf(
     68                _x( 'By %s', 'post author', 'wporg-plugins' ),
     69                '<span class="author vcard">' .
     70                ( $url ? '<a class="url fn n" href="' . esc_url( $url ) . '">' : '' ) .
     71                esc_html( Template::encode( $author ) ) .
     72                ( $url ? '</a>' : '' ) .
     73                '</span>'
     74            );
     75        ?></span>
    6476    </header><!-- .entry-header -->
    6577
Note: See TracChangeset for help on using the changeset viewer.