Kishan Jasani

Code, Creativity & Everything I Learn

Get post type in block editor

If you want to get post type in a block editor script, you can use the following code to get the post type:

wp.data.select('core/editor').getCurrentPostType()

Leave a Reply