функция
Устаревший since 1.2.0
clean_pre()
Устаревшее.
Помечено устаревшим с версии 3.4.0.
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
clean_pre( array|string $matches ): string
Описание
Гарантирует, что содержимое HTML-блока
...
не преобразуется в абзацы или переносы строк.
Оригинал (английский)
Ensures that the contents of a <pre>...</pre> HTML block are not converted into paragraphs or line breaks.
Параметры
$matches
array|string
обязательный
Массив или строка
Возвращаемое значение
string
Исходный код
wp-includes/deprecated.php:2983
function clean_pre($matches) {
_deprecated_function( __FUNCTION__, '3.4.0' );
if ( is_array($matches) )
$text = $matches[1] . $matches[2] . "</pre>";
else
$text = $matches;
$text = str_replace(array('<br />', '<br/>', '<br>'), array('', '', ''), $text);
$text = str_replace('<p>', "\n", $text);
$text = str_replace('</p>', '', $text);
return $text;
}
История изменений
| Версия | Описание |
|---|---|
| 3.4.0 | Устаревший. |
| 1.2.0 | Introduced. |

