clean_pre()WP 1.2.0

Устарела с версии 3.4.0. Больше не поддерживается и может быть удалена. Рекомендуется заменить эту функцию на аналог.

Accepts matches array from preg_replace_callback in wpautop() or a string.

Ensures that the contents of a <pre>...</pre> HTML block are not converted into paragraphs or line breaks.

Хуков нет.

Возвращает

Строку. The pre block without paragraph/line break conversion.

Использование

clean_pre( $matches );
$matches(массив|строка) (обязательный)
The array or string

Список изменений

С версии 1.2.0 Введена.
Устарела с 3.4.0

Код clean_pre() WP 6.5.2

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