Hi, I noticed there is no way to set default settings for the image block, I want the aspect ratio to be always wide (to avoid image distortion).
I saw one can modify the functions.php file and try that with no success.
function set_default_image_aspect_ratio($settings) {
$settings[‘image’][‘default’] = ‘wide’; // Change ‘wide’ to your desired aspect ratio
return $settings;
}
add_filter(‘block_editor_settings_all’, ‘set_default_image_aspect_ratio’);
Actually, I didn’t find much examples on how to use that block_editor_settings_all filter.
Is my función correct? Is there an easier way? Thanks!
[ad_2]