function simplenews_issue_fields_remove in Simplenews 7.2
Remove fields for newsletter, status and sent count to a note type.
Parameters
$type: A node type object.
Related topics
File
- ./
simplenews.module, line 805 - Simplenews node handling, sent email, newsletter block and general hooks
Code
function simplenews_issue_fields_remove($type) {
$field_name = variable_get('simplenews_newsletter_field', 'simplenews_newsletter');
$instance = field_info_instance('node', $field_name, $type->type);
if ($instance) {
field_delete_instance($instance);
}
$field_name = variable_get('simplenews_issue_status_field', 'simplenews_issue_status');
$instance = field_info_instance('node', $field_name, $type->type);
if ($instance) {
field_delete_instance($instance);
}
$field_name = variable_get('simplenews_sent_count_field', 'simplenews_sent_count');
$instance = field_info_instance('node', $field_name, $type->type);
if ($instance) {
field_delete_instance($instance);
}
}