Skip to content

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.

Auto-generated Example

/**
 * 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 );

Parameters

  • bool $store_locally Whether to store attachments locally. Default true.
  • array $activity_object The ActivityPub activity object.
  • int $post_id The post ID.

Files

\apply_filters( 'activitypub_store_attachments_locally', true, $activity_object, $post_id )

← All Hooks

Users

Developers

Clone this wiki locally