Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 24 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
||
| 1 | <?php |
| 2 | /** |
| 3 | * Post Item. |
| 4 | * |
| 5 | * @package automattic/jetpack-mu-wpcom |
| 6 | * |
| 7 | * phpcs:disable WordPress.XSS.EscapeOutput.OutputNotEscaped |
| 8 | */ |
| 9 | |
| 10 | ?> |
| 11 | |
| 12 | <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
| 13 | <?php if ( has_post_thumbnail() ) : ?> |
| 14 | <figure class="a8c-posts-list-item__post-thumbnail"> |
| 15 | <a href="<?php the_permalink(); ?>"> |
| 16 | <?php the_post_thumbnail( 'post-thumbnail' ); ?> |
| 17 | </a> |
| 18 | </figure> |
| 19 | <?php endif; // has_post_thumbnail. ?> |
| 20 | |
| 21 | <?php if ( is_sticky() ) : ?> |
| 22 | <div class="a8c-posts-list-item__featured"> |
| 23 | <span><?php esc_html_e( 'Featured', 'jetpack-mu-wpcom' ); ?></span> |
| 24 | </div> |
| 25 | <?php endif; // is_sticky. ?> |
| 26 | |
| 27 | <?php the_title( sprintf( '<h2 class="a8c-posts-list-item__title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); ?> |
| 28 | |
| 29 | <div class="a8c-posts-list-item__meta"> |
| 30 | <span class="a8c-posts-list-item__datetime"><?php echo esc_html( get_the_time( get_option( 'date_format' ) ) ); ?></span> |
| 31 | <span class="a8c-posts-list-item__author"><?php echo esc_html_x( 'by', 'designating the post author (eg: by John Doe', 'jetpack-mu-wpcom' ); ?> |
| 32 | <?php the_author_posts_link(); ?> |
| 33 | </span> |
| 34 | <?php if ( current_user_can( 'edit_posts' ) ) : ?> |
| 35 | <span class="a8c-posts-list-item__edit-link"> |
| 36 | <a href="<?php echo esc_attr( get_edit_post_link() ); ?>"><?php esc_html_e( 'Edit', 'jetpack-mu-wpcom' ); ?></a> |
| 37 | </span> |
| 38 | <?php endif ?> |
| 39 | </div> |
| 40 | |
| 41 | <div class="a8c-posts-list-item__excerpt"> |
| 42 | <?php the_excerpt(); ?> |
| 43 | </div> |
| 44 | </article> |