Categories
WordPress

Checking Out Block Editor’s Data Module Selector/Dispatcher’s Methods via Console

I’ve been involved on Block Editor (Gutenberg) related project lately and one of the trick that I found useful the most is the fact that Block Editor’s data modules are exposed and accessible via browser console.

let’s say you want to checkout what selectors are available for core/block-editor data module. You can open browser console then type wp.data.select('core/block-editor'):

List of selectors available for core/block-editor data module

If you execute any of them, it’ll return actual data of current editor state:

You can do the same with dispatcher. If you’re looking for what methods available on core/block-editor, you open browser and type wp.data.dispatch('core/block-editor').

Leave a Reply

Your email address will not be published. Required fields are marked *