excerpt_remove_footnotes( string $content ): string

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


Parameters

$content string Required
The content to parse.

Top ↑

Return

string The parsed and filtered content.


Top ↑

Source

File: wp-includes/blocks.php. View all references

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


Top ↑

Changelog

Changelog
Version Description
6.3.0 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.