Collections functions
Encryption functions
General functions
Theme permission functions
Resource functions

get_node_elements()

Description

This function returns an array containing list of values for a selected field, identified by $field_label, in the multidimensional array $nodes

Parameters

ColumnTypeDefaultDescription
$node_values array - list of values for a selected field in the node tree
$nodes array - node tree to parse
$field_label string - node field to retrieve value of and add to array $node_values

Return

array $node_values

Location

include/node_functions.php lines 1689 to 1700

Definition

 
function get_node_elements(array $node_values, array $nodes$field_label)
    {    
    if(isset(
$nodes[0]))
        {
        foreach (
$nodes as $node)
            {
            if (isset(
$node["name"])) array_push($node_values$node[$field_label]) ;      
            
$node_values =  (isset($node["children"])) ? get_node_elements($node_values$node["children"], $field_label)  :  get_node_elements($node_values$node$field_label); 
            }
        }
    return 
$node_values;
    }

This article was last updated 10th July 2020 01:05 Europe/London time based on the source file dated 6th July 2020 18:09 Europe/London time.