function fonts_com_add_selector_to_project in @font-your-face 7.2
Adds selector to project.
1 call to fonts_com_add_selector_to_project()
- fonts_com_set_font_selector in modules/
fonts_com/ api.inc - Sets selector on font.
File
- modules/
fonts_com/ api.inc, line 593 - API functions.
Code
function fonts_com_add_selector_to_project($project_id, $selector) {
$path = '/rest/json/Selectors/?wfspid=' . $project_id;
$response = drupal_http_request(FONTS_COM_API_BASE_URL . $path, array(
'headers' => fonts_com_api_headers($path),
'method' => 'POST',
'data' => 'wfsselector_tag=' . urlencode($selector),
));
if ($response->code == 200) {
return TRUE;
}
else {
drupal_set_message(t('There was an error adding a CSS selector on Fonts.com.'), 'error');
fontyourface_log('Invalid drupal_http_request response: @response', array(
'@response' => print_r($response, TRUE),
));
}
// else
return FALSE;
}