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 5778 to 5796

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 19th March 2024 02:05 Europe/London time based on the source file dated 15th March 2024 17:00 Europe/London time.