summaryrefslogtreecommitdiff
path: root/classes/feeds.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2020-09-11 07:48:22 +0300
committerAndrew Dolgov <[email protected]>2020-09-11 07:48:22 +0300
commita922b3cc6de3c63fb1d4abe9049d2d6bc5616250 (patch)
tree3c867afb68ada09e18e3c304741ce59ddf702e0f /classes/feeds.php
parent67f02e2aa7b246ef7ca2b2aa4c62e2826327d219 (diff)
order_to_override_query: allow HOOK_HEADLINES_CUSTOM_SORT_OVERRIDE plugins to override built-in sorting
Diffstat (limited to 'classes/feeds.php')
-rwxr-xr-xclasses/feeds.php13
1 files changed, 6 insertions, 7 deletions
diff --git a/classes/feeds.php b/classes/feeds.php
index eb08fc452..55a514cc0 100755
--- a/classes/feeds.php
+++ b/classes/feeds.php
@@ -2339,6 +2339,12 @@ class Feeds extends Handler_Protected {
$query = "";
$skip_first_id = false;
+ foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_HEADLINES_CUSTOM_SORT_OVERRIDE) as $p) {
+ list ($query, $skip_first_id) = $p->hook_headlines_custom_sort_override($order);
+
+ if ($query) return [$query, $skip_first_id];
+ }
+
switch ($order) {
case "title":
$query = "ttrss_entries.title, date_entered, updated";
@@ -2352,13 +2358,6 @@ class Feeds extends Handler_Protected {
break;
}
- if (!$query) {
- foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_HEADLINES_CUSTOM_SORT_OVERRIDE) as $p) {
- list ($query, $skip_first_id) = $p->hook_headlines_custom_sort_override($order);
-
- if ($query) break;
- }
- }
return [$query, $skip_first_id];
}
}