You are here

function flag_views_flag_default in Flag 7.2

Same name and namespace in other branches
  1. 6.2 includes/flag.views.inc \flag_views_flag_default()
  2. 6 includes/flag.views.inc \flag_views_flag_default()
  3. 7.3 includes/views/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 248
Provides support for the Views module.

Code

function flag_views_flag_default($content_type) {
  $default_flag =& drupal_static(__FUNCTION__, 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];
}