Query loop coding problem
I found an error in the Query Loop Gutenberg Block. The returned content is not encoded correctly. I have some special characters like "š" which are converted to "Å¡".
But on the admin page and individual post pages, everything works fine.
To fix it, I need to add this code: do you have any ideas? I think it might be a Javascript rendering coding issue?
function custom_pre_render_block_filter($block_content, $block) {
if ($block['blockName'] === 'core/post-content') {
// Convertir les caractères spéciaux en entités HTML
$block_content = mb_convert_encoding($block_content, 'HTML-ENTITIES', 'UTF-8') ;
}
return $block_content.
}
add_filter('render_block', 'custom_pre_render_block_filter', 10, 2);