function flag_views_flag_default in Flag 6
Same name and namespace in other branches
- 6.2 includes/flag.views.inc \flag_views_flag_default()
- 7.3 includes/views/flag.views.inc \flag_views_flag_default()
- 7.2 includes/flag.views.inc \flag_views_flag_default()
Helper function that gets the first defined flag and returns its name.
3 calls to flag_views_flag_default()
File
- includes/
flag.views.inc, line 247 - Provides support for the Views module.
Code
function flag_views_flag_default($content_type) {
static $default_flag = array();
if (!array_key_exists($content_type, $default_flag)) {
$flag = array_shift(flag_get_flags($content_type));
$default_flag[$content_type] = $flag ? $flag->name : NULL;
}
return $default_flag[$content_type];
}