Skip to content

activitypub_should_cache_url

github-actions[bot] edited this page Feb 11, 2026 · 1 revision

Filters whether a URL should be cached.

Allows preventing specific URLs from being downloaded and cached. Return false to skip caching this URL.

Auto-generated Example

/**
 * Filters whether a URL should be cached.
 * 
 * Allows preventing specific URLs from being downloaded and cached.
 * Return false to skip caching this URL.
 *
 * @param bool   $should_cache 
 * @param string $url 
 * @param mixed $string_type_the_cache_type 
 * @return bool The filtered value.
 */
function my_activitypub_should_cache_url_callback( bool $should_cache, string $url, $string_type_the_cache_type ) {
    // Your code here.
    return $should_cache;
}
add_filter( 'activitypub_should_cache_url', 'my_activitypub_should_cache_url_callback', 10, 3 );

Parameters

  • bool $should_cache Whether to cache this URL. Default true.
  • string $url The remote URL.
  • $string_type_the_cache_type Other variable names: $type

Files

\apply_filters( 'activitypub_should_cache_url', true, $url, $type )

← All Hooks

Users

Developers

Clone this wiki locally