mirror of
https://git.tt-rss.org/fox/tt-rss.git
synced 2025-10-12 19:41:04 +02:00
order_to_override_query: allow HOOK_HEADLINES_CUSTOM_SORT_OVERRIDE plugins to override built-in sorting
This commit is contained in:
parent
67f02e2aa7
commit
a922b3cc6d
@ -2339,6 +2339,12 @@ class Feeds extends Handler_Protected {
|
|||||||
$query = "";
|
$query = "";
|
||||||
$skip_first_id = false;
|
$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) {
|
switch ($order) {
|
||||||
case "title":
|
case "title":
|
||||||
$query = "ttrss_entries.title, date_entered, updated";
|
$query = "ttrss_entries.title, date_entered, updated";
|
||||||
@ -2352,13 +2358,6 @@ class Feeds extends Handler_Protected {
|
|||||||
break;
|
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];
|
return [$query, $skip_first_id];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user