Making WordPress.org


Ignore:
Timestamp:
12/04/2016 05:14:43 PM (8 years ago)
Author:
obenland
Message:

Plugin Directory: Provide focus styles and context for favorite button.

Fixes #2294.

File:
1 edited

Legend:

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

    r4410 r4467  
    6868            if ( is_user_logged_in() ) :
    6969                $url = Template::get_favourite_link( $post );
     70                $is_favorited = Tools::favorited_plugin( $post );
    7071                ?>
    7172                <div class="plugin-favorite">
    72                     <a href="<?php echo esc_url( $url ); ?>" class="plugin-favorite-heart<?php echo Tools::favorited_plugin( $post ) ? ' favorited' : ''; ?>"></a>
     73                    <a href="<?php echo esc_url( $url ); ?>" class="plugin-favorite-heart<?php echo $is_favorited ? ' favorited' : ''; ?>">
     74                        <span class="screen-reader-text">
     75                            <?php printf( $is_favorited ? __( 'Favorite %s' ) : __( 'Unfavorite %s' ), get_the_title() ); ?>
     76                        </span>
     77                    </a>
    7378                    <script>
    7479                        jQuery( '.plugin-favorite-heart' )
Note: See TracChangeset for help on using the changeset viewer.