excerpt_remove_footnotes()
Parses footnotes markup out of a content string, and renders those appropriate for the excerpt.
Хуков нет.
Возвращает
Строку. The parsed and filtered content.
Использование
excerpt_remove_footnotes( $content );
- $content(строка) (обязательный)
- The content to parse.
Список изменений
| С версии 6.3.0 | Введена. |
Код excerpt_remove_footnotes() excerpt remove footnotes WP 6.8.3
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
);
}