function _token_example_get_taxonomy_term

Builds a list of available taxonomy terms.

Related topics

File

token_example/token_example.module, line 205

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;
}