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)

slot games vegas casino slots online casino real money big fish casino http://casinogamespqr.com/ - free online slots

inticleni (not verified)

http://casinoslotspc.com/ online casinos casino real money world class casino slots online casino slots

inticleni (not verified)

http://casinoslotspc.com/ online casinos casino real money world class casino slots online casino slots

enetibliole (not verified)

vegas slots online big fish casino slots online online casino http://casinogamespqr.com/ - casino blackjack

inticleni (not verified)

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

enetibliole (not verified)

casino real money best online casinos play slots online

enetibliole (not verified)

casino real money best online casinos play slots online

inticleni (not verified)

http://casinoslotspc.com/ free slots http://casinoslotspc.com/ - casino slots casino games

Brand viagra (not verified)

Ynvwdc wtxsrt canadian viagra online pharmacy Buy discount viagra

enetibliole (not verified)

casino real money http://casinogamespqr.com/ - free casino slot games free online slots best online casino casino blackjack

enetibliole (not verified)

casino real money http://casinogamespqr.com/ - free casino slot games free online slots best online casino casino blackjack

inticleni (not verified)

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

enetibliole (not verified)

vegas casino slots play slots online real casino slots

inticleni (not verified)

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

enetibliole (not verified)

http://casinogamespqr.com/ no deposit casino online slot games big fish casino casino online slots

enetibliole (not verified)

http://casinogamespqr.com/ no deposit casino online slot games big fish casino casino online slots

enetibliole (not verified)

http://casinogamespqr.com/ no deposit casino online slot games big fish casino casino online slots

inticleni (not verified)

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

Best price for ... (not verified)

Ycrzyc wxgqik Real viagra without prescription Buy discount viagra

enetibliole (not verified)

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

enetibliole (not verified)

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

inticleni (not verified)

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

inticleni (not verified)

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

enetibliole (not verified)

casino blackjack http://casinogamespqr.com/ - big fish casino best online casinos slots free gold fish casino slots

inticleni (not verified)

free slots http://casinorealmoneyfdr.com/ vegas casino slots world class casino slots slot games

inticleni (not verified)

free slots http://casinorealmoneyfdr.com/ vegas casino slots world class casino slots slot games

enetibliole (not verified)

online casino slots casino blackjack casino real money

inticleni (not verified)

http://casinorealmoneyfdr.com/ play online casino http://casinorealmoneyfdr.com/ - free casino games online online casino gambling

Order viagra usa (not verified)

Njqodr xkqfow Buy viagra now online Buy viagra in us

enetibliole (not verified)

play casino casino bonus codes best online casinos

inticleni (not verified)

casino games real money casino play online casino free slots

enetibliole (not verified)

online casino real money online casino online casino bonus casino play

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

Add new comment