-
Notifications
You must be signed in to change notification settings - Fork 1
atmosphere_mention_didweb_fallback
github-actions[bot] edited this page Jul 7, 2026
·
1 revision
Filters whether an unresolvable handle falls back to did:web:<handle>.
Resolution can fail either definitively (no _atproto DNS TXT
record and no .well-known/atproto-did) or transiently (a DNS or
HTTPS outage at publish time). By default the mention is left as
plain text: for the overwhelming majority of handles — every
*.bsky.social, for one — the true DID is a did:plc:… served
over the well-known endpoint, so a fabricated did:web:<handle>
would point the facet at a non-existent profile. A site that hosts
did:web accounts (where the handle is the DID authority) can
return true to restore the pre-1.0 fallback and keep the mention
even through a transient resolver blip.
definitive miss from a transient network failure).
/**
* Filters whether an unresolvable handle falls back to `did:web:<handle>`.
*
* Resolution can fail either definitively (no `_atproto` DNS TXT
* record and no `.well-known/atproto-did`) or transiently (a DNS or
* HTTPS outage at publish time). By default the mention is left as
* plain text: for the overwhelming majority of handles — every
* `*.bsky.social`, for one — the true DID is a `did:plc:…` served
* over the well-known endpoint, so a fabricated `did:web:<handle>`
* would point the facet at a non-existent profile. A site that hosts
* `did:web` accounts (where the handle *is* the DID authority) can
* return true to restore the pre-1.0 fallback and keep the mention
* even through a transient resolver blip.
*
*
* definitive miss from a transient network failure).
*
* @param bool $fallback
* @param string $handle
* @param WP_Error $error
* @return bool The filtered value.
*/
function my_atmosphere_mention_didweb_fallback_callback( bool $fallback, string $handle, WP_Error $error ) {
// Your code here.
return $fallback;
}
add_filter( 'atmosphere_mention_didweb_fallback', 'my_atmosphere_mention_didweb_fallback_callback', 10, 3 );-
bool$fallbackWhether to fall back todid:web:<handle>. Default false. -
string$handleThe handle that failed to resolve. -
WP_Error$errorThe resolver error (its code distinguishes a
\apply_filters( 'atmosphere_mention_didweb_fallback', false, $handle, $did )