wp_embed_excerpt_more

函数


wp_embed_excerpt_more ( $more_string )
参数
  • (string)
    $more_string
    Default ‘more’ string.
    Required:
返回值
  • (string) ‘Continue reading’ link prepended with an ellipsis.
定义位置
  • wp-includes/embed.php
    , line 986
引入
4.4.0
弃用

Filters the string in the ‘more’ link displayed after a trimmed excerpt.

Replaces ‘[…]’ (appended to automatically generated excerpts) with an
ellipsis and a “Continue reading” link in the embed template.

function wp_embed_excerpt_more( $more_string ) {
	if ( ! is_embed() ) {
		return $more_string;
	}

	$link = sprintf(
		'%2$s',
		esc_url( get_permalink() ),
		/* translators: %s: Post title. */
		sprintf( __( 'Continue reading %s' ), '' . get_the_title() . '' )
	);
	return ' … ' . $link;
}