I am fetching individual contacts using the following:
function get_member($id) {
$member = array();
require_once $_SERVER['DOCUMENT_ROOT'] . '/wp-content/plugins/civicrm/civicrm.settings.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/wp-content/plugins/civicrm/civicrm/CRM/Core/Config.php';
$config = CRM_Core_Config::singleton( );
require_once $_SERVER['DOCUMENT_ROOT'] . '/wp-content/plugins/civicrm/civicrm/api/api.php';
$contact = civicrm_api('Contact','Get',array('contact_id' => $id, 'version' =>3));
if ($contact) {
$member = $contact['values'][$id];
$member['membership'] = civicrm_membership_contact_get($id);
}
return $member;
}
function civicrm_membership_contact_get($contact) {
$params = array('contact_id' => $contact);
try{
$result = civicrm_api3('Membership', 'get', $params);
$id = $result['id'];
return $result['values'][$id];
} catch (CiviCRM_API3_Exception $e) {
$errorMessage = $e->getMessage();
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
'error' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
}
}
The values array returned has all of my name fields, address fields, job title, employer, email, region... but not my website URL. Screenshot is of the actual contact entry in the Civi admin.
How do I get the Website URL in my data?