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; +}