wpseek.com
A WordPress-centric search engine for devs and theme authors



excerpt_remove_footnotes › WordPress Function

Since6.3.0
Deprecatedn/a
excerpt_remove_footnotes ( $content )
Parameters:
  • (string) $content The content to parse.
    Required: Yes
Returns:
  • (string) The parsed and filtered content.
Defined at:
Codex:

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



Source

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
	);
}