better add_follower handling
This commit is contained in:
parent
28922d51dd
commit
08e3104a1e
1 changed files with 5 additions and 2 deletions
|
@ -217,9 +217,12 @@ class Followers {
|
|||
$follower->from_meta( $meta );
|
||||
$follower->upsert();
|
||||
|
||||
update_post_meta( $follower->get_id(), 'user_id', $user_id, $user_id );
|
||||
$meta = get_post_meta( $follower->get_id(), 'user_id' );
|
||||
|
||||
if ( is_array( $meta ) && ! in_array( $user_id, $meta, true ) ) {
|
||||
add_post_meta( $follower->get_id(), 'user_id', $user_id );
|
||||
wp_cache_delete( sprintf( self::CACHE_KEY_INBOXES, $user_id ), 'activitypub' );
|
||||
}
|
||||
|
||||
return $follower;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue