WordPress 6.6 introduced support for custom Aspect Ratios for image blocks. Image Aspect Ratio options can be configured in the WordPress Block Editor by providing a list in the settings.dimensions
object.
There's no easy way to remove individual aspect ratios from the list. The only options are to extend the existing list or fully replace it.
So, something like the following will produce a menu with 12 Aspect Ratio choices.
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 3,
"settings": {
"dimensions": {
"aspectRatio": true,
"aspectRatios": [
{
"name": "Golden Ratio Wide - 1.618:1",
"slug": "1618-1",
"ratio": "1.618/1"
},
{
"name": "Golden Ratio Tall - 1:1.618",
"slug": "1-1618",
"ratio": "1/1.618"
},
{
"name": "Wide - 2:1",
"slug": "2-1",
"ratio": "2/1"
},
{
"name": "Tall - 1:2",
"slug": "1-2",
"ratio": "1/2"
}
],
"defaultAspectRatios": true
}
}
Switching defaultAspectRatios
to false
would only offer the four specified options: