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_embed_excerpt_attachment_wp_oembed_get_objectwp_trim_excerptwp_html_excerptwp_oembed_get
引入
4.4.0
弃用
-

wp_embed_excerpt_more: 这个函数用来过滤出现在嵌入式文章摘录中的”阅读更多”链接。默认情况下,这个链接的内容是”继续阅读→”,但这个函数允许开发者自定义链接中出现的文本。

过滤修剪过的摘录后显示的’更多’链接中的字符串。

在嵌入模板中用省略号和””继续阅读””链接取代'[…]’(附加到自动生成的摘录)。

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

	$link = sprintf(
		'<a href="%1$s" class="wp-embed-more" target="_top">%2$s</a>',
		esc_url( get_permalink() ),
		/* translators: %s: Post title. */
		sprintf( __( 'Continue reading %s' ), '<span class="screen-reader-text">' . get_the_title() . '</span>' )
	);
	return ' &hellip; ' . $link;
}

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2025-12-14 09:36:28

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: