Change record status: 
Project: 
Introduced in branch: 
7.x-3.x
Description: 

hook_flag() has been split into hook_flag_flag() and hook_flag_unflag().

The $op parameter removed, as it is now reduntant.

The parameter $flagging has been added for the flagging entity that has just been created, or is about to be deleted.

Before:

mymodule_flag($action, $flag, $content_id, $account) {
  if ($action == 'flag') { // Or $action == 'unflag'.
    // Do something in response to the flagging.
  }

  if ($flag->name == 'yourflagname') {
    //Do something if the flag is "yourflagname". Example "Bookmark".
  }

After:

mymodule_flag_flag($flag, $content_id, $account, $flagging) {
  // Do something in response to the flagging.
}

mymodule_flag_unflag($flag, $content_id, $account, $flagging) {
  // Do something in response to the unflagging.
}

See also the change record for the order of events for unflagging: http://drupal.org/node/1736314

Impacts: 
Module developers