-
Notifications
You must be signed in to change notification settings - Fork 85
activitypub_pre_get_by_id
github-actions[bot] edited this page Mar 31, 2026
·
1 revision
Filter the actor before resolving by ID.
Allows third-party plugins to register custom virtual actors
resolved by ID, mirroring the activitypub_pre_get_by_username
filter for username lookups.
/**
* Filter the actor before resolving by ID.
*
* Allows third-party plugins to register custom virtual actors
* resolved by ID, mirroring the `activitypub_pre_get_by_username`
* filter for username lookups.
*
* @param null $pre
* @param int $user_id
* @return null The filtered value.
*/
function my_activitypub_pre_get_by_id_callback( null $pre, int $user_id ) {
// Your code here.
return $pre;
}
add_filter( 'activitypub_pre_get_by_id', 'my_activitypub_pre_get_by_id_callback', 10, 2 );-
null$preThe pre-existing value. -
int$user_idThe user ID.
\apply_filters( 'activitypub_pre_get_by_id', null, $user_id )Follow @activitypub.blog@activitypub.blog for updates and news.