Post Author Name: Add option to link to author website#75168
Post Author Name: Add option to link to author website#75168Mustafabharmal wants to merge 2 commits intoWordPress:trunkfrom
Conversation
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
1 similar comment
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
This looks great! My feedback is it appears that "website" is always an option in the dropdown, with a fallback. What may make sense from a UX experience is to check if the author has a website, and if not show the "old" toggle. Otherwise show the dropdown. I know this is slightly more code but think makes sense. |
|
The Post Author Name block is often used in templates (for example in Query Loop or site templates), where the actual author is fetched dynamically on the frontend. In those scenarios, the editor does not reliably know which specific author will be rendered, and different posts in the same template may have different authors, some with a website URL and some without. Because of this, hiding or showing the control based on the current author could lead to inconsistent behaviour or confusion, especially when the same template is used site-wide. Keeping the dropdown always available and falling back to the author archive when no website URL is set ensures predictable behaviour regardless of which author is rendered. Still open for alternative approaches. |
What?
Adds the ability to link the Post Author Name block (
core/post-author-name) to the author's website URL in addition to the author archive.Closes #75151
Why?
Currently, the Post Author Name block only allows linking to the author's post archive. This enhancement makes the block more flexible by allowing users to link to the author's website (as stored in their WordPress profile).
How?
linkTypeattribute toblock.jsonwith valuesarchive(default) orwebsiteget_the_author_meta( 'user_url', $author_id )whenlinkTypeis set towebsiteTesting Instructions
core/post-author-name)Screenshots or screencast
Before:
Screen.Recording.2026-02-03.at.3.04.45.PM.mov
After:
Screen.Recording.2026-02-03.at.3.02.19.PM.mov