Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video functions
Resource functions

validate_collection_parent()

Description

Validate a collection parent value

Parameters

ColumnTypeDefaultDescription
$c int|array Collection ref -or- collection data as returned by {@see get_collection()}

Return

null|integer

Location

include/collections_functions.php lines 4653 to 4671

Definition

 
function validate_collection_parent($c)
    {
    if(!
is_array($c) && !is_int($c))
        {
        return 
null;
        }
    
    
$collection $c;
    if(!
is_array($c) && is_int($c))
        {
        
$collection get_collection($c);
        if(
$collection === false)
            {
            return 
null;
            }
        }

    return (
trim($collection["parent"]) == "" null : (int) $collection["parent"]);
    }

This article was last updated 20th January 2021 18:05 Europe/London time based on the source file dated 19th January 2021 16:15 Europe/London time.