Skip to content

Instantly share code, notes, and snippets.

@slivorezka
Created November 8, 2016 16:24
Show Gist options
  • Save slivorezka/beedcca7d4da130440724b7ae3a0ca88 to your computer and use it in GitHub Desktop.
Save slivorezka/beedcca7d4da130440724b7ae3a0ca88 to your computer and use it in GitHub Desktop.
Drupal 8: Load term by name
<?php
// Load term by name
$term = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->loadByProperties(['name' => 'some_name']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment