This repository has been archived by the owner on Mar 7, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
115 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
/** | ||
* check if user has an account (WebFinger) | ||
* | ||
* @param int $user_id | ||
* | ||
* @return boolean | ||
*/ | ||
function ostatus_has_acct( $user_id ) { | ||
return (boolean) ostatus_get_acct( $user_id ); | ||
} | ||
|
||
/** | ||
* Returns the user account (WebFinger) | ||
* | ||
* @param int $user_id | ||
* | ||
* @return string the account or the email | ||
*/ | ||
function ostatus_get_acct( $user_id ) { | ||
$user = get_user_by( 'id', $user_id ); | ||
|
||
if ( $user ) { | ||
return $user->user_login . '@' . parse_url( home_url(), PHP_URL_HOST ); | ||
} else { | ||
return ''; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
<author> | ||
<activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type> | ||
<name><?php the_author() ?></name> | ||
<summary type="html"><?php echo esc_html( get_the_author_meta( 'description' ) ); ?></summary> | ||
<uri><?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ), get_the_author_meta( 'user_nicename' ) ) ); ?></uri> | ||
<email><?php echo esc_html( ostatus_get_acct( get_the_author_meta( 'ID' ) ) ); ?></email> | ||
<link rel="alternate" type="text/html" href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ), get_the_author_meta( 'user_nicename' ) ) ); ?>" /> | ||
<link rel="avatar" media:width="120" media:height="120" href="<?php echo esc_url( get_avatar_url( get_the_author_meta( 'ID' ), array( 'size' => 120 ) ) ); ?>" /> | ||
<?php if ( has_header_image() ) { ?> | ||
<link rel="header" href="<?php echo get_header_image(); ?>" /> | ||
<?php } ?> | ||
<poco:preferredUsername><?php the_author_meta( 'login' ); ?></poco:preferredUsername> | ||
<poco:displayName><?php the_author() ?></poco:displayName> | ||
<poco:note><?php echo esc_html( get_the_author_meta( 'description' ) ); ?></poco:note> | ||
<poco:note><?php echo wp_strip_all_tags( get_the_author_meta( 'description' ) ); ?></poco:note> | ||
</author> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<summary type="html"><?php echo esc_html( get_the_author_meta( 'description' ) ); ?></summary> | ||
<uri><?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ), get_the_author_meta( 'user_nicename' ) ) ); ?></uri> | ||
<email><?php echo esc_html( ostatus_get_acct( get_the_author_meta( 'ID' ) ) ); ?></email> | ||
<link rel="alternate" type="text/html" href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ), get_the_author_meta( 'user_nicename' ) ) ); ?>" /> | ||
<link rel="avatar" media:width="120" media:height="120" href="<?php echo esc_url( get_avatar_url( get_the_author_meta( 'ID' ), array( 'size' => 120 ) ) ); ?>" /> | ||
<?php if ( has_header_image() ) { ?> | ||
<link rel="header" href="<?php echo get_header_image(); ?>" /> | ||
<?php } ?> | ||
<poco:preferredUsername><?php the_author_meta( 'login' ); ?></poco:preferredUsername> | ||
<poco:displayName><?php the_author() ?></poco:displayName> | ||
<poco:note><?php echo wp_strip_all_tags( get_the_author_meta( 'description' ) ); ?></poco:note> |