Warning: This function has been deprecated.

clean_pre( array|string $matches )

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


Description Description

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


Parameters Parameters

$matches

(array|string) (Required) The array or string


Top ↑

Return Return

(string) The pre block without paragraph/line-break conversion.


Top ↑

Source Source

File: wp-includes/deprecated.php

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

Top ↑

Changelog Changelog

Changelog
Version Description
3.4.0 This function has been deprecated.
1.2.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

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