You are here

function _flag_content_enabled in Flag 7.2

Same name and namespace in other branches
  1. 6.2 flag.module \_flag_content_enabled()

Utility function: Checks whether a flag applies to a certain type, and possibly subtype, of content.

Parameters

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

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

Return value

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

1 call to _flag_content_enabled()
flag_get_flags in ./flag.module
List all flags available.

File

./flag.module, line 1755
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;
}