Ticket #52683: 52683.diff
File 52683.diff, 1.8 KB (added by , 3 years ago) |
---|
-
src/wp-content/themes/twentytwentyone/inc/template-functions.php
134 134 */ 135 135 function twenty_twenty_one_continue_reading_text() { 136 136 $continue_reading = sprintf( 137 /* translators: %s: Name of current post. */137 /* translators: %s: Post title. Only visible to screen readers. */ 138 138 esc_html__( 'Continue reading %s', 'twentytwentyone' ), 139 139 the_title( '<span class="screen-reader-text">', '</span>', false ) 140 140 ); … … 160 160 * Creates the continue reading link. 161 161 * 162 162 * @since Twenty Twenty-One 1.0 163 * @since Twenty Twenty-One 1.6 Checks for user-defined "more" text. 163 164 */ 164 function twenty_twenty_one_continue_reading_link( ) {165 function twenty_twenty_one_continue_reading_link( $more_link, $more_link_text ) { 165 166 if ( ! is_admin() ) { 166 return '<div class="more-link-container"><a class="more-link" href="' . esc_url( get_permalink() ) . '#more-' . esc_attr( get_the_ID() ) . '">' . twenty_twenty_one_continue_reading_text() . '</a></div>'; 167 $continue_reading_text = ( $more_link_text === twenty_twenty_one_continue_reading_text() ) ? twenty_twenty_one_continue_reading_text() : $more_link_text; 168 return '<div class="more-link-container"><a class="more-link" href="' . esc_url( get_permalink() ) . '#more-' . esc_attr( get_the_ID() ) . '">' . $continue_reading_text . '</a></div>'; 167 169 } 168 170 } 169 171 170 // Filter the excerpt more link.171 add_filter( 'the_content_more_link', 'twenty_twenty_one_continue_reading_link' );172 // Filter the content more link. 173 add_filter( 'the_content_more_link', 'twenty_twenty_one_continue_reading_link', 10, 2 ); 172 174 173 175 if ( ! function_exists( 'twenty_twenty_one_post_title' ) ) { 174 176 /**