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

enetibliole (not verified)

free slots games casino games online casinos casino online http://onlinecasinogamespcx.com/ - online casino bonus

inticleni (not verified)

http://onlinecasinosw.com/ world class casino slots http://onlinecasinosw.com/ - free casino slot games online gambling

inticleni (not verified)

http://onlinecasinosw.com/ world class casino slots http://onlinecasinosw.com/ - free casino slot games online gambling

enetibliole (not verified)

slots games http://onlinecasinopc.com/ - cashman casino slots online casino gambling casino blackjack

inticleni (not verified)

play online casino http://onlinecasinosw.com/ - online casino games online slots play online casino

enetibliole (not verified)

play slots http://onlinecasinopc.com/ - play online casino casino online slots big fish casino slots for real money

inticleni (not verified)

free casino games online gold fish casino slots casino slots

inticleni (not verified)

free casino games online gold fish casino slots casino slots

enetibliole (not verified)

http://onlinecasinopc.com/ free slots games http://onlinecasinopc.com/ - online casino real money slots online

inticleni (not verified)

online casino bonus online gambling free casino slot games online casino http://onlinecasinosw.com/ - big fish casino

inticleni (not verified)

online casino bonus online gambling free casino slot games online casino http://onlinecasinosw.com/ - big fish casino

enetibliole (not verified)

free online slots free online slots online slots online casino games http://onlinecasinopc.com/ - online slot games

enetibliole (not verified)

free online slots free online slots online slots online casino games http://onlinecasinopc.com/ - online slot games

enetibliole (not verified)

free online slots free online slots online slots online casino games http://onlinecasinopc.com/ - online slot games

inticleni (not verified)

http://playcasinosw.com/ online casino games http://playcasinosw.com/ - real casino slots online slots

enetibliole (not verified)

real casino slots slots for real money play slots online online casino gambling http://onlinecasinopc.com/ - online casino games

enetibliole (not verified)

real casino slots slots for real money play slots online online casino gambling http://onlinecasinopc.com/ - online casino games

inticleni (not verified)

http://playcasinosw.com/ online casino casino real money slots for real money casino game

enetibliole (not verified)

online casino bonus http://onlinecasinopc.com/ online casinos free slots games best online casinos

enetibliole (not verified)

online casino bonus http://onlinecasinopc.com/ online casinos free slots games best online casinos

enetibliole (not verified)

online casino bonus http://onlinecasinopc.com/ online casinos free slots games best online casinos

inticleni (not verified)

vegas casino slots online slots online casino slots slots free

enetibliole (not verified)

best online casino http://onlinecasinopc.com/ - casino game casino real money slots online world class casino slots

enetibliole (not verified)

best online casino http://onlinecasinopc.com/ - casino game casino real money slots online world class casino slots

inticleni (not verified)

play casino http://playcasinosw.com/ - real money casino play slots online best online casinos online slot games

inticleni (not verified)

play casino http://playcasinosw.com/ - real money casino play slots online best online casinos online slot games

enetibliole (not verified)

casino online http://onlinecasinopc.com/ - free casino games real money casino casino online

enetibliole (not verified)

casino online http://onlinecasinopc.com/ - free casino games real money casino casino online

inticleni (not verified)

http://playcasinosw.com/ online casino gambling online casino real money vegas casino slots best online casino

inticleni (not verified)

http://playcasinosw.com/ online casino gambling online casino real money vegas casino slots best online casino

enetibliole (not verified)

slot games free casino games slot games online casino

enetibliole (not verified)

slot games free casino games slot games online casino

enetibliole (not verified)

slot games free casino games slot games online casino

inticleni (not verified)

free slots http://playcasinosw.com/ - online casino online gambling casino online slots free online slots

inticleni (not verified)

free slots http://playcasinosw.com/ - online casino online gambling casino online slots free online slots

enetibliole (not verified)

gold fish casino slots world class casino slots casino games online casino

enetibliole (not verified)

gold fish casino slots world class casino slots casino games online casino

inticleni (not verified)

online slots http://playcasinosw.com/ slot games online casinos free slots

inticleni (not verified)

online slots http://playcasinosw.com/ slot games online casinos free slots

inticleni (not verified)

online slots http://playcasinosw.com/ slot games online casinos free slots

enetibliole (not verified)

casino real money http://casinoplaysw.com/ - slots free gold fish casino slots free casino games online slots games free

enetibliole (not verified)

casino real money http://casinoplaysw.com/ - slots free gold fish casino slots free casino games online slots games free

inticleni (not verified)

casino real money free casino games vegas casino slots cashman casino slots http://playcasinosw.com/ - free casino slot games

inticleni (not verified)

casino real money free casino games vegas casino slots cashman casino slots http://playcasinosw.com/ - free casino slot games

enetibliole (not verified)

http://casinoplaysw.com/ free online slots http://casinoplaysw.com/ - online casino real money real casino slots

enetibliole (not verified)

http://casinoplaysw.com/ free online slots http://casinoplaysw.com/ - online casino real money real casino slots

inticleni (not verified)

http://playcasinosw.com/ online casinos online casino games cashman casino slots casino online

inticleni (not verified)

http://playcasinosw.com/ online casinos online casino games cashman casino slots casino online

enetibliole (not verified)

real money casino http://casinoplaysw.com/ - free casino free online slots casino real money

enetibliole (not verified)

real money casino http://casinoplaysw.com/ - free casino free online slots casino real money

Add new comment