| 7 token_example.module | _token_example_get_taxonomy_term() |
| 8 token_example.module | _token_example_get_taxonomy_term() |
Builds a list of available taxonomy terms.
Related topics
File
- token_example/
token_example.module, line 199 - An example module showing how to define and use tokens.
Code
function _token_example_get_taxonomy_term() {
$term_query = db_select('taxonomy_term_data', 'ttd');
$term_query->fields('ttd', array('tid', 'name'));
$term_query->range(0, 10);
$term_query->addTag('term_access');
$terms = $term_query->execute()->fetchAllKeyed();
$terms = array_map('check_plain', $terms);
return $terms;
}
Login or register to post comments