]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - application/LinkDB.php
Add a button to set links as sticky
[github/shaarli/Shaarli.git] / application / LinkDB.php
index cd0f29671f9b199c213b4333e8eeab23eedcadb7..cdd68cfb1bec88e8dffd526e0c8c6a433933344a 100644 (file)
@@ -537,6 +537,9 @@ You use the community supported version of the original Shaarli project, by Seba
         $order = $order === 'ASC' ? -1 : 1;
         // Reorder array by dates.
         usort($this->links, function($a, $b) use ($order) {
+            if (isset($a['sticky']) && isset($b['sticky']) && $a['sticky'] !== $b['sticky']) {
+                return $a['sticky'] ? -1 : 1;
+            }
             return $a['created'] < $b['created'] ? 1 * $order : -1 * $order;
         });