Lets the domain that owns a target type resolve it.
Return null to decline, a WP_Error when the target exists but is not shareable, or an array with url, title and optionally kind, kind_label, excerpt and image. Resolve as a signed-out visitor.
The name is built at runtime: davo_sharing_resolve_ followed by a suffix.
Parameters of davo_sharing_resolve_…
Parameter
Type
Description
$resolved
array<string, mixed>|WP_Error|null
Resolution so far, null when none.
$id
int
Target ID.
add_filter
// $suffix is the part of the name that varies.add_filter( 'davo_sharing_resolve_' . $suffix, 'my_filter_callback', 10, 2 );
/**
* @param array<string, mixed>|WP_Error|null $resolved
* @param int $id
*/functionmy_filter_callback( $resolved, $id ) {
// Change $resolved as needed, then return it.return$resolved;
}
src/domains/sharing/repository.php:58
Note. Generated from the plugin source. Descriptions and parameters are the ones written in the code. The starter code uses the parameter names from those comments, or generic names where there are none, so check them against your use.