-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please expose registered aspect ratios in the block editor data store #67211
Comments
I think you can get the default and theme settings via the import { useSettings } from '@wordpress/block-editor';
function MyComponent() {
const [ defaultRatios, themeRatios ] = useSettings(
'dimensions.aspectRatios.default',
'dimensions.aspectRatios.theme'
);
console.log( defaultRatios );
console.log( themeRatios );
return <div>My Component</div>;
} |
Ah, thanks Aki. That works fine when I merge the two arrays together. It's a shame that the options for
|
@markhowellsmead The |
Yes, but the available option keys aren't. |
Got it, maybe the documentation needs to be a bit more detailed. |
What problem does this address?
This will allow extenders to use the registered aspect ratios in their own components / blocks. This would be useful as there is no aspect ratio component available.
The text was updated successfully, but these errors were encountered: