template helper function for displaying fedi bio, if set

This commit is contained in:
Edward Ficklin 2023-03-14 13:36:47 -04:00
parent 3ed96471de
commit 01532692f1

View file

@ -320,3 +320,17 @@ function url_to_authorid( $url ) {
return 0; 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;
}