- Timestamp:
- 12/14/2018 02:32:33 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/5.0 merged: 43808,43821,43842,43860,43892,43904,43909,43926-43929,43956,43961-43963
- Property svn:mergeinfo changed
-
trunk/src/wp-content/themes/twentynineteen/inc/template-tags.php
r43808 r44149 5 5 * @package WordPress 6 6 * @subpackage Twenty_Nineteen 7 * @since 1.0.0 7 8 */ 8 9 … … 26 27 27 28 printf( 28 '<span class="posted-on">%1$s<a href="%2$s" rel="bookmark"> ' . $time_string . '</a></span>',29 '<span class="posted-on">%1$s<a href="%2$s" rel="bookmark">%3$s</a></span>', 29 30 twentynineteen_get_icon_svg( 'watch', 16 ), 30 31 esc_url( get_permalink() ), … … 43 44 /* translators: 1: SVG icon. 2: post author, only visible to screen readers. 3: author link. */ 44 45 twentynineteen_get_icon_svg( 'person', 16 ), 45 esc_html__( 'Posted by', 'twentynineteen' ),46 __( 'Posted by', 'twentynineteen' ), 46 47 esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), 47 48 esc_html( get_the_author() ) … … 73 74 function twentynineteen_entry_footer() { 74 75 75 // Posted by 76 twentynineteen_posted_by(); 77 78 // Hide category and tag text for pages. 76 // Hide author, post date, category and tag text for pages. 79 77 if ( 'post' === get_post_type() ) { 78 79 // Posted by 80 twentynineteen_posted_by(); 81 82 // Posted on 83 twentynineteen_posted_on(); 84 80 85 /* translators: used between list items, there is a space after the comma. */ 81 $categories_list = get_the_category_list( esc_html__( ', ', 'twentynineteen' ) );86 $categories_list = get_the_category_list( __( ', ', 'twentynineteen' ) ); 82 87 if ( $categories_list ) { 83 88 /* translators: 1: SVG icon. 2: posted in label, only visible to screen readers. 3: list of categories. */ … … 85 90 '<span class="cat-links">%1$s<span class="screen-reader-text">%2$s</span>%3$s</span>', 86 91 twentynineteen_get_icon_svg( 'archive', 16 ), 87 esc_html__( 'Posted in', 'twentynineteen' ),92 __( 'Posted in', 'twentynineteen' ), 88 93 $categories_list 89 94 ); // WPCS: XSS OK. … … 91 96 92 97 /* translators: used between list items, there is a space after the comma. */ 93 $tags_list = get_the_tag_list( '', esc_html__( ', ', 'twentynineteen' ) );98 $tags_list = get_the_tag_list( '', __( ', ', 'twentynineteen' ) ); 94 99 if ( $tags_list ) { 95 100 /* translators: 1: SVG icon. 2: posted in label, only visible to screen readers. 3: list of tags. */ 96 101 printf( 97 '<span class=" cat-links">%1$s<span class="screen-reader-text">%2$s </span>%3$s</span>',102 '<span class="tags-links">%1$s<span class="screen-reader-text">%2$s </span>%3$s</span>', 98 103 twentynineteen_get_icon_svg( 'tag', 16 ), 99 esc_html__( 'Tags:', 'twentynineteen' ),104 __( 'Tags:', 'twentynineteen' ), 100 105 $tags_list 101 106 ); // WPCS: XSS OK. … … 151 156 ?> 152 157 153 <figure class="post-thumbnail"> 154 <a class="post-thumbnail-inner" href="<?php the_permalink(); ?>" aria-hidden="true" tabindex="-1"> 155 <?php 156 the_post_thumbnail( 157 'post-thumbnail', 158 array( 159 'alt' => the_title_attribute( 160 array( 'echo' => false ) 161 ), 162 ) 163 ); 164 ?> 165 </a> 166 </figure><!-- .post-thumbnail --> 158 <figure class="post-thumbnail"> 159 <a class="post-thumbnail-inner" href="<?php the_permalink(); ?>" aria-hidden="true" tabindex="-1"> 160 <?php 161 the_post_thumbnail( 'post-thumbnail' ); 162 ?> 163 </a> 164 </figure> 167 165 168 166 <?php … … 171 169 endif; 172 170 173 if ( ! function_exists( 'twentynineteen_header_featured_image_css' ) ) :174 /**175 * Returns the CSS for the header featured image background.176 */177 function twentynineteen_header_featured_image_css() {178 $img_url = get_the_post_thumbnail_url( get_the_ID(), 'post-thumbnail' );179 return sprintf( 'body.singular .site-header.featured-image .site-branding-container:before { background-image: url(%s); }', esc_url( $img_url ) );180 }181 endif;182 183 171 if ( ! function_exists( 'twentynineteen_comment_avatar' ) ) : 184 172 /** … … 186 174 */ 187 175 function twentynineteen_get_user_avatar_markup( $id_or_email = null ) { 176 188 177 if ( ! isset( $id_or_email ) ) { 189 178 $id_or_email = get_current_user_id(); 190 179 } 191 180 192 $classes = array( 'comment-author', 'vcard' );193 194 181 return sprintf( '<div class="comment-user-avatar comment-author vcard">%s</div>', get_avatar( $id_or_email, twentynineteen_get_avatar_size() ) ); 195 182 } … … 201 188 */ 202 189 function twentynineteen_discussion_avatars_list( $comment_authors ) { 203 if ( ! empty( $comment_authors ) ) { 204 $out = array( '<ol class="discussion-avatar-list">' ); 205 foreach ( $comment_authors as $id_or_email ) { 206 $out[] = sprintf( '<li>%s</li>', twentynineteen_get_user_avatar_markup( $id_or_email ) ); 207 } 208 $out[] = '</ol><!-- .discussion-avatar-list -->'; 209 echo implode( "\n", $out ); 210 } 211 return null; 190 if ( empty( $comment_authors ) ) { 191 return; 192 } 193 echo '<ol class="discussion-avatar-list">', "\n"; 194 foreach ( $comment_authors as $id_or_email ) { 195 printf( 196 "<li>%s</li>\n", 197 twentynineteen_get_user_avatar_markup( $id_or_email ) 198 ); 199 } 200 echo '</ol><!-- .discussion-avatar-list -->', "\n"; 212 201 } 213 202 endif; … … 219 208 function twentynineteen_comment_form( $order ) { 220 209 if ( true === $order || strtolower( $order ) === strtolower( get_option( 'comment_order', 'asc' ) ) ) { 210 221 211 comment_form( 222 212 array( 223 'title_reply_before' => twentynineteen_get_user_avatar_markup(),224 213 'logged_in_as' => null, 225 214 'title_reply' => null,
Note: See TracChangeset
for help on using the changeset viewer.