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()
Code, Creativity & Everything I Learn
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