I am currently making a node type that will require the creation of several other nodes whenever a page of this type is added. Is there a function that creates a new node automatically?
I couldn't find one in the API, but it seemed like such an obvious feature that I thought I must have missed it...

Comments

heine’s picture

Build a node object then call node_save.

--
The Manual | Troubleshooting FAQ | Tips for posting | Make Backups! | Consider creating a Test site.

cburschka’s picture

Gah, I looked all over the place for "make", "create", "add", but never thought of searching for "save"...

Thanks very much!

--
Arancaytar

earwax’s picture

Can you clarify? Are you saying that I should write my own module and invoke node_save? What if I am not writing my own custom module? Anyway to do this the Drupal way? I am using Drupal 7

ayesh’s picture