Returns a URL or file path for a resource file.

Variable Description Data type Default value
$ref * The ID of the resource or an array of resource IDs. Note: when an array of IDs is passed, make sure the array is a subset of resource IDs grouped by extension, size and other parameters required by get_resource_path() in order to get the expected path returned. Example: if you are requesting the original file path of two resources, an image and a video, and you are requesting extension "jpg" then the video path will be incorrect as that was supposed to have a "mp4" extension instead (or any other video extension). integer
$getfilepath * Should a file path be returned instead of a URL? bit (0 or 1)
$size The ID for the size requested (e.g. "scr" for screen size). Leave empty for the original file. string ""
$generate If the path does not yet exist on disk, create it. bit (0 or 1) 1
$extension The file extension requested. This can be found from the extension property of the search results or resource data queries. string "jpg"
$page Which page to return, in the case of a request for a preview of a multi-page document. Leave empty for the first page. integer 1
$watermarked Fetch a watermarked version of the image? Leave empty for non-watermarked. bit (0 or 1) 0
$alternative The ID of an alternative file to return. Leave empty for the original file. integer -1

Return values

The requested path to the resource file, or false if there was an issue. If Param1 is an array of IDs then the returned value will be an array with resource ID as index and its path as value.