Check if the user has flagged content with any flag

Created on 9 August 2020, over 4 years ago
Updated 10 February 2025, 13 days ago

Hi,

How to check if the user has flagged content with any flag?

For example, a user created two lists: "a" and "b". He flags content in the "a" list. In node template it is possible to check if the user has flagged the content, whatever the list used ("a" or "b").

I try with :

$flag = flag_get_flag('fl_template_name');
    if ($flag && $flag->is_flagged($node->nid, $GLOBALS['user']->uid))

But it doesn't work.

Do you know how to do it ?

Thanks in advance

πŸ’¬ Support request
Status

Closed: outdated

Version

3.3

Component

Code

Created by

πŸ‡«πŸ‡·France Paulset

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024