WordPress.org

Make WordPress Core

Ticket #32317: 32317.diff

File 32317.diff, 1.4 KB (added by neoxx, 6 years ago)
  • template-tags.php

     
    109109                echo '<span class="featured-post">' . __( 'Sticky', 'twentyfourteen' ) . '</span>';
    110110        }
    111111
     112        $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
     113
     114        if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
     115                $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated hide" datetime="%3$s">%4$s</time>';
     116        }
     117
     118        $time_string = sprintf( $time_string,
     119                esc_attr( get_the_date( 'c' ) ),
     120                get_the_date(),
     121                esc_attr( get_the_modified_date( 'c' ) ),
     122                get_the_modified_date()
     123        );
     124
    112125        // Set up and print post meta information.
    113         printf( '<span class="entry-date"><a href="%1$s" rel="bookmark"><time class="entry-date" datetime="%2$s">%3$s</time></a></span> <span class="byline"><span class="author vcard"><a class="url fn n" href="%4$s" rel="author">%5$s</a></span></span>',
     126        printf( '<span class="entry-date"><a href="%1$s" rel="bookmark">' . $time_string . '</a></span><span class="byline"><span class="author vcard"><a class="url fn n" href="%2$s" rel="author">%3$s</a></span></span>',
    114127                esc_url( get_permalink() ),
    115                 esc_attr( get_the_date( 'c' ) ),
    116                 esc_html( get_the_date() ),
    117128                esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
    118129                get_the_author()
    119130        );