Skip to content

Instantly share code, notes, and snippets.

@jakelacey2012
Last active April 28, 2016 07:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakelacey2012/2e993538bc854e84458364fd47f5b88a to your computer and use it in GitHub Desktop.
Save jakelacey2012/2e993538bc854e84458364fd47f5b88a to your computer and use it in GitHub Desktop.
(Drupal) Node Add Form Programatically
<?php
/**
* This will fetch and display our node form of a chosen content type.
* @param $type [String] : this is the content type.
* @return $form [array] : form containing elements
*/
function get_node_form($type) {
module_load_include('inc', 'node', 'node.pages');
$form = node_add($type);
return $form;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment