-
Notifications
You must be signed in to change notification settings - Fork 86
activitypub_pre_download_url
github-actions[bot] edited this page Feb 25, 2026
·
2 revisions
Filters the download result before fetching a URL.
Allows short-circuiting the download process by providing a pre-downloaded file path. Useful for testing or when files are already available locally.
/**
* Filters the download result before fetching a URL.
*
* Allows short-circuiting the download process by providing a pre-downloaded
* file path. Useful for testing or when files are already available locally.
*
* @param array $result
* @param string $url
* @param mixed $string_type_the_cache_type
* @return array The filtered value.
*/
function my_activitypub_pre_download_url_callback( array $result = null, string $url, $string_type_the_cache_type ) {
// Your code here.
return null;
}
add_filter( 'activitypub_pre_download_url', 'my_activitypub_pre_download_url_callback', 10, 3 );-
array|null$result -
string$urlThe URL that would be downloaded. -
$string_type_the_cache_typeOther variable names:$type-
string$filePath to the downloaded file. -
string$mime_typeThe file's MIME type.
-
\apply_filters( 'activitypub_pre_download_url', null, $url, $type )Follow @activitypub.blog@activitypub.blog for updates and news.