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

inticleni (not verified)

online casino slots http://casinorealmoneyfdr.com/ - online casino gambling casino games casino online slots

enetibliole (not verified)

vegas slots online slots free casino bonus codes online casino real money http://casinoslotsfest.com/ - online casino gambling

inticleni (not verified)

casino real money http://casinorealmoneyfdr.com/ - online casino real money casino slots online casino real money real casino slots

inticleni (not verified)

casino real money http://casinorealmoneyfdr.com/ - online casino real money casino slots online casino real money real casino slots

inticleni (not verified)

casino real money http://casinorealmoneyfdr.com/ - online casino real money casino slots online casino real money real casino slots

Generic viagra us (not verified)

Pjbabm debkxl Sample viagra Real viagra online

Generic viagra us (not verified)

Pjbabm debkxl Sample viagra Real viagra online

enetibliole (not verified)

online slot games online casino online casino bonus

inticleni (not verified)

http://casinorealmoneyfdr.com/ play slots online casino bonus codes slots games free casino games

inticleni (not verified)

http://casinorealmoneyfdr.com/ play slots online casino bonus codes slots games free casino games

inticleni (not verified)

http://casinorealmoneyfdr.com/ play slots online casino bonus codes slots games free casino games

inticleni (not verified)

http://casinorealmoneyfdr.com/ play slots online casino bonus codes slots games free casino games

enetibliole (not verified)

http://casinoslotsfest.com/ online gambling http://casinoslotsfest.com/ - vegas slots online play casino

enetibliole (not verified)

http://casinoslotsfest.com/ online gambling http://casinoslotsfest.com/ - vegas slots online play casino

inticleni (not verified)

gold fish casino slots online casino bonus online casino bonus slots for real money http://casinorealmoneyfdr.com/ - free slots games

enetibliole (not verified)

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

inticleni (not verified)

vegas slots online casino play gold fish casino slots casino play http://casinorealmoneyfdr.com/ - slots games free

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

Add new comment