Fix: Update Campaign blocks to use donor profile avatar #8180
+76
−24
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves GIVE-2971
Description
This PR fixes an issue where the Campaign Donations and Campaign Donors blocks were attempting to display donor avatars based on their WordPress User account. However, not all donors have associated WordPress User accounts, which caused avatar display issues.
The solution updates both blocks to:
give_donormetatable to retrieve theavatarIdmeta value directly from the donor profilewp_get_attachment_image_url()to display the avatar when anavatarIdis foundget_avatar_url()) when no custom avatar is setThis ensures that all donors, regardless of whether they have a WordPress User account, can have their custom avatars displayed correctly in the Campaign blocks.
Affects
give_donormetatable for avatar informationVisuals
Testing Instructions
Pre-review Checklist
@unreleasedtags included in DocBlocks