admin管理员组

文章数量:1197761

This question already has answers here: Gutenberg change/remove "Write your story" placeholder in custom blocks (2 answers) Closed 2 years ago.

I'd like to remove the placeholder in an empty block 'type / to choose a block'.

I often have empty spaces in my drafts as I'm writing and this placeholder clutters everything. I'd just like it empty. Is there a way to remove it with a filter?

This question already has answers here: Gutenberg change/remove "Write your story" placeholder in custom blocks (2 answers) Closed 2 years ago.

I'd like to remove the placeholder in an empty block 'type / to choose a block'.

I often have empty spaces in my drafts as I'm writing and this placeholder clutters everything. I'd just like it empty. Is there a way to remove it with a filter?

Share Improve this question asked May 30, 2022 at 23:49 RossRoss 1193 bronze badges 2
  • 2 Looks like this has been asked before here: Gutenberg change/remove "Write your story" placeholder in custom blocks – birgire Commented May 31, 2022 at 17:08
  • No, these are 2 separate questions. The "Write your story" placeholder shows in a new post when no blocks have been added. The solutions for that question do not solve my problem. My question above is the place holder in a paragraph block when there is no text. – Ross Commented Jun 7, 2022 at 23:25
Add a comment  | 

1 Answer 1

Reset to default 2
add_filter( 'write_your_story', function ( $string, $post ){ return ' '; }, 10,2);

Also answered at: https://wordpress.org/support/topic/remove-type-to-choose-a-block-block-placeholder/

Docs: https://developer.wordpress.org/reference/hooks/write_your_story/

本文标签: Remove 39typeto choose a block39 placeholder