flag
Drupal 7 flag($action, $flag_name, $content_id, $account = NULL)
Flags or unflags an item.
Parameters
$account: The user on whose behalf to flag. Leave empty for the current user.
Return value
FALSE if some error occured (e.g., user has no permission, flag isn't applicable to the item, etc.), TRUE otherwise.
5 calls to flag()
84 string references to 'flag'
File
- sites/
all/ modules/ flag/ flag.module, line 817 - The Flag module.
Code
function flag($action, $flag_name, $content_id, $account = NULL) {
if (!($flag = flag_get_flag($flag_name))) {
// Flag does not exist.
return FALSE;
}
return $flag->flag($action, $content_id, $account);
}

