Call to undefined function node_mass_update() In hook_form_alter(), I am using the following code.

if ($form_id == 'album_node_form') {
  $form['actions']['unpublish'] = array(
    '#type' =&gt; 'submit',
    '#value' =&gt; t('Unpublish'),
    '#submit' =&gt; array('az_alter_unpublish')
  );

  // …
}


In az_alter_unpublish(), I am using the following code.

function az_alter_unpublish($form, $form_state) {
  $nodes = array();
  // $nodes is an array of node IDs for the nodes I want to unpublish.
  node_mass_update($nodes, array(array('status' =&gt; 0)));

  // …
}


This returns a fatal error.

I read the function documentation, but I can't find out the problem.
The solution for this problem is to include the node.admin.inc file.   

 module_load_include('inc', 'node', 'node.admin');
 node_mass_update($nodes,array(array('status' =&gt; 0)));