How can I flag a content programmatically

Public
</> CopyGet raw version
php
  1. $flag = flag_get_flag('flagname');
  2. $flag->flag('flag', $node->nid, user_load($uid), TRUE);

Comments

Darryn's picture

Hello visabhishek is this a question you want answered or is this the answer?