Collections functions
Encryption functions
General functions
Theme permission functions
Resource functions

get_extension()

Description

Get resource file extension from the database or use JPG, for download

Parameters

ColumnTypeDefaultDescription
$resource array
$size string Preview size as defined in the system

Return

string

Location

include/resource_functions.php lines 6287 to 6305

Definition

 
function get_extension(array $resource$size)
    {
    global 
$job_ext;
    if(
$size == '')
        {
        
$size 'original';
        }

    
// Offline collection download job may have requested a specific file extension
    
$pextension $size == 'original' $resource['file_extension'] : ((isset($job_ext) && trim($job_ext) != "") ? $job_ext 'jpg');

    
$replace_extension hook('replacedownloadextension''', array($resource$pextension));
    if(
trim($replace_extension) !== '')
        {
        return 
$replace_extension;
        }

    return 
$pextension;
    }

This article was last updated 12th July 2020 03:35 Europe/London time based on the source file dated 10th July 2020 16:06 Europe/London time.