自任何属性添加到<br>
标记,包括类名和data-attr
s防止剥离,快速且不完整的方法可能是:
function filter_function_name( $content, $post_id ) {
$content = str_replace(\'<br>\', \'<br data-x>\', $content);
$content = str_replace(\'<br >\', \'<br data-x>\', $content);
$content = str_replace(\'<br />\', \'<br data-x>\', $content);
$content = str_replace(\'<br/>\', \'<br data-x>\', $content);
return $content;
}
add_filter( \'content_edit_pre\', \'filter_function_name\', 10, 2 );