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)

cbd oil for sale http://cbdoilusd.com/ buy cbd cbd vape cbd capsules

inticleni (not verified)

cbd oil for sale http://cbdoilusd.com/ buy cbd cbd vape cbd capsules

inticleni (not verified)

http://cbdoilusd.com/ cbd store cbd gummies buy cbd oil online cbd oil for dogs

inticleni (not verified)

cbd oil at walmart http://buycbdoil11.com/ - cannabis oil cbd drops cbd drops

inticleni (not verified)

cbd oil at walmart http://buycbdoil11.com/ - cannabis oil cbd drops cbd drops

inticleni (not verified)

cbd oils http://buycbdoil11.com/ - cbd store cbd cream cbd oil for pain cbd vape

inticleni (not verified)

cbd oils http://buycbdoil11.com/ - cbd store cbd cream cbd oil for pain cbd vape

inticleni (not verified)

http://buycbdoil11.com/ cbd oils http://buycbdoil11.com/ - cbd near me cbd oil

inticleni (not verified)

cbd vape http://buycbdoil11.com/ - cbd gummies cbd cream cbd oil for dogs

inticleni (not verified)

cbd oil for pain http://buycbdoil11.com/ - cbd hemp buy cbd cbd for sale cbd vape

inticleni (not verified)

pure cbd oil buy cbd cbd for dogs hemp oil for pain http://buycbdoil11.com/ - hemp oil for pain

inticleni (not verified)

cbd pills http://cbdoilglk.com/ cbd vape best cbd oil cbd for dogs

inticleni (not verified)

cbd medic cbd oil for pain cbd pills cbd store

inticleni (not verified)

cbd medic cbd oil for pain cbd pills cbd store

inticleni (not verified)

cbd medic cbd oil for pain cbd pills cbd store

inticleni (not verified)

cbd medic cbd oil for pain cbd pills cbd store

inticleni (not verified)

medterra cbd http://cbdoilglk.com/ - cbd oil for pain cbd for sale cbd oil benefits

inticleni (not verified)

cbd for sale http://cbdoilglk.com/ - hemp cbd oil cbd for dogs buy cbd oil online cbd oil

inticleni (not verified)

http://buycbdoilwalm.com/ cbd gummies walmart http://buycbdoilwalm.com/ - cbd store cbd

inticleni (not verified)

http://buycbdoilwalm.com/ cbd gummies walmart http://buycbdoilwalm.com/ - cbd store cbd

inticleni (not verified)

http://buycbdoilwalm.com/ hemp cbd oil cbd drops best cbd oil cbd gummies walmart

inticleni (not verified)

buy cbd oil online hemp oil cbd gummies cbd oil benefits http://buycbdoilwalm.com/ - cbd cream

inticleni (not verified)

pure cbd oil medterra cbd cbd pure cbd oil online

inticleni (not verified)

pure cbd oil medterra cbd cbd pure cbd oil online

inticleni (not verified)

pure cbd oil hemp cbd oil cbd oil at walmart buy hemp oil

inticleni (not verified)

hemp oil for pain http://buycbdoilwalm.com/ - medterra cbd cbd gummies walmart cbd tinctures

inticleni (not verified)

cbd tinctures cbd cream cbd online cdb oils

inticleni (not verified)

hemp oil http://buycbdoilwalm.com/ - hemp oil hemp oil cannabis oil pure cbd oil

inticleni (not verified)

cbd vape http://buycbdoilwalm.com/ - best cbd oil medterra cbd medterra cbd cbd oils

inticleni (not verified)

cbd vape http://buycbdoilwalm.com/ - best cbd oil medterra cbd medterra cbd cbd oils

inticleni (not verified)

cbd vape http://buycbdoilwalm.com/ - best cbd oil medterra cbd medterra cbd cbd oils

inticleni (not verified)

buy cbd oil online http://buycbdoilwalm.com/ hemp cbd cbd oil for sale cbd vape

erection pills ... (not verified)

Qceqmm ybhjrs mens erection pills ed pills for sale

erection pills ... (not verified)

Qceqmm ybhjrs mens erection pills ed pills for sale

inticleni (not verified)

cbd oil store http://buycbdoilonline.us.com/ - buy cbd cbd tinctures cbd oil online buy cbd oil online

enetibliole (not verified)

http://cbdoilrx.us.com/ hemp oil cbd oil online buy cbd oil online cbd tinctures

enetibliole (not verified)

http://cbdoilrx.us.com/ hemp oil cbd oil online buy cbd oil online cbd tinctures

inticleni (not verified)

cbd online http://buycbdoilonline.us.com/ - cannabis oil buy cbd cbd oil benefits cbd oil for sale

inticleni (not verified)

cbd online http://buycbdoilonline.us.com/ - cannabis oil buy cbd cbd oil benefits cbd oil for sale

enetibliole (not verified)

http://cbdoilrx.us.com/ cbd oils http://cbdoilrx.us.com/ - cbd pills cbd oil store

enetibliole (not verified)

http://cbdoilrx.us.com/ cbd oils http://cbdoilrx.us.com/ - cbd pills cbd oil store

inticleni (not verified)

cbd medic http://buycbdoilonline.us.com/ - cbd drops cbd drops cbd products

inticleni (not verified)

buy cbd oil online http://buycbdoilonline.us.com/ - cbd capsules cbd gummies cbd hemp

inticleni (not verified)

cbd capsules cbd for sale cbd oil benefits

inticleni (not verified)

buy cbd oil http://buycbdoilonline.us.com/ - cbd products cbd tinctures cbd oil

ed pills gnc (not verified)

Ojgzlq rvtvqp cheap ed pills generic ed pills

buy ed pills (not verified)

Xmoigp urudkg cheap ed pills male erection pills

erectile dysfun... (not verified)

Hsaijl odejub best ed pills online ed meds online without doctor prescription

gnc ed pills (not verified)

Wzexqk srdmlo cialis canada buy ed pills online

Estherchera (not verified)

Cltzxc keajcl Buy viagra Viagra mail order us

Add new comment