You are here

function fonts_com_delete_font_from_project in @font-your-face 7.2

Deletes font from project.

1 call to fonts_com_delete_font_from_project()
fonts_com_fontyourface_disable in modules/fonts_com/fonts_com.module
Implements hook_fontyourface_disable().

File

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

Code

function fonts_com_delete_font_from_project($font_id, $project_id) {
  $path = '/rest/json/Fonts/?wfspid=' . $project_id . '&wfsfid=' . $font_id;
  $response = drupal_http_request(FONTS_COM_API_BASE_URL . $path, array(
    'headers' => fonts_com_api_headers($path),
    'method' => 'DELETE',
  ));
  if ($response->code == 200) {
    fonts_com_publish();
    return TRUE;
  }
  else {
    drupal_set_message(t('There was an error disabling the font on Fonts.com.'), 'error');
    fontyourface_log('Invalid drupal_http_request response: @response', array(
      '@response' => print_r($response, TRUE),
    ));
  }

  // else
  return FALSE;
}