Trying to write my own Views filter handler
In your specific case, since "taxonomy_term_hierarchy" already exists in the views data, you want to implement hook_views_data_alter() instead, making your implementation much simpler (untested):

function foo_views_data_alter(&amp;$data) {
  $data['taxonomy_term_hierarchy']['has_children'] = array(
    'title' =&gt; t('Has children terms'),
    'help' =&gt; t('Check if the term has direct children'),
    'filter' =&gt; array(
      'help' =&gt; t('My Help'),
      'handler' =&gt; 'views_handler_filter_term_children',
    ),
  );
}


As far as what filter to extend, a good one might be views_handler_filter_boolean_operator but you can just start from views_handler_filter too.