From 01532692f16e05168e3226a23a31db57f19182d5 Mon Sep 17 00:00:00 2001 From: Edward Ficklin Date: Tue, 14 Mar 2023 13:36:47 -0400 Subject: [PATCH] template helper function for displaying fedi bio, if set --- includes/functions.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/includes/functions.php b/includes/functions.php index 8f2e5d9..9b00e8f 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -320,3 +320,17 @@ function url_to_authorid( $url ) { return 0; } + +/** + * Return the custom Activity Pub description, if set, or default author description. + * + * @param int $user_id The user ID. + * @return string + */ +function get_author_description( $user_id ) { + $description = get_user_meta( $user_id, ACTIVITYPUB_USER_DESCRIPTION_KEY, true ); + if ( empty( $description ) ) { + $description = get_user_meta( $user_id, 'description', true ); + } + return $description; +}