LH Contacts has no MCP abilities. Other plugins, including tooling plugins such as LH MCP Contact Abilities, call these methods directly. Methods that return member data check permission inside them, so CardDAV and tooling get the same data under the same rules. Everything works on the current site, so switch to the site first.
| Method | Returns |
|---|---|
return_view_capability() | The capability to see member contacts (publish_posts by default). |
return_signed_download_url( $user_ids, $viewer_id = null ) | A signed, expiring download link for one or more users’ cards, built for the viewer (the current user by default). It works for whoever opens it, so check the capability first. |
return_members_collection_id() | The member address book’s collection ID (members). |
plugin_version() | The version from the plugin header. |
| Method | Returns |
|---|---|
return_card_data( $user_id, $viewer_id = null ) | The card’s field array (after lh_contacts_add_data), or an empty array for an unknown user. Does not check the capability. |
build_card( $user_id, $viewer_id = null ) | The card as vCard 3.0 text, or an empty string. Does not check the capability. |
return_user_uid( $user_id ) | The card’s stable urn:uuid: UID. |
return_viewer_visibility_hash( $viewer_id ) | all, public or a hash of the hidden groups the viewer belongs to. |
| Method | Does |
|---|---|
touch_user( $user_id ) | Marks the user’s card changed on every site they belong to and records it for syncing phones. Call it when something on the card changes that LH Contacts cannot see, as LH User Identity does for aliases. |
return_updated_time( $user_id, $blog_id = null ) | The card’s last-changed time on a site. |
return_blocked_user_ids() | Users blocked on the current site. |
The member address book. Get an instance from the providers LH DAV has registered, or create one with new LH_Contacts_Members_Provider() once LH Contacts has booted. These methods check the capability themselves.
| Method | Returns |
|---|---|
user_can_read( $user_id ) | Whether the user may read the member book on this site. |
get_collections( $user_id ) | The member book’s description, or an empty array if the user cannot read it. |
get_resource_index( $collection_id, $user_id ) | Resource name => ETag for every card, or a WP_Error (404 unknown collection, 403 no access). |
get_resources( $collection_id, $names, $user_id ) | Resource name => vCard text, built for that user. Unknown names are left out. |
put_resource(), delete_resource() | Always a 403 WP_Error: the member book is read-only. |
return_member_ids() | IDs in the member book on this site. |
return_resource_name( $user_id ), return_user_id_from_name( $name ) | Convert between a user ID and {user ID}.vcf. |