Adicione ao seu YOUR_MODULE.module
function YOUR_MODULE_views_data_alter(&$data) {
$opts['title'] = 'Language';
$opts['table'] = 'taxonomy_term_data';
$opts['help'] = 'Taxonomy term language.';
$opts['filter']['handler'] = 'YOUR_MODULE_handler_filter_language';
$data['taxonomy_term_data']['language'] = $opts;
}
Adicione ao seu YOUR_MODULE.info
files[] = views/handlers/filter/YOUR_MODULE_handler_filter_language.inc
Crie o arquivo "views / handlers / filter / YOUR_MODULE_handler_filter_language.inc" dentro do diretório do módulo e coloque o próximo conteúdo:
/**
* @file
* Views handler to filter language by term.
*/
/**
* Filter by submission status
*/
class YOUR_MODULE_handler_filter_language extends views_handler_filter_in_operator {
function get_value_options() {
$languages = array(
'***CURRENT_LANGUAGE***' => t("Current user's language"),
'***DEFAULT_LANGUAGE***' => t("Default site language"),
LANGUAGE_NONE => t('Language neutral'),
);
$this->value_title = t('Language');
$options = array_merge($languages, locale_language_list());
$this->value_options = $options;
}
// '0' won't work as a key for checkboxes.
function value_form(&$form, &$form_state) {
parent::value_form($form, $form_state);
$form['value']['#type'] = 'select';
}
}
Desmarque Todos os caches e Novo critério será exibido.
Ou use meu módulo Akuma Taxonomy