You are here

function flag_content_enabled in Flag 5

Same name and namespace in other branches
  1. 6 flag.module \flag_content_enabled()

Content type checking to see if a flag applies to a certain type of data.

Parameters

$flag: The flag object whose available types are being checked.

$content_type: The type of content being checked, usually "node".

$content_subtype: The subtype (node type) being checked.

Return value

Boolean TRUE if the flag is enabled for this type and subtype. FALSE otherwise.

2 calls to flag_content_enabled()
flag_field_handler_ops in includes/flag.views.inc
Handler that prints the proper operations for a flag.
flag_get_flags in ./flag.module
List all flags available.

File

./flag.module, line 126
The Flag module.

Code

function flag_content_enabled($flag, $content_type, $content_subtype = NULL) {
  $return = $flag->content_type == $content_type && (!isset($content_subtype) || in_array($content_subtype, $flag->types));
  return $return;
}