函数原型
clean_pre( array|string $matches ): string
函数描述
Accepts matches array from preg_replace_callback in wpautop() or a string.
是否弃用
Warning: This function has been deprecated.
函数参数
-
$matches
array|string
Required - The array or string
函数返回值
string The pre block without paragraph/line break conversion.
函数位置
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;
}
源码链接
变更日志
| Version | Description |
|---|---|
| 3.4.0 | This function has been deprecated. |
| 1.2.0 | Introduced. |

