Apple_Exporter\Components\Component::maybe_bundle_source PHP Method

maybe_bundle_source() protected method

Returns the URL to use based on current setings.
protected maybe_bundle_source ( string $source, string $filename = null ) : string
$source string The path or URL of the resource which is going to be bundled
$filename string The name of the file to be created
return string The URL to use for this asset in the JSON
    protected function maybe_bundle_source($source, $filename = null)
    {
        if ('yes' === $this->get_setting('use_remote_images')) {
            return $source;
        } else {
            if (null === $filename) {
                $filename = \Apple_News::get_filename($source);
            }
            $this->bundle_source($filename, $source);
            return 'bundle://' . $filename;
        }
    }