@@ -40,7 +40,7 @@ class WP_On_This_Day {
4040 * @since 7.1.0
4141 * @var int
4242 */
43- const CACHE_VERSION = 2 ;
43+ const CACHE_VERSION = 5 ;
4444
4545 /**
4646 * Renders the dashboard widget output.
@@ -222,7 +222,7 @@ protected static function render_posts( $posts ) {
222222 }
223223 ?>
224224 <li class="<?php echo esc_attr ( $ group_classes ); ?> ">
225- <h3 class="on-this-day-year-header">
225+ <p class="on-this-day-year-header">
226226 <span class="on-this-day-year-number"><?php echo esc_html ( $ year ); ?> </span>
227227 <span class="on-this-day-year-ago">
228228 <?php
@@ -233,7 +233,7 @@ protected static function render_posts( $posts ) {
233233 );
234234 ?>
235235 </span>
236- </h3 >
236+ </p >
237237 <ul class="on-this-day-post-list">
238238 <?php foreach ( $ year_posts as $ post ) : ?>
239239 <?php self ::render_post ( $ post ); ?>
@@ -279,11 +279,23 @@ protected static function render_post( $post ) {
279279 ?>
280280 <li class="<?php echo esc_attr ( $ row_classes ); ?> ">
281281 <?php if ( $ is_private ) : ?>
282- <span class="on-this-day-post-icon dashicons-before dashicons-lock" aria-hidden="true">
282+ <span class="on-this-day-post-icon dashicons-before dashicons-lock" aria-hidden="true"></span>
283+ <?php elseif ( has_post_thumbnail ( $ post ) ) : ?>
284+ <span class="on-this-day-post-icon has-thumbnail" aria-hidden="true">
285+ <?php
286+ echo get_the_post_thumbnail (
287+ $ post ,
288+ array ( 56 , 56 ),
289+ array (
290+ 'alt ' => '' ,
291+ 'loading ' => 'lazy ' ,
292+ )
293+ );
294+ ?>
295+ </span>
283296 <?php else : ?>
284- <span class="on-this-day-post-icon dashicons-before dashicons-edit" aria-hidden="true">
297+ <span class="on-this-day-post-icon dashicons-before dashicons-edit" aria-hidden="true"></span>
285298 <?php endif ; ?>
286- </span>
287299 <div class="on-this-day-post-body">
288300 <span class="screen-reader-text">
289301 <?php echo $ is_private ? esc_html__ ( 'Private post ' ) : esc_html__ ( 'Published post ' ); ?>
@@ -320,18 +332,18 @@ protected static function render_post( $post ) {
320332 <span class="on-this-day-post-sep" aria-hidden="true">·</span>
321333 <span class="on-this-day-post-private"><?php _e ( 'Private ' ); ?> </span>
322334 <?php endif ; ?>
323-
324- <?php if ( $ edit_link || ( 'publish ' === $ status && $ view_link ) ) : ?>
325- <span class="on-this-day-post-actions">
326- <?php if ( $ edit_link ) : ?>
327- <a class="on-this-day-post-action" href="<?php echo esc_url ( $ edit_link ); ?> "><?php _e ( 'Edit ' ); ?> </a>
328- <?php endif ; ?>
329- <?php if ( 'publish ' === $ status && $ view_link ) : ?>
330- <a class="on-this-day-post-action" href="<?php echo esc_url ( $ view_link ); ?> " target="_blank" rel="noopener"><?php _e ( 'View ' ); ?> </a>
331- <?php endif ; ?>
332- </span>
333- <?php endif ; ?>
334335 </div>
336+
337+ <?php if ( $ edit_link || ( 'publish ' === $ status && $ view_link ) ) : ?>
338+ <div class="on-this-day-post-actions">
339+ <?php if ( $ edit_link ) : ?>
340+ <a class="on-this-day-post-action button button-secondary button-compact" href="<?php echo esc_url ( $ edit_link ); ?> "><?php _e ( 'Edit ' ); ?> </a>
341+ <?php endif ; ?>
342+ <?php if ( 'publish ' === $ status && $ view_link ) : ?>
343+ <a class="on-this-day-post-action button-link is-compact" href="<?php echo esc_url ( $ view_link ); ?> " target="_blank" rel="noopener"><?php _e ( 'View ' ); ?> </a>
344+ <?php endif ; ?>
345+ </div>
346+ <?php endif ; ?>
335347 </div>
336348 </li>
337349 <?php
0 commit comments