How do I get a view of all flaggable nodes? I have a custom flag defined only on certain content types and I want to make a convenient list of all nodes that the flag is being displayed on, that is, nodes of all the content types that the flag is defined on.
If these content types are never going to change, the quick and dirty would be to just create a View filtering on those content types.

If this is not the case, then you are going to have to get down into some coding as I am not aware of any built in Views/Flags integration on this level.  Sure, you can list all flagged or not flagged content, but I don't see a way to list flaggable content.

So, to get the node types, you should be able to do something like this:

$flag=flag_get_flag('NAME_OF_THE_FLAG');


and now

$types=$flag-&gt;types;


should be an array of node types this flag can be applied to.  So now you need to tell Views about this.

So, using the quick and dirty View created above, you could then alter it up with something along these lines:

function YOURMODULE_views_pre_view(&amp;$view, &amp;$display_id, &amp;$args) {

  if ($view-&gt;name=='NAME_OF_THE_VIEW') {

    $flag=flag_get_flag('NAME_OF_THE_FLAG');

    $filters = $view-&gt;display_handler-&gt;get_option('filters');
    // you may want to dpm() or drupal_set_message() or watchdog() or otherwise look at $filter to see what you have to deal with on your system
    $filters['type']['value'] = $flag-&gt;types;

    $overrides = array();
    $overrides['filters'] = $filters;

    foreach ($overrides as $option =&gt; $definition) {
      $view-&gt;display_handler-&gt;override_option($option, $definition);
    }

  }

}


which on my box here, changes the types filtered to those in the flag.

Your $flag and $filters may/will most probably vary, so check to see what you have to work with as these are the broad strokes.

Lots of information about flags here: Flag 3.x PHP API

Information about Views hooks here:  Views Hooks