Filters the profile picture URL for a contact. By default this returns a Gravatar URL. Use this to substitute a custom avatar source.
apply_filters( 'groundhogg/contact/profile_picture', $url, $contact_id, $contact );
You will receive the default picture URL string, the contact ID integer, and the Contact object.
Example
add_filter( 'groundhogg/contact/profile_picture', 'my_extension_custom_avatar', 10, 3 );
/**
* Use a CRM-stored avatar instead of Gravatar.
*
* @param string $url
* @param int $contact_id
* @param \Groundhogg\Contact $contact
*
* @return string
*/
function my_extension_custom_avatar( $url, $contact_id, $contact ) {
$custom = $contact->get_meta( 'custom_avatar_url' );
return $custom ?: $url;
}
Was this helpful?
Let us know if this document answered your question. Thatβs the only way we can improve.
