'Main', 'footer' => 'Footer', ]); } /** * wp_enqueue_scripts callback */ public function enqueueScripts() { $this->enqueueStyle('theme', 'index.css'); $this->enqueueScript('theme', 'index.js', ['jquery'], true); } /** * @param array $context * * @return mixed */ public function addToContext($context) { $context['site'] = $this; $context['menu'] = []; foreach (get_registered_nav_menus() as $location => $name) { $context['menu'][$location] = new Menu($location); } return $context; } /** * @param Environment $twig * * @return Environment */ public function addToTwig(Environment $twig) { $twig->addExtension(new StringLoaderExtension()); $twig->addFunction(new TwigFunction('assets_url', [$this, 'assetsUrl'])); return $twig; } }