Collections functions
General functions
Render functions
Theme permission functions
Resource functions

validate_tile_style()

Description

Validate the type of dash tile and check that the style provided is valid for it.

Parameters

ColumnTypeDefaultDescription
$type string Tile type name.
$style string Tile style name.

Return

string Will return the style value provided if correct, the first defined style or blank if no styles defined.

Location

include/dash_functions.php lines 1892 to 1914

Definition

 
function validate_tile_style(string $typestring $style
    {
    global 
$tile_styles;
    if (isset(
$tile_styles) && array_key_exists($type$tile_styles))
        {
        if (
count($tile_styles[$type]) === 0)
            {
            return 
'';
            }
        if (
in_array($style,$tile_styles[$type]))
            {
            return 
$style;
            }
        else
            {
            return 
$tile_styles[$type][0];
            }
        }
    else
        {
        return 
'';
        }
    }

This article was last updated 26th September 2022 13:35 Europe/London time based on the source file dated 24th August 2022 16:05 Europe/London time.