Collections functions
General functions
Node functions
Render functions
Theme permission functions
User 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 5779 to 5797

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 
is_null($collection["parent"]) ? null : (int) $collection["parent"];
    }

This article was last updated 29th May 2024 11:35 Europe/London time based on the source file dated 16th May 2024 18:10 Europe/London time.