Disable delete button on a view under certain conditions I'm very new to Drupal 7. I have an administration screen created in Views to edit/delete my custom content type called events. 

In my custom module, I'd like to disable the delete button under certain conditions. Is there any hook that I can use for this purpose?

The reason I like to do this is to prevent users from deleting 'certain' events.

Inside each user profiles, there is a field that defined which stores that user can edit/view. I like to make it that when people click on the delete button, if that store is not of their stores, they shouldn't be able to delete it, they should get redirected back with an error message. 

Here is the code I have so far: 

function my_modue_form_alter(&amp;$form, &amp;$form_state, $form_id){
    dpm($form);
    dpm($form_id);

    if ($form_id == 'myformid') {
      unset($form['op']);
    }
}


On the /delete screen, it doesn't print out anything. 

Here is a screen shot of how the delete node page looks like: 



And here is how the URL looks like:

http://example.com/node/123/delete?destination=admin/manage-events

Thanks
You need hook form alter: https://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_form_alter/7

You first have to inspect element of the form and get the Form ID. Then use the following to unset the submit button. You will have to print_r() or use devel to output the $form array to find the submit button to unset.

function myModuleName_form_alter(&amp;$form, &amp;$form_state, $form_id){

if ($form_id == 'myformid') {
  unset($form[submit button])
}

}