Created
August 8, 2014 07:24
-
-
Save graceman9/fb9110ea00e6dc572c30 to your computer and use it in GitHub Desktop.
Drupal 7: create node_types select options, form api
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// node_types select options | |
$types = node_type_get_types(); | |
foreach($types as $node_type) { | |
$options[$node_type->type] = $node_type->name; | |
} | |
$form['onpay']['onpay_node_types'] = array( | |
'#type' => 'select', | |
'#title' => t('Node types'), | |
'#options' => $options, | |
'#multiple' => TRUE, | |
'#default_value' => variable_get('onpay_node_types', array()); | |
); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment