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

Viagra 50 mg (not verified)

Wxnssw wbtawa Viagra 100mg england Canadian healthcare viagra

enetibliole (not verified)

casino games vegas casino slots big fish casino

enetibliole (not verified)

casino games vegas casino slots big fish casino

inticleni (not verified)

http://onlinecasinofbk.com/ free casino slot games http://onlinecasinofbk.com/ - casino game real money casino

inticleni (not verified)

play online casino http://onlinecasinofbk.com/ - online casino games online casinos free casino

enetibliole (not verified)

casino online slots online casinos casino game slots games free http://casinoslotsfest.com/ - casino bonus codes

inticleni (not verified)

http://onlinecasinofbk.com/ slots games http://onlinecasinofbk.com/ - play slots online online casino gambling

inticleni (not verified)

http://onlinecasinofbk.com/ slots games http://onlinecasinofbk.com/ - play slots online online casino gambling

enetibliole (not verified)

slots games casino online slots free

inticleni (not verified)

slots games free gold fish casino slots free casino

inticleni (not verified)

slots games free gold fish casino slots free casino

inticleni (not verified)

slots games free gold fish casino slots free casino

enetibliole (not verified)

slots games casino real money free online slots

inticleni (not verified)

real casino slots play slots online online casino slots

inticleni (not verified)

real casino slots play slots online online casino slots

inticleni (not verified)

real casino slots play slots online online casino slots

inticleni (not verified)

real casino slots play slots online online casino slots

enetibliole (not verified)

slot games http://casinoslotsfest.com/ - slots games casino game slots games casino blackjack

Discount viagra... (not verified)

Egmsqs tvtxou Viagra mail order us Viagra original pfizer order

inticleni (not verified)

slot games play casino casino play online casino slots http://onlinecasinofbk.com/ - slots games

enetibliole (not verified)

vegas slots online http://casinoslotsfest.com/ - cashman casino slots slots online casino game

inticleni (not verified)

casino play vegas slots online online casino

inticleni (not verified)

casino play vegas slots online online casino

enetibliole (not verified)

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

enetibliole (not verified)

casino game http://casinoslotsfest.com/ online slot games best online casinos free slots games

enetibliole (not verified)

casino game http://casinoslotsfest.com/ online slot games best online casinos free slots games

inticleni (not verified)

online casino games free casino slots games

Samples of viagra (not verified)

Ybrmfi fokfiw Discount viagra no rx Viagra best buy

Samples of viagra (not verified)

Ybrmfi fokfiw Discount viagra no rx Viagra best buy

Canadian viagra 50mg (not verified)

Mjohlw toxlau buy viagra 100mg Buy no rx viagra

inticleni (not verified)

world class casino slots http://onlinecasinofbk.com/ - best online casinos play online casino best online casino

inticleni (not verified)

world class casino slots http://onlinecasinofbk.com/ - best online casinos play online casino best online casino

inticleni (not verified)

world class casino slots http://onlinecasinofbk.com/ - best online casinos play online casino best online casino

inticleni (not verified)

world class casino slots http://onlinecasinofbk.com/ - best online casinos play online casino best online casino

Estherchera (not verified)

Cscczh kxxrki sildenafil coupons Best viagra alternative

inticleni (not verified)

real money casino best online casino gold fish casino slots casino blackjack http://onlinecasinofbk.com/ - casino games

inticleni (not verified)

real money casino best online casino gold fish casino slots casino blackjack http://onlinecasinofbk.com/ - casino games

inticleni (not verified)

real money casino best online casino gold fish casino slots casino blackjack http://onlinecasinofbk.com/ - casino games

inticleni (not verified)

best online casinos http://onlinecasinofbk.com/ - casino play online casinos slots games free play slots online

inticleni (not verified)

best online casinos http://onlinecasinofbk.com/ - casino play online casinos slots games free play slots online

inticleni (not verified)

best online casinos http://onlinecasinofbk.com/ - casino play online casinos slots games free play slots online

inticleni (not verified)

best online casinos http://onlinecasinofbk.com/ - casino play online casinos slots games free play slots online

inticleni (not verified)

hemp cbd http://cbdoilusd.com/ - cbd medic hemp oil cbd store cbd drops

inticleni (not verified)

hemp cbd http://cbdoilusd.com/ - cbd medic hemp oil cbd store cbd drops

Estherchera (not verified)

Riflnn qrjgoi Us discount viagra overnight delivery Us viagra

Estherchera (not verified)

Riflnn qrjgoi Us discount viagra overnight delivery Us viagra

inticleni (not verified)

cbd pills http://cbdoilusd.com/ buy cbd oil cbd store cbd oil at walmart

inticleni (not verified)

cbd pills http://cbdoilusd.com/ buy cbd oil cbd store cbd oil at walmart

inticleni (not verified)

best cbd oil cbd capsules cbd gummies walmart cannabis oil

inticleni (not verified)

best cbd oil cbd capsules cbd gummies walmart cannabis oil

Add new comment