How to disable default title block in Gutenberg with Javascript

Viewed 687

Is there a way to disable the default title block in the Gutenberg editor with JavaScript? Couldn't find anything in the official API. Something like a property in the settings object that you pass when setting up the Gutenberg.

Currently, I do like so (with the title):

const window = this.iframe.contentWindow // this.iframe is a React ref
const wpData = window.wp ? window.wp.data : false
if (!wpData) {
  return
}
const newPost = Object.assign({ content: { raw: '', rendered: '' } }, window._wpGutenbergDefaultPost)
const editorSettings = {
  alignWide: false,
  availableTemplates: [],
  blockTypes: true,
  disableCustomColors: false,
  disablePostFormats: false,
  titlePlaceholder: '',
  bodyPlaceholder: 'Add content here'
}
const editor = wpData.dispatch('core/editor')

editor.setupEditor(newPost, editorSettings)
0 Answers
Related