Collections functions
General functions
Render functions
Theme permission functions
Resource functions

get_all_image_sizes()

Parameters

ColumnTypeDefaultDescription
$internal false
$restricted false

Location

include/resource_functions.php lines 7385 to 7404

Definition

 
function get_all_image_sizes($internal=false,$restricted=false)
    {
        
# Returns all image sizes available.
        # Standard image sizes are translated using $lang.  Custom image sizes are i18n translated.

        
$condition=($internal)?"":"WHERE internal!=1";
        if(
$restricted){$condition .= ($condition!=""?" AND ":" WHERE ") . " allow_restricted=1";}

        
# Executes query.
        
$r ps_query("select ref,id,width,height,padtosize,name,internal,allow_preview,allow_restricted,quality from preview_size " $condition " order by width asc"); // $condition does not contain any user entered params and is safe for inclusion

        # Translates image sizes in the newly created array.
        
$return = array();
        for (
$n 0;$n<count($r);$n++) {
            
$r[$n]["name"] = lang_or_i18n_get_translated($r[$n]["name"], "imagesize-");
            
$return[] = $r[$n];
        }
        return 
$return;

    }

This article was last updated 30th September 2022 18:05 Europe/London time based on the source file dated 30th September 2022 14:20 Europe/London time.