diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index 1dee5a7509d7b1..82d6828bd38363 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -546,7 +546,7 @@ Display a post's excerpt. ([Source](https://github.com/WordPress/gutenberg/tree/ - **Name:** core/post-excerpt - **Category:** theme - **Supports:** anchor, color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ -- **Attributes:** excerptLength, moreText, showMoreOnNewLine, textAlign +- **Attributes:** excerptLength, moreText, previewPlaceholder, showMoreOnNewLine, textAlign ## Post Featured Image diff --git a/packages/block-library/src/post-excerpt/block.json b/packages/block-library/src/post-excerpt/block.json index 53a92cb0bda639..fd0cb7fcb42c5b 100644 --- a/packages/block-library/src/post-excerpt/block.json +++ b/packages/block-library/src/post-excerpt/block.json @@ -20,6 +20,9 @@ "excerptLength": { "type": "number", "default": 55 + }, + "previewPlaceholder": { + "type": "string" } }, "usesContext": [ "postId", "postType", "queryId" ], diff --git a/packages/block-library/src/post-excerpt/edit.js b/packages/block-library/src/post-excerpt/edit.js index 378aa34cd00baa..9576894e937498 100644 --- a/packages/block-library/src/post-excerpt/edit.js +++ b/packages/block-library/src/post-excerpt/edit.js @@ -25,7 +25,13 @@ import { __, _x } from '@wordpress/i18n'; import { useCanEditEntity } from '../utils/hooks'; export default function PostExcerptEditor( { - attributes: { textAlign, moreText, showMoreOnNewLine, excerptLength }, + attributes: { + textAlign, + moreText, + showMoreOnNewLine, + excerptLength, + previewPlaceholder, + }, setAttributes, isSelected, context: { postId, postType, queryId }, @@ -78,14 +84,11 @@ export default function PostExcerptEditor( {
- { __( - 'This is the Post Excerpt block, it will display the excerpt from single posts.' - ) } -
-- { __( - 'If there are any Custom Post Types with support for excerpts, the Post Excerpt block can display the excerpts of those entries as well.' - ) } + { previewPlaceholder + ? previewPlaceholder + : __( + 'This is the Post Excerpt block, it will display the excerpt' + ) }