wpseek.com
WordPress开发者和主题制作者的搜索引擎



excerpt_remove_footnotes › WordPress Function

Since6.3.0
已弃用n/a
excerpt_remove_footnotes ( $content )
参数:
  • (string) $content The content to parse.
    Required: Yes
返回:
  • (string) The parsed and filtered content.
定义在:
文档:

Parses footnotes markup out of a content string, and renders those appropriate for the excerpt.



源码

function excerpt_remove_footnotes( $content ) {
	if ( ! str_contains( $content, 'data-fn=' ) ) {
		return $content;
	}

	return preg_replace(
		'_<sup data-fn="[^"]+" class="[^"]+">\s*<a href="[^"]+" id="[^"]+">\d+</a>\s*</sup>_',
		'',
		$content
	);
}