function simplenews_get_newsletter_field in Simplenews 7.2
Get the fieldname(s) from a content type that hold the newsletter.
Parameters
$bundle_name: The content type of which to return the field.
Return value
field definition Field name of the field containing the newsletter, FALSE if no field is selected.
Related topics
File
- ./
simplenews.module, line 834 - Simplenews node handling, sent email, newsletter block and general hooks
Code
function simplenews_get_newsletter_field($bundle_name) {
$fields_info = field_info_fields();
$field_name = variable_get('simplenews_newsletter_field', 'simplenews_newsletter');
$instances = field_info_instances('node', $bundle_name);
if (isset($instances[$field_name])) {
return $fields_info[$field_name];
}
else {
return FALSE;
}
}