Changeset 8646 for sites/trunk/wordcamp.org/public_html/wp-content/themes/campsite-2017/functions.php
- Timestamp:
- 04/16/2019 10:21:35 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/themes/campsite-2017/functions.php
r8554 r8646 10 10 add_action( 'after_setup_theme', __NAMESPACE__ . '\setup_theme' ); 11 11 add_action( 'after_setup_theme', __NAMESPACE__ . '\content_width', 0 ); 12 add_filter( 'excerpt_more', __NAMESPACE__ . '\excerpt_more' ); 12 13 add_action( 'widgets_init', __NAMESPACE__ . '\widgets_init' ); 13 14 add_action( 'wp_head', __NAMESPACE__ . '\javascript_detection', 0 ); … … 230 231 register_sidebar( $args ); 231 232 } 233 } 234 235 /** 236 * Replaces "[...]" (appended to automatically generated excerpts) with ... and 237 * a 'Continue reading' link. 238 * 239 * @param string $link Link to single post/page. 240 * 241 * @return string 'Continue reading' link prepended with an ellipsis. 242 */ 243 function excerpt_more( $link ) { 244 if ( is_admin() || wcorg_skip_feature( 'campsite_2017_excerpt_more' ) ) { 245 return $link; 246 } 247 248 $link = sprintf( 249 '<a href="%1$s" class="more-link">%2$s</a>', 250 esc_url( get_permalink( get_the_ID() ) ), 251 /* translators: %s: Name of current post */ 252 sprintf( __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'wordcamporg' ), get_the_title( get_the_ID() ) ) 253 ); 254 255 return ' … ' . $link; 232 256 } 233 257
Note: See TracChangeset
for help on using the changeset viewer.