How do I get the human-readable label of a bundle from a loaded entity.
Lets say I want to get the label of a node of bundle my_article which is “My awesome article”
// Load a node $node = Drupal::entityManager()->getStorage('node')->load(4); print $node->bundle(); // prints the machine-readable name. e.g. 'my_article'. print $node->getEntityType()->getBundleLabel(); // prints 'content type'.
I am only able to get the machine-readable name of the bundle or the Label of entity (“content type”, “taxonomy term”, etc), but how do I get the Label of the bundle?
P.S. I would prefer it to not use deprecated classes/functions
Sponsored by SupremePR