lib/ImageHelper.php
private static function _get_file_url( $base, $subdir, $filename, $absolute ) {
		$url = '';
		if ( self::BASE_UPLOADS == $base ) {
			$upload_dir = wp_upload_dir();
			$url = $upload_dir['baseurl'];
		}
		if ( self::BASE_CONTENT == $base ) {
			$url = content_url();
		}
		if ( !empty($subdir) ) {
			$url .= $subdir;
		}
		$url .= '/'.$filename;
		if ( !$absolute ) {
			$url = str_replace(site_url(), '', $url);
		}
		// $url = TimberURLHelper::remove_double_slashes( $url);
		return $url;
	}
private static function _get_file_url( $base, $subdir, $filename, $absolute ) {
		$url = '';
		if ( self::BASE_UPLOADS == $base ) {
			$upload_dir = wp_upload_dir();
			$url = $upload_dir['baseurl'];
		}
		if ( self::BASE_CONTENT == $base ) {
			$url = content_url();
		}
		if ( !empty($subdir) ) {
			$url .= $subdir;
		}
		$url .= '/'.$filename;
		if ( !$absolute ) {
			$url = str_replace(site_url(), '', $url);
		}
		// $url = TimberURLHelper::remove_double_slashes( $url);
		return $url;
	}
private static function _get_file_url ( $ base , $ subdir , $ filename , $ absolute ) { $ url = '' ; if ( self :: BASE_UPLOADS == $ base ) { $ upload_dir = wp_upload_dir ( ) ; $ url = $ upload_dir [ 'baseurl' ] ; } if ( self :: BASE_CONTENT == $ base ) { $ url = content_url ( ) ; } if ( ! empty ( $ subdir ) ) { $ url .= $ subdir ; } $ url .= '/' . $ filename ; if ( ! $ absolute ) { $ url = str_replace ( site_url ( ) , '' , $ url ) ; } // $url = TimberURLHelper::remove_double_slashes( $url); return $ url ; }
Builds the public URL of a file based on its different components

@param  int    $base     one of self::BASE_UPLOADS, self::BASE_CONTENT to indicate if file is an upload or a content (theme or plugin)
@param  string $subdir   subdirectory in which file is stored, relative to $base root folder
@param  string $filename file name, including extension (but no path)
@param  bool   $absolute should the returned URL be absolute (include protocol+host), or relative
@return string           the URL
Builds the public URL of a file based on its different components