Last active
September 28, 2016 13:25
-
-
Save lcube45/d8477b1be042cefd8fbb334d97302b6f to your computer and use it in GitHub Desktop.
Drupal 7 - embed node form
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
function my_custom_form_callback($type = 'page') { | |
global $user; | |
module_load_include('inc', 'node', 'node.pages'); | |
$node = (object) array( | |
'uid' => $user->uid, | |
'name' => (isset($user->name) ? $user->name : ''), | |
'type' => $type, | |
'language' => LANGUAGE_NONE | |
); | |
$form = drupal_get_form($type . '_node_form', $node); | |
return $form; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment