How to get the post title inside a custom block in a loop? block.js
We can utilize the useSelect hook from the @wordpress/data package to display the post title in custom block within the WordPress block editor. useSelect hook allows us to fetch the post data using the current post ID within the block editor. Here’s the updated code of custom-blocks.js to achieve this. import { registerBlockType } from … Read more