-
Notifications
You must be signed in to change notification settings - Fork 83
activitypub_store_attachments_locally
github-actions[bot] edited this page Nov 6, 2025
·
1 revision
Filters whether to store attachments locally for incoming ActivityPub posts.
Allows plugins or users to disable local storage of attachments from incoming ActivityPub posts. When disabled, attachments won't be downloaded and stored locally, which can be useful for users with limited webspace.
/**
* Filters whether to store attachments locally for incoming ActivityPub posts.
*
* Allows plugins or users to disable local storage of attachments from
* incoming ActivityPub posts. When disabled, attachments won't be downloaded
* and stored locally, which can be useful for users with limited webspace.
*
* @param bool $store_locally
* @param array $activity_object
* @param int $post_id
* @return bool The filtered value.
*/
function my_activitypub_store_attachments_locally_callback( bool $store_locally, array $activity_object, int $post_id ) {
// Your code here.
return $store_locally;
}
add_filter( 'activitypub_store_attachments_locally', 'my_activitypub_store_attachments_locally_callback', 10, 3 );-
bool$store_locallyWhether to store attachments locally. Default true. -
array$activity_objectThe ActivityPub activity object. -
int$post_idThe post ID.
\apply_filters( 'activitypub_store_attachments_locally', true, $activity_object, $post_id )Follow @[email protected] for updates and news.