Skip to content

Instantly share code, notes, and snippets.

@phpbits
Last active June 2, 2023 15:21
Show Gist options
  • Save phpbits/2514fdb6dacabcb51200d8ab2b46a0db to your computer and use it in GitHub Desktop.
Save phpbits/2514fdb6dacabcb51200d8ab2b46a0db to your computer and use it in GitHub Desktop.
const { __ } = wp.i18n;
const { useSelect } = wp.data;
const { store: blockEditorStore } = wp.blockEditor;
/**
* Block Edit Component
*/
const Edit = (props) => {
const { clientId } = props;
const innerBlocks = useSelect(
(select) => select(blockEditorStore).getBlock(clientId).innerBlocks,
);
console.log( innerBlocks ); // This will log all the inner blocks on your browser console
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment