Skip to content
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

Open
markhowellsmead opened this issue Nov 21, 2024 · 0 comments
Open
Labels
[Package] Block editor /packages/block-editor [Type] Enhancement A suggestion for improvement.

Comments

@markhowellsmead
Copy link

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.

const getAspectRatios = () => {
    const settings = wp.data.select('core/block-editor').getSettings();
    return settings?.aspectRatios || [];
};

const aspectRatios = useSelect(getAspectRatios, []);
@markhowellsmead markhowellsmead added the [Type] Enhancement A suggestion for improvement. label Nov 21, 2024
@skorasaurus skorasaurus added the [Package] Block editor /packages/block-editor label Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Block editor /packages/block-editor [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

2 participants