-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed
Labels
[Block] Post AuthorAffects the Post Author BlockAffects the Post Author Block[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Description
Description
The Post Author Block can be inserted outside the postId context. For example, you can insert it directly into a single post template. The avatar is displayed correctly, but not in the editor.
On the other hand, the Avatar block correctly shows the avatar placeholder in the editor.
I think the Post Author Block needs a fallback avatar, like the Avatar block:
gutenberg/packages/block-library/src/avatar/hooks.js
Lines 19 to 26 in 86c423a
| function useDefaultAvatar() { | |
| const { avatarURL: defaultAvatarUrl } = useSelect( ( select ) => { | |
| const { getSettings } = select( blockEditorStore ); | |
| const { __experimentalDiscussionSettings } = getSettings(); | |
| return __experimentalDiscussionSettings; | |
| } ); | |
| return defaultAvatarUrl; | |
| } |
Step-by-step reproduction instructions
-
Paste the following HTML into the Single Posts template:
<!-- wp:group {"layout":{"type":"constrained"}} --> <div class="wp-block-group"> <!-- wp:heading --> <h2 class="wp-block-heading">Avatar Block: Avatar is displayed correctly.</h2> <!-- /wp:heading --> <!-- wp:avatar /--> <!-- wp:heading --> <h2 class="wp-block-heading">Author Block: Avatar isn't showing up.</h2> <!-- /wp:heading --> <!-- wp:post-author /--> </div> <!-- /wp:group -->
-
Confirm that the avatar placeholder of the Author block isn't displayed in the editor.
Screenshots, screen recording, code snippet
Editor (Single Posts Template)
Front end
Environment info
No response
Please confirm that you have searched existing issues in the repo.
- Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
- Yes
Please confirm which theme type you used for testing.
- Block
- Classic
- Hybrid (e.g. classic with theme.json)
- Not sure
shrivastavanolo
Metadata
Metadata
Assignees
Labels
[Block] Post AuthorAffects the Post Author BlockAffects the Post Author Block[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended