excerpt_remove_footnotes

函数
excerpt_remove_footnotes ( $content )
参数
  • (string) $content The content to parse.
    Required:
返回值
  • (string) The parsed and filtered content.
定义位置
相关方法
excerpt_remove_blocks_wp_filter_post_meta_footnoteswp_remove_object_termskses_remove_filterswp_remote_fopen
引入
6.3.0
弃用
-

从内容字符串中解析出脚注标记,并呈现适合摘录的内容。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
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
);
}
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 ); }
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
	);
}

常见问题

FAQs
查看更多 >