fix #25
This commit is contained in:
parent
6344e10ab6
commit
0fa7fc62f7
1 changed files with 24 additions and 1 deletions
|
@ -3,7 +3,30 @@
|
||||||
class Db_Activitypub_Followers {
|
class Db_Activitypub_Followers {
|
||||||
|
|
||||||
public static function get_followers( $author_id ) {
|
public static function get_followers( $author_id ) {
|
||||||
return get_user_option( 'activitypub_followers', $author_id );
|
$followers = get_user_option( 'activitypub_followers', $author_id );
|
||||||
|
|
||||||
|
if ( ! $followers ) {
|
||||||
|
return $followers;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( count( $array ) == count( $array, COUNT_RECURSIVE ) ) {
|
||||||
|
return $followers;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ( $followers as $key => $follower ) {
|
||||||
|
if (
|
||||||
|
is_array( $follower ) &&
|
||||||
|
isset( $follower['type'] ) &&
|
||||||
|
'Person' === $follower['type'] &&
|
||||||
|
isset( $follower['id'] ) &&
|
||||||
|
true === filter_var( $follower['id'], FILTER_VALIDATE_URL )
|
||||||
|
) {
|
||||||
|
unset( $followers[$key] );
|
||||||
|
$followers[] = $follower['id'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $followers;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function add_follower( $actor, $author_id ) {
|
public static function add_follower( $actor, $author_id ) {
|
||||||
|
|
Loading…
Reference in a new issue