Collections functions
General functions
Node functions
Render functions
Theme permission functions
User functions
Resource functions

node_orderby_comparator()

Description

Comparator function for uasort to allow sorting of node array by order_by field


<0 means $n1 less than $n2
>0 means $n1 greater than $n2

Parameters

ColumnTypeDefaultDescription
$n1 array Node one to compare
$n2 string Node two to compare

Return

0 means $n1 equals $n2

Location

include/node_functions.php lines 2006 to 2009

Definition

 
function node_orderby_comparator($n1$n2)
    {
    return 
$n1["order_by"] - $n2["order_by"];
    }

This article was last updated 19th March 2024 04:35 Europe/London time based on the source file dated 15th March 2024 17:00 Europe/London time.