Amazon_S3_And_CloudFront::get_attached_file PHP Méthode

get_attached_file() public méthode

Return the S3 URL when the local file is missing unless we know the calling process is and we are happy to copy the file back to the server to be used
public get_attached_file ( string $file, integer $attachment_id ) : string
$file string
$attachment_id integer
Résultat string
    function get_attached_file($file, $attachment_id)
    {
        if (file_exists($file) || !($s3object = $this->is_attachment_served_by_s3($attachment_id))) {
            return $file;
        }
        $url = $this->get_attachment_url($attachment_id);
        // return the URL by default
        $file = apply_filters('as3cf_get_attached_file', $url, $file, $attachment_id, $s3object);
        return $file;
    }
Amazon_S3_And_CloudFront