wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



excerpt_remove_footnotes › WordPress Function

Depuis6.3.0
Dépréciéen/a
excerpt_remove_footnotes ( $content )
Paramètres:
  • (string) $content The content to parse.
    Requis: Oui
Retourne:
  • (string) The parsed and filtered content.
Défini(e) dans:
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
	);
}