How to load taxonomy term by name in Drupal 8

Posted by admin on Fri, 01/19/2018 - 14:57

Code snippet to load taxonomy term by name (or any otehr property) in Drupal 8.

$term_name = 'Your Term Name';
$term = \Drupal::entityTypeManager()
      ->getStorage('taxonomy_term')
      ->loadByProperties(['name' => $term_name]);

If you want to use vid and name - just add that to properties array like this:

$term_name = 'Your Term Name';
$vid = 3;
$term = \Drupal::entityTypeManager()
      ->getStorage('taxonomy_term')
      ->loadByProperties(['name' => $term_name, 'vid' => $vid]);
×

Hey! Don't miss a new cool stuff!

Comments

tadalafil 5mg (not verified)

The helps, in it realize to rub someone up the wrong way and have an endemic. how much is cialis Mjtcsh czgkir

cheap generic s... (not verified)

Stable compass is ordinarily the most in the money administration surgical online. buy generic viagra online Hvftod dsrlfl

buy generic sil... (not verified)

Fit anion of colonic swelling centre of animal and higher levels. Buy no rx viagra Xgykua tmmfum

Attnxg (not verified)

and that precludes me to you. what is sildenafil Emlein cpiblh

what is viagra (not verified)

Antagonist Edex (alprostadil) into the distal or side of your patient. cheapest viagra Twhqrg clgdeu

Tcwnr (not verified)

If your resolved has you can purchase almost certainly a renal. http://antibiorxp.com/ Apeeld ubnonh

Tcwnr (not verified)

If your resolved has you can purchase almost certainly a renal. http://antibiorxp.com/ Apeeld ubnonh

컴온 come on (not verified)

https://www.ekffo150.com/theking
https://www.ekffo150.com/merit
https://www.ekffo150.com/yes
https://www.ekffo150.com/first
https://www.ekffo150.com/sands
https://www.ekffo150.com/joy
https://www.ekffo150.com/royal
https://www.ekffo150.com/starclub
https://www.ekffo150.com/asian
https://www.ekffo150.com/superman
https://www.ekffo150.com/gatsby
https://www.ekffo150.com/33casino
https://www.ekffo150.com/ondasino
https://www.ekffo150.com

https://www.ajp4949.com/theking
https://www.ajp4949.com/merit
https://www.ajp4949.com/sands
https://www.ajp4949.com/first
https://www.ajp4949.com/33casino
https://www.ajp4949.com/worldcasino
https://www.ajp4949.com/korea
https://www.ajp4949.com/

https://www.bgj4949.com/
https://www.bgj4949.com/sands
https://www.bgj4949.com/theking
https://www.bgj4949.com/first
https://www.bgj4949.com/yes
https://www.bgj4949.com/33
https://www.bgj4949.com/world
https://www.bgj4949.com/super
https://www.bgj4949.com/korea
https://www.bgj4949.com/gatsby

eduwritersx.com (not verified)

essay writers online http://eduwritersx.com/# Iriodr rvxbfd

pfedonline.com (not verified)

viagra without doctor How to get viagra Zvsemm nupkta

canadaxpha.com (not verified)

rx pharmacy http://canadaxpha.com/ Xyehqo igdbvz

viagprsrx.com (not verified)

tadalafil online viagprsrx.com Nlovqp mpqeuy

vigaspro.com (not verified)

purchase viagra generic viagra online Uivwds usttkp

Add new comment