I am having a module which declares a content type via hook_node_info(). The module also sets webform as dependency. How can I enable webform for this content type in codes so when my module is enabled, my content type is also webform-enabled.

Thanks!

Comments

quicksketch’s picture

In hook_enable() or hook_install():

$types = variable_get('webform_node_types', array('webform'));
$types[] = 'my_new_type';
variable_set('webform_node_types', $types);
quicksketch’s picture

Status: Active » Closed (fixed)
quicksketch’s picture

Issue summary: View changes

clarify