Skip to content

Commit

Permalink
Fix: Show the author and author name examples in the Stylebook (#69436)
Browse files Browse the repository at this point in the history
Co-authored-by: carolinan <[email protected]>
Co-authored-by: Mamaduka <[email protected]>
Co-authored-by: im3dabasia <[email protected]>
  • Loading branch information
4 people authored and gutenbergplugin committed Mar 5, 2025
1 parent 9f8d16d commit f4039e8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions packages/block-library/src/post-author-name/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,15 @@ function PostAuthorNameEdit( {
</ToolsPanel>
</InspectorControls>
<div { ...blockProps }>
{ supportsAuthor
? displayAuthor
: sprintf(
{ ! supportsAuthor && postType !== undefined
? sprintf(
// translators: %s: Name of the post type e.g: "post".
__(
'This post type (%s) does not support the author.'
),
postType
) }
)
: displayAuthor }
</div>
</>
);
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/post-author/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ function PostAuthorEdit( {
const showAuthorControl =
!! postId && ! isDescendentOfQueryLoop && authorOptions.length > 0;

if ( ! supportsAuthor ) {
if ( ! supportsAuthor && postType !== undefined ) {
return (
<div { ...blockProps }>
{ sprintf(
Expand Down

0 comments on commit f4039e8

Please sign in to comment.