Repository navigation
Conversation
r12989 added a copy of the photo with the description as alt text but kept the old copy without it, so every feed item showed the photo twice.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. Core Committers: Use this line as a base for the props when committing in SVN: 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:
|
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Set thumbnail alt text wordpress.org/public_html/wp-content/plugins/photo-directory/inc/posts.php |
The thumbnail call uses trimmed, tag-stripped post content as its alt text. |
Priority:
Estimated code review effort: 1 (Trivial) | ~3 minutes
Change: Bug fix
Merge Risk: 
Minimal · up to 7a321
-
Photo feed items now contain one image with description alt text. No issue identified here prevents merging.
Pre-merge checks: 
5
-
Full details: Docstring Coverage
-
Explanation
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
Each item in the Photo Directory feeds shows the photo twice, one copy under the other, for example in https://wordpress.org/photos/feed/ and https://wordpress.org/photos/feed/atom/.
r12989 added a copy of the photo with its description as the
alttext, to make the feed more accessible, but the old line that outputs the photo without analtargument stayed in. Soadd_photo_to_rss_feed()outputs two<img>tags with the samesrc: the first with the description asalt, the second withalt="". On 2026-10-24, all 50 items in the RSS feed and all 50 entries in the Atom feed had both copies.This removes the old line and keeps the one with the description as
alt.Without an
altargument, the removed copy would use the attachment's own alt text if one were set. The plugin does not set it, the theme'sinject_img_alt_text()always uses the description as thealtof the image on the photo page, and none of the 899 photo attachments I checked through the REST API, from 2021 to 2026, has one. So the feed image now has the samealtas the photo page.Testing
In a local WordPress trunk site, I loaded the plugin's
registrations.phpandposts.php, hookedadd_photo_to_rss_feed()onthe_content_feed, created photo posts with featured images, made them the main feed query, and rendered core's feed templates:<img>tags per item before, 1 after. The kept<img>and thefigcaptionare the same before and after.alt="".alt="", the same as the theme code gives the photo page.&,"and a tag): the kept<img>has the samealtbefore and after.loading="lazy", which now means the first three items instead of the first one and a half.Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code and Codex
Used for: Finding the bug while reading the plugin, checking the live feeds and attachments, the local feed tests, and the wording of this description. I reviewed the change and the results, and I take responsibility for the contribution.
Summary by CodeRabbit