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

Jtkhkt b (not verified)
enetibliole (not verified)

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

enetibliole (not verified)

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

inticleni (not verified)

casino bonus codes online casino real money free casino slot games online casino games

inticleni (not verified)

casino bonus codes online casino real money free casino slot games online casino games

enetibliole (not verified)

casino game http://onlinecasinogamespcx.com/ - casino game slots online casino blackjack

enetibliole (not verified)

casino game http://onlinecasinogamespcx.com/ - casino game slots online casino blackjack

inticleni (not verified)

http://onlinecasinosw.com/ slots for real money http://onlinecasinosw.com/ - play slots online real money casino

inticleni (not verified)

http://onlinecasinosw.com/ slots for real money http://onlinecasinosw.com/ - play slots online real money casino

enetibliole (not verified)

online casinos http://onlinecasinogamespcx.com/ casino games free casino games online online casinos

inticleni (not verified)

play online casino play online casino casino online

Monserrate (not verified)

WOW!!! I really enjoy reading your posts and articles alot of enriching stuffs in here.

Big up continue working hard and I will share all this

on facebook and linkedin

My web page: buybestmarijuana.online

inticleni (not verified)

play online casino play online casino casino online

inticleni (not verified)

play online casino play online casino casino online

enetibliole (not verified)

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

inticleni (not verified)

slots games best online casino casino slots free casino games online

inticleni (not verified)

slots games best online casino casino slots free casino games online

enetibliole (not verified)

slots for real money http://onlinecasinogamespcx.com/ - online gambling slots online slots online

inticleni (not verified)

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

inticleni (not verified)

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

enetibliole (not verified)

free casino games casino game free slots slots online

inticleni (not verified)

free online slots free casino slot games online slot games

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

Add new comment