Media library style not loading correctly when selecting a page featured image – WordPress

After some search, the problem was in the pages which contains ACF blocks

ACF plugin is not compatible with the latest WP 5.9.1

temporary fixes until the update has been released :

1- In your functions.php file add these lines:

[php]function acf_fix_preload_path( $preload_paths ) {
global $post;
$rest_path = rest_get_route_for_post( $post );
$remove_path = add_query_arg( ‘context’, ‘edit’, $rest_path );
return array_filter(
function( $url ) use ( $remove_path ) {
return $url !== $remove_path;
add_filter( ‘block_editor_rest_api_preload_paths’, ‘acf_fix_preload_path’, 10, 1 );[/php]

Or rollback to the previous version of WordPress like 5.9


Leave a Comment