Skip to content

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.

Auto-generated Example

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

Parameters

  • array|null $result
  • string $url The URL that would be downloaded.
  • $string_type_the_cache_type Other variable names: $type
    • string $file Path to the downloaded file.
    • string $mime_type The file's MIME type.

Files

\apply_filters( 'activitypub_pre_download_url', null, $url, $type )

← All Hooks

Users

Developers

Clone this wiki locally