1 taxonomy.module taxonomy_term_load_multiple_by_name($name, $vocabulary_name = NULL)

Try to map a string to an existing term, as for glossary use.

Provides a case-insensitive and trimmed mapping, to maximize the likelihood of a successful match.

Parameters

$name: Name of the term to search for.

$vocabulary_name: (optional) Vocabulary machine name to limit the search. Defaults to NULL.

Return value

An array of matching term objects.:

File

core/modules/taxonomy/taxonomy.module, line 1097
Enables the organization of content into categories.

Code

function taxonomy_term_load_multiple_by_name($name, $vocabulary_name = NULL) {
  $conditions = array('name' => trim($name));
  if (isset($vocabulary_name)) {
    $conditions['vocabulary'] = $vocabulary_name;
  }
  return taxonomy_term_load_multiple(array(), $conditions);
}