public function pageHeaderVarFunc($var, $pages = null)
    {
        if ($pages === null) {
            $pages = $this->grav['page'];
        }

        // Make sure pages are an array
        if (!\is_array($pages)) {
            $pages = [$pages];
        }

        // Loop over pages and look for header vars
        foreach ($pages as $page) {
            if (\is_string($page)) {
                $page = $this->grav['pages']->find($page);
            }

            if ($page) {
                $header = $page->header();
                if (isset($header->{$var})) {
                    return $header->{$var};
                }
            }
        }

        return null;
    }