Meta Box
Support › Meta Box AIO › Exclude in sanitizationResolved
Hi,
When adding the text fields, is there a way that I can exclude the "<br>" code from the sanitization? I don't want to disable the sanitization completely. I just want a way to break lines. Can it be done? If so, how? Thanks.
Hello,
You can use the bypass sanitization and add the <br> tag to the text field again. Following the documentation https://docs.metabox.io/sanitization/#bypass-the-sanitization
<br>
field
It worked with the following function. In case anyone need it.
function sanitize_text_with_br($input) { // Define allowed HTML tags $allowed_html = array( 'br' => array(), );
// Sanitize the input while allowing <br> tags return wp_kses($input, $allowed_html); }