[buddypress-trac] [BuddyPress Trac] #9331: Blogs: bp_get_blog_avatar() ignores custom alt text when a site icon is used
buddypress-trac
noreply at wordpress.org
Tue Mar 10 14:52:51 UTC 2026
#9331: Blogs: bp_get_blog_avatar() ignores custom alt text when a site icon is
used
-------------------------------------------------+-------------------------
Reporter: ravikhadka | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting
| Review
Component: Blogs | Version:
Severity: normal | Resolution:
Keywords: has-patch needs-testing has-unit- |
tests |
-------------------------------------------------+-------------------------
Changes (by prbot):
* keywords: has-patch needs-testing => has-patch needs-testing has-unit-
tests
Comment:
''This ticket was mentioned in
[https://github.com/buddypress/buddypress/pull/440 PR #440] on
[https://github.com/buddypress/buddypress/ buddypress/buddypress] by
[https://profiles.wordpress.org/ravikhadka/ @ravikhadka].''
Fixes [](https://buddypress.trac.wordpress.org/ticket/9331)
When a blog has a site icon, `bp_get_blog_avatar()` generated the `<img>`
alt attribute from `$alt_attribute` instead of parsed args (`$r['alt']`),
so custom alt text passed by callers was ignored in the site-icon path.
This change switches the site-icon markup to use `$r['alt']`. Default
behavior is unchanged because `$r['alt']` already defaults to
`$alt_attribute`.
Tests:
- Extend
`BP_Tests_Blogs_Template::test_bp_get_blog_avatar_has_site_icon()` to
assert `alt="test"` is present.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/9331#comment:1>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list