Make WordPress Core

Changeset 25087


Ignore:
Timestamp:
08/22/2013 05:00:36 PM (13 years ago)
Author:
lancewillett
Message:

Twenty Fourteen: Use HTML5 comment markup, props obenland. Fixes #25045.

Location:
trunk/src/wp-content/themes/twentyfourteen
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyfourteen/comments.php

    r25023 r25087  
    4141                'style'      => 'ol',
    4242                'short_ping' => true,
    43 
    44                 // TODO: Remove callback and update styles.
    45                 'callback'=>'twentyfourteen_comment',
    4643            ) );
    4744        ?>
  • trunk/src/wp-content/themes/twentyfourteen/functions.php

    r25068 r25087  
    6969
    7070    /*
     71     * Switches default core markup for search form, comment form, and comments
     72     * to output valid HTML5.
     73     */
     74    add_theme_support( 'html5', array(
     75        'search-form', 'comment-form', 'comment-list',
     76    ) );
     77
     78    /*
    7179     * Enable support for Post Formats.
    7280     * See http://codex.wordpress.org/Post_Formats
    7381     */
    7482    add_theme_support( 'post-formats', array(
    75         'aside', 'image', 'video', 'quote', 'link', 'gallery'
     83        'aside', 'image', 'video', 'quote', 'link', 'gallery',
    7684    ) );
    7785
  • trunk/src/wp-content/themes/twentyfourteen/inc/template-tags.php

    r25023 r25087  
    8585endif;
    8686
    87 if ( ! function_exists( 'twentyfourteen_comment' ) ) :
    88 /**
    89  * Template for comments and pingbacks.
    90  *
    91  * Used as a callback by wp_list_comments() for displaying the comments.
    92  *
    93  */
    94 function twentyfourteen_comment( $comment, $args, $depth ) {
    95     $GLOBALS['comment'] = $comment;
    96     switch ( $comment->comment_type ) :
    97         case 'pingback' :
    98         case 'trackback' :
    99     ?>
    100     <li class="post pingback">
    101         <p><?php _e( 'Pingback:', 'twentyfourteen' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __( 'Edit', 'twentyfourteen' ), ' ' ); ?></p>
    102     <?php
    103             break;
    104         default :
    105     ?>
    106     <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
    107         <article id="comment-<?php comment_ID(); ?>" class="comment">
    108             <footer>
    109                 <div class="comment-author vcard">
    110                     <span class="comment-author-avatar"><?php echo get_avatar( $comment, 32 ); ?></span>
    111                     <?php printf( __( '%s', 'twentyfourteen' ), sprintf( '<cite class="fn">%s</cite> says:', get_comment_author_link() ) ); ?>
    112                 </div><!-- .comment-author .vcard -->
    113             </footer>
    114 
    115             <div class="comment-content">
    116                 <?php comment_text(); ?>
    117                 <?php if ( $comment->comment_approved == '0' ) : ?>
    118                     <p><em><?php _e( 'Your comment is awaiting moderation.', 'twentyfourteen' ); ?></em></p>
    119                 <?php endif; ?>
    120             </div>
    121 
    122             <div class="comment-meta commentmetadata">
    123                 <a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>"><time pubdate datetime="<?php comment_time( 'c' ); ?>">
    124                 <?php
    125                     /* translators: 1: date, 2: time */
    126                     printf( __( '%1$s at %2$s', 'twentyfourteen' ), get_comment_date(), get_comment_time() ); ?>
    127                 </time></a>
    128                 <?php comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    129                 <?php edit_comment_link( __( 'Edit', 'twentyfourteen' ), ' ' );
    130                 ?>
    131             </div><!-- .comment-meta .commentmetadata -->
    132         </article><!-- #comment-## -->
    133 
    134     <?php
    135             break;
    136     endswitch;
    137 }
    138 endif; // ends check for twentyfourteen_comment()
    139 
    14087if ( ! function_exists( 'twentyfourteen_posted_on' ) ) :
    14188/**
  • trunk/src/wp-content/themes/twentyfourteen/style.css

    r25068 r25087  
    18511851    margin: 0 0 4.8rem 0;
    18521852}
    1853 .comment-meta,
     1853.comment-metadata,
    18541854.comment-author {
    18551855    font-size: 14px;
     
    18571857    line-height: 1.7142857142;
    18581858}
    1859 .comment-author cite {
     1859.comment-author .fn {
    18601860    font-weight: 900;
    18611861    text-transform: uppercase;
     
    18641864    color: #2b2b2b;
    18651865}
    1866 .comment-meta a,
    1867 .comment-list li.trackback a,
    1868 .comment-list li.pingback a {
     1866.comment-metadata a,
     1867.comment-list .trackback a,
     1868.comment-list .pingback a {
    18691869    color: #767676;
    18701870}
    18711871.comment-author a:hover,
    1872 .comment-meta a:hover,
     1872.comment-metadata a:hover,
    18731873.comment-list .trackback a:hover,
    18741874.comment-list .pingback a:hover {
     
    18761876    text-decoration: none;
    18771877}
    1878 .comment-edit-link:before,
    1879 .comment-reply-link:before {
     1878.comment-edit-link:before {
    18801879    color: rgba(0, 0, 0, 0.2);
    18811880    content: '\007c\0020';
     
    18971896    min-height: 48px;
    18981897    min-height: 4.8rem;
    1899     position: relative;
    19001898}
    19011899.comment-author {
     
    19041902    position: relative;
    19051903}
    1906 .comment-author .comment-author-avatar {
     1904.comment-author .avatar {
    19071905    border: 1px solid rgba(0, 0, 0, 0.1);
    19081906    padding: 2px;
     
    19171915    height: 2.2rem;
    19181916}
    1919 .bypostauthor .comment-author .comment-author-avatar {
     1917.bypostauthor .avatar {
    19201918    background-color: #24890d;
    19211919}
    1922 .comment-author cite {
     1920.comment-author .fn {
    19231921    font-style: normal;
    19241922}
     
    19341932    height: 2.2rem;
    19351933}
    1936 .comment-meta,
     1934.comment-metadata,
    19371935.comment-content {
    19381936    padding-left: 36px;
     
    24132411    .content-area .byline a:before,
    24142412    .content-area .comments-link a:before,
    2415     .content-area .edit-link a:before,
     2413    .entry-meta .edit-link a:before,
    24162414    .attachment .entry-date:before,
    24172415    .content-area .full-size-link a:before,
     
    24762474        margin: -0.1rem 0.2rem 0 0;
    24772475    }
    2478     .content-area .edit-link a:before {
     2476    .entry-meta .edit-link a:before {
    24792477        content: '\F411';
    24802478        margin: -1px 2px 0 0;
     
    24872485        content: '\F301';
    24882486    }
    2489     .page .content-area .edit-link a:before {
     2487    .page .entry-meta .edit-link a:before {
    24902488        margin: 5px 2px 0 0;
    24912489        margin: 0.5rem 0.2rem 0 0;
     
    26062604    }
    26072605    .comments-area article,
    2608     .comment-list li.trackback,
    2609     .comment-list li.pingback {
     2606    .comment-list .trackback,
     2607    .comment-list .pingback {
    26102608        margin-bottom: 36px;
    26112609        margin-bottom: 3.6rem;
     
    26132611        padding-top: 3.6rem;
    26142612    }
    2615     .comment-author {
    2616         padding-left: 60px;
    2617         padding-left: 6.0rem;
    2618     }
    2619     .comment-author .comment-author-avatar,
    26202613    .comment-author .avatar {
    26212614        width: 32px;
     
    26242617        height: 3.2rem;
    26252618    }
    2626     .comment-meta,
     2619    .comment-author,
     2620    .comment-metadata,
    26272621    .comment-content {
    26282622        padding-left: 60px;
     
    26332627    .comment-respond,
    26342628    .comments-area article,
    2635     .comment-list li.trackback,
    2636     .comment-list li.pingback,
     2629    .comment-list .trackback,
     2630    .comment-list .pingback,
    26372631    .post-navigation [rel="prev"],
    26382632    .post-navigation [rel="next"] {
     
    26532647    .full-width .comment-respond,
    26542648    .full-width .comments-area article,
    2655     .full-width .comment-list li.trackback,
    2656     .full-width .comment-list li.pingback {
     2649    .full-width .comment-list .trackback,
     2650    .full-width .comment-list .pingback {
    26572651        padding-right: 6.04307432%;
    26582652        padding-left: 6.04307432%;
     
    27292723    .comment-respond,
    27302724    .comments-area article,
    2731     .comment-list li.trackback,
    2732     .comment-list li.pingback,
     2725    .comment-list .trackback,
     2726    .comment-list .pingback,
    27332727    .post-navigation [rel="prev"],
    27342728    .post-navigation [rel="next"] {
     
    27532747    .full-width .comment-respond,
    27542748    .full-width .comments-area article,
    2755     .full-width .comment-list li.trackback,
    2756     .full-width .comment-list li.pingback {
     2749    .full-width .comment-list .trackback,
     2750    .full-width .comment-list .pingback {
    27572751        padding-right: 11.30926724%;
    27582752        padding-left: 11.30926724%;
     
    29242918    .comment-respond,
    29252919    .comments-area article,
    2926     .comment-list li.trackback,
    2927     .comment-list li.pingback,
     2920    .comment-list .trackback,
     2921    .comment-list .pingback,
    29282922    .post-navigation [rel="prev"],
    29292923    .post-navigation [rel="next"] {
     
    29442938    .full-width .comment-respond,
    29452939    .full-width .comments-area article,
    2946     .full-width .comment-list li.trackback,
    2947     .full-width .comment-list li.pingback {
     2940    .full-width .comment-list .trackback,
     2941    .full-width .comment-list .pingback {
    29482942        padding-right: 5.882236%;
    29492943        padding-left: 5.882236%;
     
    29982992    .comment-respond,
    29992993    .comments-area article,
    3000     .comment-list li.trackback,
    3001     .comment-list li.pingback,
     2994    .comment-list .trackback,
     2995    .comment-list .pingback,
    30022996    .post-navigation [rel="prev"],
    30032997    .post-navigation [rel="next"] {
     
    30363030    .full-width .comment-respond,
    30373031    .full-width .comments-area article,
    3038     .full-width .comment-list li.trackback,
    3039     .full-width .comment-list li.pingback {
     3032    .full-width .comment-list .trackback,
     3033    .full-width .comment-list .pingback {
    30403034        padding-right: 11.21868265%;
    30413035        padding-left: 11.21868265%;
     
    30763070    .full-width .comment-respond,
    30773071    .full-width .comments-area article,
    3078     .full-width .comment-list li.trackback,
    3079     .full-width .comment-list li.pingback {
     3072    .full-width .comment-list .trackback,
     3073    .full-width .comment-list .pingback {
    30803074        padding-right: 0;
    30813075    }
Note: See TracChangeset for help on using the changeset viewer.