Open sarthaknagoshe2002 opened 2 days ago
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot
label.
If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
Co-authored-by: sarthaknagoshe2002 <sarthaknagoshe2002@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: dhruvang21 <dhruvang21@git.wordpress.org>
Co-authored-by: groenroos <groenroos@git.wordpress.org>
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.
Thanks for contributing, @sarthaknagoshe2002!
I'm unsure if we need to modify the block's edit components. People with access to the editors can also access details about post type author.
If it's decided to display a notice in edit components, it should probably be a part of rendered content and not an editor notice.
cc @WordPress/gutenberg-design
If it's decided to display a notice in edit components, it should probably be a part of rendered content and not an editor notice.
@Mamaduka Can you elaborate more on this?
The blocks could render static text/warning in the editor when the post type doesn't support authors. But as I mentioned, I'm unsure if that warning makes sense in the editor context.
@Mamaduka I have implemented your suggestion now. In future if we conclude that the warning makes sense in the editor context then we can proceed with the merge.
I believe that the warning definitely makes sense in the editor context since displaying warnings/errors on the frontend doesn't seem appropriate.
Also, as you suggested static warning makes sense too.
fixes: #65816
What?
This PR updates the behavior of author blocks to ensure they do not render when the post belongs to a Custom Post Type (CPT) that does not explicitly declare support for the author feature.
Why?
Author blocks displaying on CPTs without declared author support is inconsistent with WordPress behavior. This can lead to unintentional data exposure, as WordPress still saves author information to the database even when it is not intended to be visible. Ensures better security, consistency, and adherence to user expectations for CPTs.
How?
Testing Instructions
Reproduction:-
Expected Outcome:-
In the Editor:
On the Frontend:
Screenshots or screencast
https://github.com/user-attachments/assets/0b8bde8b-b032-44bc-b3da-03b04f8cc441
The suggestion given by @dhruvang21 is also used in this PR from the comment