Can I get the Node's content type in hook_flag_alter In the following code, I'm changing a flag with a short title of "Follow" to include the name of Content Type. Is it possible to add the content type so that I can not say Follow node but perhaps Follow Question, Follow Person, FOllow Group?

function hook_flag_alter(&amp;$flag) {

    //node, taxonomy_term, user,  comment
    $extra_text_of_type = "";
    switch ($flag-&gt;content_type) {
      case 'node': 
        $extra_text_of_type = "node";
        break;
      default: 
    }

    $flag-&gt;flag_short = $flag-&gt;flag_short . ' ' . $extra_text_of_type;
  }
If you're using flag 2.x with Drupal 7, then this should give you what you want.

function hook_flag_alter(&amp;$flag) {
    $type_text = "";
    switch($flag-&gt;entity_type) {
      case 'node':
        switch(reset($flag-&gt;types)) {
          case 'page':
            $type_text = t('Page');
            break;
          case 'blog':
            $type_text = t('Blog Post');
            break;
          default:
            $type_text = t('Node');
        }
        break;
      case 'user':
        $type_text = ('User');
        break;
      default:
    }

    $flag-&gt;flag_short = t('Follow @type', array('@type' =&gt; $type_text));
    $flag-&gt;unflag_short = t('Unfollow @type', array('@type' =&gt; $type_text));
}


Note: This code assumes that each flag only applies for a single content type.