How to hide flag link if current user and author are same? I need to hide flag link if the logged in user and the author are same.  Please find below codes.

function MODULE-NAME_views_pre_view(&amp;$view, &amp;$display_id, &amp;$args)
{
    global $user;
    if ($view-&gt;name == 'VIEW-NAME' &amp;&amp; $display_id == 'DISPLAY-ID') {
        $node = node_load(arg(1));
        if($node-&gt;uid == $user-&gt;uid){
            //echo 'hide flag';
        }else{
            //echo 'show flag'; 
        }
    }
}
If it is a flag on nodes, you just need to set "Users may only flag content of others" in the Flag access by content authorship paragraph of the FLAG ACCESS options.