The post title is part of the Post Editor data, stored in the core/editor
data store.
To add/edit the post title, we will make use of the editPost action in the following way:
wp.data.dispatch( 'core/editor' ).editPost( { title: 'This is the post title' } );
Code language: TypeScript (typescript)
That’s it. You can try this command in the browser’s developer console as seen in the video below:
Leave a Reply