Load A Node Via URL Alias

Load A Node Via URL Alias

Snippet of code that will load a node object using the URL alias path and get the content type.

 /** @var Drupal\Core\Url $url */
 $url = $variables['url'];
   if ($url instanceof Drupal\Core\Url) {
     $nid = $url->getRouteParameters()['node'];
     /** @var \Drupal\node\Entity\Node $node */
     $node = Node::load($nid);
     if ($node instanceof Node) {
       $type = $node->getType();
     }
   }
Ultimate Cron: Create Jobs

Ultimate Cron: Create Jobs

Update hooks: Run specific hook

Update hooks: Run specific hook