function flag_get_flag in Flag 5
Same name and namespace in other branches
- 6.2 flag.module \flag_get_flag()
- 6 flag.module \flag_get_flag()
- 7.3 flag.module \flag_get_flag()
- 7.2 flag.module \flag_get_flag()
Load a single flag either by name or by flag ID.
Parameters
$name: The the flag name.
$fid: The the flag id.
19 calls to flag_get_flag()
- flag in ./
flag.module - Flags or unflags an item.
- flag_actions_delete_form in ./
flag_actions.module - flag_actions_form in ./
flag_actions.module - Generic configuration form for configuration of flag actions.
- flag_confirm in ./
flag.module - Form for confirming the (un)flagging of a piece of content.
- flag_confirm_submit in ./
flag.module
File
- ./
flag.module, line 878 - The Flag module.
Code
function flag_get_flag($name = NULL, $fid = NULL) {
$flags = flag_get_flags();
if (isset($name)) {
if (isset($flags[$name])) {
return $flags[$name];
}
}
elseif (isset($fid)) {
foreach ($flags as $flag) {
if ($flag->fid == $fid) {
return $flag;
}
}
}
}