VersionPress\Utils\ArrayUtils::all PHP Method

all() public static method

Determines whether all elements of an array satisfy a condition.
public static all ( array $array, callable $predicate ) : boolean
$array array
$predicate callable
return boolean
    public static function all($array, $predicate)
    {
        foreach ($array as $key => $item) {
            if (!$predicate($item, $key)) {
                return false;
            }
        }
        return true;
    }