Code to add node add form to a custom block (not working)
For people still having trouble with the above code when using anything AJAX-related (e.g. 500 errors) or simply trying to open up the 'blocks' tab in Panels without some error (e.g. some Entity Translation functions) you might want to try the following module code instead in Drupal 7 (but some parameters may still need to be added for your purposes).

function custom_example_block_info() {

    $blocks['example_node_form'] = array(
       'info' =&gt; t('What an example'), 
    );
    return $blocks; 


}

function custom_example_block_view($delta = ''){

    $block = array();

    switch ($delta) {
        case 'example_node_form':
            global $user;
                        //Note: 'type' is your node content type and 'language' must be included
            $node = (object) array('uid' =&gt; $user-&gt;uid, 'name' =&gt; (isset($user-&gt;name) ? $user-&gt;name : ''), 'type' =&gt; 'example', 'language' =&gt; LANGUAGE_NONE);

            $form_state['build_info']['args'] = array($node);

            form_load_include($form_state, 'inc', 'node', 'node.pages');
            $block['content'] = drupal_build_form('example_node_form', $form_state);

            break;
    }
return $block; 

}


The important difference is that drupal_get_form cannot load the $form_state so we use function form_load_include(&amp;$form_state, $type, $module, $name = NULL) to ensure the include file is loaded whenever the form is processed and function drupal_build_form($form_id, &amp;$form_state) instead of drupal_get_form to pass $form_state. The lines above create the $form_state.