-
Notifications
You must be signed in to change notification settings - Fork 90
activitypub_user_can_act_as_blog
github-actions[bot] edited this page Jul 10, 2026
·
3 revisions
Filters whether the current user is allowed to act as the blog actor.
Defaults to true for users with the manage_options capability (administrators).
Filter to broaden the allow-list, for example to editors on multi-author sites.
Security note: returning a static true (e.g. via __return_true) grants
EVERY authenticated user the right to post as, read private outbox items of,
and view stats for the blog actor. Always inspect the current user inside
the callback (current_user_can(), role, allowlist) before returning true.
/**
* Filters whether the current user is allowed to act as the blog actor.
*
* Defaults to true for users with the `manage_options` capability (administrators).
* Filter to broaden the allow-list, for example to editors on multi-author sites.
*
* Security note: returning a static `true` (e.g. via `__return_true`) grants
* EVERY authenticated user the right to post as, read private outbox items of,
* and view stats for the blog actor. Always inspect the current user inside
* the callback (`current_user_can()`, role, allowlist) before returning `true`.
*
* @param bool $can_act_as_blog
* @return bool The filtered value.
*/
function my_activitypub_user_can_act_as_blog_callback( bool $can_act_as_blog ) {
// Your code here.
return $can_act_as_blog;
}
add_filter( 'activitypub_user_can_act_as_blog', 'my_activitypub_user_can_act_as_blog_callback' );-
bool$can_act_as_blogWhether the current user can act as the blog actor.
\apply_filters( 'activitypub_user_can_act_as_blog', \current_user_can( 'manage_options' ) )Follow @activitypub.blog@activitypub.blog for updates and news.