Check if the user has flagged content with any flag It is possible with the following code to check if a content has been flagged by the current user with a certain flag:
$flag = flag_get_flag('flag_name');
if ($flag &amp;&amp; $flag-&gt;is_flagged($node-&gt;nid, $GLOBALS['user']-&gt;uid)) {
  print &quot;This node is flagged&quot;;
}

But, how to check if the user has flagged content with any flag ?
The flag module has a utility function flag_get_flags() that retrieves multiple flags, with an option to filter on the entity type of the flag:
// Same logic, looped over multiple node flags:
$flags = flag_get_flags('node')
foreach ($flags as $flag_name =&gt; $flag) {
  if ($flag &amp;&amp; $flag-&gt;is_flagged($node-&gt;nid, $GLOBALS['user']-&gt;uid)) {
    print &quot;This node is flagged&quot;;
  }
}