You are here

function fonts_com_delete_domain in @font-your-face 7.2

Deletes a single domain in a project.

1 call to fonts_com_delete_domain()
fonts_com_save_domains_in_project in modules/fonts_com/api.inc
Saves list of domains in a given project.

File

modules/fonts_com/api.inc, line 309
API functions.

Code

function fonts_com_delete_domain($project_id, $domain_id) {
  $path = '/rest/json/Domains/?wfspid=' . $project_id . '&wfsdomain_id=' . $domain_id;
  $response = drupal_http_request(FONTS_COM_API_BASE_URL . $path, array(
    'headers' => fonts_com_api_headers($path),
    'method' => 'DELETE',
  ));
  if ($response->code == 200) {
    return TRUE;
  }
  else {
    drupal_set_message(t('There was an error deleting a domain (@domain) in a project (@project) on Fonts.com.', array(
      '@domain' => $domain_id,
      '@project' => $project_id,
    )), 'error');
    fontyourface_log('Invalid drupal_http_request response: @response', array(
      '@response' => print_r($response, TRUE),
    ));
  }

  // else
  return FALSE;
}