Habari\Theme::get_url PHP Метод

get_url() публичный Метод

Get the URL for a resource in one of the directories used by the active theme, child theme directory first
public get_url ( boolean | string $resource = false, boolean $overrideok = true ) : string
$resource boolean | string The resource name
$overrideok boolean If false, find only the parent theme resources
Результат string The URL of the requested resource
    public function get_url($resource = false, $overrideok = true)
    {
        $url = false;
        $theme = '';
        $themedirs = $this->theme_dir;
        if (!$overrideok) {
            $themedirs = reset($this->theme_dir);
        }
        foreach ($themedirs as $dir) {
            if (file_exists(Utils::end_in_slash($dir) . trim($resource, '/'))) {
                $url = $this->dir_to_url(Utils::end_in_slash($dir) . trim($resource, '/'));
                break;
            }
        }
        $url = Plugins::filter('site_url_theme', $url, $theme);
        return $url;
    }