Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




clean_pre [ WordPress Function ]

clean_pre ( $matches )
Parameters:
  • (array|string) $matches The array or string
Returns:
  • (string) The pre block without paragraph/line-break conversion.
Defined at:



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

Ensures that the contents of a <

>...<

HTML block are not converted into paragraphs or line-breaks.

Source


<?php
function clean_pre($matches) {
    
_deprecated_function__FUNCTION__'3.4' );

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

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics