Skip to content

activitypub_pre_resolve_public_host

github-actions[bot] edited this page Jun 10, 2026 · 2 revisions

Filters the resolved addresses for a hostname before validation.

Returning a non-null array of array{ipv4: string[], ipv6: string[]} skips the DNS lookup. Tests use this to exercise the validation/preference logic without making real DNS queries; production code should leave it null.

Auto-generated Example

/**
 * Filters the resolved addresses for a hostname before validation.
 * 
 * Returning a non-null array of `array{ipv4: string[], ipv6: string[]}` skips
 * the DNS lookup. Tests use this to exercise the validation/preference logic
 * without making real DNS queries; production code should leave it null.
 *
 * @param Activitypub\array{ipv4: $string[], 
 * @param string                  $host 
 * @return Activitypub\array{ipv4: The filtered value.
 */
function my_activitypub_pre_resolve_public_host_callback( Activitypub\array{ipv4: string[],, string $host ) {
    // Your code here.
    return string[],;
}
add_filter( 'activitypub_pre_resolve_public_host', 'my_activitypub_pre_resolve_public_host_callback', 10, 2 );

Parameters

  • Activitypub\array{ipv4: string[], ipv6: string[]}|null $pre Pre-resolved addresses, or null to perform DNS lookup.
  • string $host The hostname being resolved.

Files

\apply_filters( 'activitypub_pre_resolve_public_host', null, $host )

← All Hooks

Users

Developers

Clone this wiki locally