Hook_form_alter in Views header PHP code I have a content type called 'Checklist' which I bring forward using Views, in it's node-edit form.

I wrote PHP code within the header in order to do this, here it is:

&lt;?php 

    $view = views_get_current_view();
    $arg0 = $view-&gt;args[0];

    $nodeToLoad = $view-&gt;result[0]-&gt;nid; //I get the node to load from Fields within my view
    module_load_include('inc', 'node', 'node.pages');

    $node = node_load($nodeToLoad);
    dsm($nodeToLoad);
    $edit_page = drupal_get_form('page_node_form', $node);

    $edit_page['additional_settings']['#access'] = FALSE;
    $edit_page['buttons']['submit']['#submit'][] = 'redirect_submit';
    print drupal_render($edit_page );

    function redirect_submit($form, &amp;$form_state){
        $form_state['redirect'] = 'www.google.com';
    }
?&gt;


I'd like to remove the 'Delete' button of this form(which normally deletes the content).
I have read that this is easily done with hook_form_alter() but my code resides within the header of a View and I'd like to keep it that way.

Is there a way to do this?
Found a solution, but if there is a better way I'd like to hear more.

$edit_page['actions']['delete']=false; //removed delete button
$edit_page['title']=false; //removed title display as well