From e85f480e6371b49824a7b0bf9ee58803601d1a83 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Mon, 26 Aug 2019 15:48:37 +0100 Subject: [PATCH] Sort themes before display --- module_index.json | 2 +- modules/feature-theme-gallery.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/module_index.json b/module_index.json index 248c67a..e4ed735 100755 --- a/module_index.json +++ b/module_index.json @@ -155,7 +155,7 @@ "version": "0.1", "author": "Starbeamrainbowlabs", "description": "Adds a theme gallery page and optional automatic theme updates. Contacts a remote server, where IP addresses are stored in automatic server logs for security and attack mitigation purposes.", - "lastupdate": 1566828460, + "lastupdate": 1566830789, "optional": false, "extra_data": [] }, diff --git a/modules/feature-theme-gallery.php b/modules/feature-theme-gallery.php index fa6b3ba..72169ce 100644 --- a/modules/feature-theme-gallery.php +++ b/modules/feature-theme-gallery.php @@ -37,6 +37,10 @@ register_module([ } } + usort($themes_available, function($a, $b) { + return strcmp($a->name, $b->name); + }); + $content = "

Theme Gallery

\n"; foreach($themes_available as $theme) {