diff --git a/flag.module b/flag.module index 5c26b7a..0f2aa27 100644 --- a/flag.module +++ b/flag.module @@ -1825,6 +1825,21 @@ function flag_get_flags($entity_type = NULL, $content_subtype = NULL, $account = } } + $definitions = flag_fetch_definition($entity_type); + foreach ($flags as $flag) { + $method = NULL; + if ($entity_type && isset($definitions['init_callback'])) { + $method = $definitions['init_callback']; + } + elseif (isset($definitions[$flag->entity_type]['init_callback'])) { + $method = $definitions[$flag->entity_type]['init_callback']; + } + + if ($method) { + $flag->$method(); + } + } + // Make a variable copy to filter types and account. $filtered_flags = $flags;