template helper function for displaying fedi bio, if set
This commit is contained in:
parent
3ed96471de
commit
01532692f1
1 changed files with 14 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue