Skip to content

Commit

Permalink
Unify theme block placeholder content (#35517)
Browse files Browse the repository at this point in the history
* Unify placeholder content

* Formatting

* Use title case
  • Loading branch information
jameskoster committed Oct 12, 2021
1 parent 8115587 commit 3bc31a2
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 21 deletions.
2 changes: 1 addition & 1 deletion packages/block-library/src/post-content/edit.js
Expand Up @@ -85,7 +85,7 @@ function Placeholder() {
const blockProps = useBlockProps();
return (
<div { ...blockProps }>
<p>{ __( 'This is a placeholder for post content.' ) }</p>
<p>{ __( 'Post Content' ) }</p>
</div>
);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/post-date/edit.js
Expand Up @@ -72,7 +72,7 @@ export default function PostDateEdit( {
{ dateI18n( resolvedFormat, date ) }
</time>
) : (
__( 'No Date' )
__( 'Post Date' )
);
if ( isLink && date ) {
postDate = (
Expand Down
4 changes: 1 addition & 3 deletions packages/block-library/src/post-excerpt/edit.js
Expand Up @@ -59,9 +59,7 @@ export default function PostExcerptEditor( {
if ( ! postType || ! postId ) {
return (
<div { ...blockProps }>
<Warning>
{ __( 'Post excerpt block: no post found.' ) }
</Warning>
<Warning>{ __( 'Post Excerpt' ) }</Warning>
</div>
);
}
Expand Down
16 changes: 2 additions & 14 deletions packages/block-library/src/post-terms/edit.js
Expand Up @@ -52,20 +52,8 @@ export default function PostTermsEdit( {
} ),
} );

if ( ! hasPost ) {
return (
<div { ...blockProps }>
{ __( 'Post Terms block: post not found.' ) }
</div>
);
}

if ( ! term ) {
return (
<div { ...blockProps }>
{ __( 'Post Terms block: no term specified.' ) }
</div>
);
if ( ! hasPost || ! term ) {
return <div { ...blockProps }>{ __( 'Post Terms' ) }</div>;
}

return (
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/post-title/edit.js
Expand Up @@ -46,7 +46,7 @@ export default function PostTitleEdit( {
} );

let titleElement = (
<TagName { ...blockProps }>{ __( 'An example title' ) }</TagName>
<TagName { ...blockProps }>{ __( 'Post Title' ) }</TagName>
);

if ( postType && postId ) {
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/term-description/edit.js
Expand Up @@ -37,7 +37,7 @@ export default function TermDescriptionEdit( {
</BlockControls>
<div { ...blockProps }>
<div className="wp-block-term-description__placeholder">
<span>{ __( 'Term description.' ) }</span>
<span>{ __( 'Term Description' ) }</span>
</div>
</div>
</>
Expand Down

0 comments on commit 3bc31a2

Please sign in to comment.