Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • wcms/uw_cfg_common
1 result
Show changes
Commits on Source (2)
......@@ -219,3 +219,22 @@ function uw_fix_tags_array(array $tags, string $content_type): array {
return $tags;
}
/**
* Function to sort array by weight.
*
* @param array $arr
* The array to be sorted.
*
* @return array
* The sorted array.
*/
function uw_sort_array_by_weight(array $arr): array {
// Sort the array by weight.
usort($arr, function ($a, $b) {
return $a['weight'] > $b['weight'];
});
return $arr;
}