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
檢視更多 >