Skip to content

mastodon_api_account_following

github-actions[bot] edited this page Mar 26, 2026 · 12 revisions

Modify the account following.

Example

apply_filters( 'mastodon_api_account_following', function ( $following, $user_id, $request ) {
   $account     = new Entity\Account();
   $account->id = $user_id

   $following[] = $account;

   return $following;
} );

## Parameters

- *`array`* `$following` The account following.
- *`string`* `$user_id` The user ID.
- *`WP_REST_Request`* `$request` The request object.

## Returns

`array` The modified account following.

## Files

- [includes/class-mastodon-api.php:2772](https://github.com/akirk/enable-mastodon-apps/blob/main/includes/class-mastodon-api.php#L2772)
```php
\apply_filters( 'mastodon_api_account_following', array(), $user_id, $request )

Hooks

Clone this wiki locally