Repository navigation
Conversation
Use a complete translatable author credit through a block binding in both single-post patterns. Hide the card when author support or the author name is missing, while preserving support for saved templates. Fixes WordPress#218
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. 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. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
|
Thanks for working on this! With the binding the issue will be fixed but the trade-off is that the card gets less editable. "Written by" can't be edited in the site editor and the author name can't be styled on its own anymore. I'm wondering if relying on the avatar and the author name would be enough (like TT5 templates do) so there's no strings to reorder and everything stays editable. Just a thought. @henriqueiamarino what do you think? |
I agree with this too |
|
@MaggieCabrera and @juanfra If possible I’d like to keep the byline. “Written by” is part of the theme’s voice on single posts, and the card was designed around it, so I’d rather not drop it. Given that, the binding feels like the right shape, and it’s the mechanism we already ship for the comments CTA, so it keeps the theme consistent. On editability, the trade seems acceptable to me: anyone who doesn’t want the byline can still delete the paragraph in one click, and rewording it just means swapping in a plain paragraph. |
…translation # Conflicts: # style.min.css
I feel like this is not a good practice for a default theme. It creates an inconsistency between the editor and the frontend and is confusing for first time users. We should be careful with this kind of changes. What if we move the Written by above the author name in a different line? I made an alternative PR in #246 can you have a look? |
|
Thanks, @MaggieCabrera. How did we sorted it out in TT4 with 'by' instead of 'Written by'? I don't know about having it in two lines, it looks too heavy...
|
We didn’t really sort it out in TT4. It works the same way we do now: “by” is its own paragraph next to a separate Post Author Name block, and “in “ is a prefix on Post Terms. It only adds a translator context, so translators still can’t move the name. You can see it in the translations. The Japanese TT4 leaves “by” and “in” in English. TT5 has the same setup with “Written by”, and there Japanese translators turned it into a label: "執筆者: Rhye Moore" (“Writer: Rhye Moore”). That label idea is what #246 is going for, and it doesn’t need two lines. We could keep the current one-line pill and only change the string. We’d drop the , add a small gap between the two blocks instead, and give translators a context saying it’s a label before the author name. Then languages that put the name first can use something like “Author:”. It keeps “Written by”, keeps both blocks editable, and the editor matches the front end. I will update the PR |
|
Thanks, @MaggieCabrera, this is it for me. “Written by” stays and the editor matches the front end. I’m good with #246 going in before the string freeze. Thanks as well to @elphizu for #223, which got this conversation started. |
* Stack the "Written by" label above the author name "Written by" sits on its own line above the post author name in the single post patterns, so translators translate a standalone label instead of the start of a sentence, and the word order no longer matters. The label drops the trailing and gets a translator context. The label and the Author Name block stay separate blocks, so the editor still shows the real author name, and the label stays editable. See #218. Alternative to #223. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Keep the "Written by" label on one line with the author name Stacking the label above the name made the author card look too heavy. The label and the Author Name block sit side by side again, spaced by the group's block gap (spacing|20) instead of a trailing in the string. The label keeps working as a standalone label for translators: its context is now "Label before the post author name", and a translators comment says the name is a separate block, so languages that put the name first can translate it as a label, such as "Author:". See #218. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: elphizu <suryakantupadhyay@git.wordpress.org> Co-authored-by: juanfra <juanfra@git.wordpress.org> Co-authored-by: MaggieCabrera <onemaggie@git.wordpress.org> Co-authored-by: henriqueiamarino <iamarinoh@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org>


Fixes the single-post author credit so translators can change the order of
Written byand the author name.Adds an
ipsum/author-creditblock binding and updates both single-post patterns. Also hides the author card when author information is unavailable, while keeping existing templates compatible.Includes the rebuilt
style.min.css.Closes #218
Testing Instructions
Written by %sto%s 著and verify the order.Use of AI Tools
AI assistance: Yes
Tool: OpenAI Codex
Used for: Investigating the issue, implementing changes, and drafting the PR description. All changes were manually reviewed and tested by me.