Call to undefined function entity_create() i try to include a node creation form by a field attach form. So i try to load the entity of a custom content type created by the back-office with is called 'friterie'. But when i call the entity_create function i get this error : Call to undefined function entity_create() 

Here is my code :

function fritr_register_friterie_form($form, &amp;$form_state) {
    $form = array();

    // INCLUDE FRITERIE ADD FORM
    $form['friterie'] = array();
    //module_load_include('inc', 'node', 'node.pages'); this is an old method
    //$form['friterie'] = node_add('friterie');    
    global $language;
    $entity = entity_create('node', array('type' =&gt; 'friterie', 'language' =&gt; $language-&gt;language));
    //$form['friterie'] = field_attach_form('node', $entity, $form['friterie'], $form_state);

    // INCLUDE USER REGISTER FORM
    //$form['user'] = drupal_get_form('user_register_form');


    $form['submit'] = array(
        '#type' =&gt; 'submit',
        '#value' =&gt; t('Enregistrer la friterie'),
    );        

    dsm($form);
    return $form;
}


I don't know why i get this error, i watch on the official documentation and it says i can do it like i did :/
As Gulok said, check if the module entity is installed and enabled.

Be sure to add entity as a depencencie in your .info file as well.