function flag_views_flag_default in Flag 6.2
Same name and namespace in other branches
- 6 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.
1 call to flag_views_flag_default()
- flag_handler_relationship::get_flag in includes/
flag_handler_relationships.inc - Returns the flag object.
File
- includes/
flag.views.inc, line 277 - 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];
}