More reliable way to get author and autorurl (#546)

---------

Co-authored-by: Matt Wiebe <wiebe@automattic.com>
This commit is contained in:
Ulrich Kiermayr 2023-11-07 00:10:54 +01:00 committed by GitHub
parent 74a774e8e7
commit 9d5bd8c220
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View file

@ -390,7 +390,8 @@ class Shortcodes {
return ''; return '';
} }
$name = \get_the_author_meta( 'display_name', $item->post_author ); $author_id = \get_post_field( 'post_author', $item->ID );
$name = \get_the_author_meta( 'display_name', $author_id );
if ( ! $name ) { if ( ! $name ) {
return ''; return '';
@ -415,7 +416,8 @@ class Shortcodes {
return ''; return '';
} }
$url = \get_the_author_meta( 'user_url', $item->post_author ); $author_id = \get_post_field( 'post_author', $item->ID );
$url = \get_the_author_meta( 'user_url', $author_id );
if ( ! $url ) { if ( ! $url ) {
return ''; return '';

View file

@ -111,6 +111,7 @@ Project maintained on GitHub at [automattic/wordpress-activitypub](https://githu
* Improved: better error messages if remote profile is not accessible * Improved: better error messages if remote profile is not accessible
* Improved: PHP 8.1 compatibility * Improved: PHP 8.1 compatibility
* Fixed: don't try to parse mentions or hashtags for very large (>1MB) posts to prevent timeouts * Fixed: don't try to parse mentions or hashtags for very large (>1MB) posts to prevent timeouts
* Improved: more reliable [ap_author], props @uk3
= 1.0.10 = = 1.0.10 =