Skip to content

Add HCard_User alias for backwards compatibility - #321

Merged
pfefferle merged 2 commits into
trunkfrom
fix/hcard-user-alias
Oct 2, 2026
Merged

pfefferle merged 2 commits into
trunkfrom
fix/hcard-user-alias

Conversation

@pfefferle

Copy link
Copy Markdown
Member

5.1.0 moved HCard_User to Indieweb\Hcard\User without keeping the old class name. Themes that check for the class now fall back to their own templates.

I got a report from @dshanske: the author bio on https://david.shanske.com/ is empty since the update. iw26 checks class_exists( 'HCard_User' ) in front-page.php, author.php and hcard.php. It now takes the fallback template-parts/biography.php, which calls get_the_author() outside the loop on the front page, so the name and bio are empty. Only the avatar shows, because it falls back to iw_default_author.

This adds a class_alias for the old name. Like in 5.0.0, it is only available when INDIEWEB_ADD_HCARD_SUPPORT is enabled.

The other classes renamed in 5.1.0 (HCard_Author_Widget, the rel-me classes) have no alias yet. I only added the one that is in use.

@pfefferle
pfefferle requested a review from dshanske September 30, 2026 11:22

@dshanske dshanske left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes the issue. I probably should just update my code though.

@pfefferle
pfefferle merged commit 64a10a9 into trunk Oct 2, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants