Skip to content

Commit

Permalink
Change preview showing the name instead of the preferredUsername (#1011)
Browse files Browse the repository at this point in the history
* Fix preview showing preferredUsername instead of name

* add andremenrath to contributors

* Add fix to changelog and readme
  • Loading branch information
Menrath authored Nov 22, 2024
1 parent b729704 commit 73a2aa5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Outsource Constants to a separate file
* Better handling of `readme.txt` and `README.md`

### Fixed

* Fixed: Fediverse preview showing `preferredUsername` instead of `name`.

## 4.2.1 - 2024-11-20

### Added
Expand Down
3 changes: 2 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
=== ActivityPub ===
Contributors: automattic, pfefferle, mediaformat, mattwiebe, akirk, jeherve, nuriapena, cavalierlife
Contributors: automattic, pfefferle, mediaformat, mattwiebe, akirk, jeherve, nuriapena, cavalierlife, andremenrath
Tags: OStatus, fediverse, activitypub, activitystream
Requires at least: 5.5
Tested up to: 6.7
Expand Down Expand Up @@ -138,6 +138,7 @@ For reasons of data protection, it is not possible to see the followers of other
* Added: GitHub action to enforce Changelog updates.
* Improved: Outsource Constants to a separate file
* Improved: Better handling of `readme.txt` and `README.md`
* Fixed: Fediverse preview showing `preferredUsername` instead of `name`.

= 4.2.1 =

Expand Down
10 changes: 5 additions & 5 deletions templates/post-preview.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@
margin-bottom: 1em;
font-style: normal;
}
main address .preferred-username,
main address .name,
main address .webfinger {
color: #000;
}
.preferred-username {
.name {
color: #ccc;
font-weight: bold;
display: block;
Expand Down Expand Up @@ -183,7 +183,7 @@
<div>
<div class="fake-image"></div>
<div>
<div class="preferred-username">
<div class="name">
████ ██████
</div>
<div class="webfinger">
Expand All @@ -201,8 +201,8 @@
<address>
<img src="<?php echo esc_url( $user->get_icon()['url'] ); ?>" alt="<?php echo esc_attr( $user->get_name() ); ?>" />
<div>
<div class="preferred-username">
<?php echo esc_html( $user->get_preferred_username() ); ?>
<div class="name">
<?php echo esc_html( $user->get_name() ); ?>
</div>
<div class="webfinger">
<?php echo esc_html( '@' . $user->get_webfinger() ); ?>
Expand Down

0 comments on commit 73a2aa5

Please sign in to comment.