clean_pre()
Deprecated from version 3.4.0. It is no longer supported and can be removed in future releases. It is recommended to replace this function with the same one.
Ensures that the contents of a <pre>...</pre> HTML block are not converted into paragraphs or line breaks.
No Hooks.
Return
String
. The pre block without paragraph/line break conversion.
Usage
clean_pre( $matches );
- $matches(array|string) (required)
- The array or string
Changelog
Since 1.2.0 | Introduced. | |
Deprecated | 3.4.0 |
Code of clean_pre() clean pre WP 6.0
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; }