Skip to content

Instantly share code, notes, and snippets.

Created September 18, 2013 16:45
Show Gist options
  • Save anonymous/6611959 to your computer and use it in GitHub Desktop.
Save anonymous/6611959 to your computer and use it in GitHub Desktop.
/**
* Implements hook_views_data_alter().
*/
function feature_user_views_data_alter(&$data) {
// Actions
$data['users']['profession'] = array(
'title' => t('Profession'),
'help' => t('Profession of a user'),
'field' => array(
'handler' => 'views_handler_field_user_profession',
),
'filter' => array(
'handler' => 'views_handler_filter_string',
),
);
// Create joins
$data['users']['table']['join']['taxonomy_term_data'] = array(
'left_field' => 'tid',
'field' => 'profession',
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment