7 visitas
Hola @jeyjoo,
Me da pena oír eso. Aplique los códigos siguientes, esto podría resolver el problema.
Agregue un filtro personalizado en funciones.php:
add_filter('the_content', 'preserve_original_html', 99, 1);
function preserve_original_html($content) {
if (is_admin() && function_exists('get_current_screen')) {
$screen = get_current_screen();
if ($screen && $screen->is_block_editor) {
return $content;
}
}
return $content;
}
Si el código anterior no resuelve el problema, puede agregar este fragmento de código:
add_filter('wp_kses_allowed_html', 'preserve_imported_html_attributes', 10, 2);
function preserve_imported_html_attributes($allowedtags, $context) {
if ($context === 'post') {
$allowedtags['p'] = array(
'style' => true,
'class' => true,
'id' => true
);
$allowedtags['img'] = array(
'src' => true,
'alt' => true,
'width' => true,
'height' => true,
'class' => true,
'style' => true,
'decoding' => true,
'loading' => true
);
}
return $allowedtags;
}add_filter('enable_block_editor_backwards_compatibility', '__return_true');
add_filter('wp_img_tag_add_loading_attr', '__return_false');
add_filter('wp_img_tag_add_decoding_attr', '__return_false');