DEV: Introduced topic_query_create_list_topics modifier (#21016)

Introduced a modifier on topic_query to change list while they're created

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
This commit is contained in:
Sérgio Saquetim
2023-04-07 13:01:42 -03:00
committed by GitHub
parent 18470c9195
commit f8fb7ee9f3
2 changed files with 27 additions and 0 deletions

View File

@@ -460,6 +460,8 @@ class TopicQuery
options[:filter] ||= filter
topics ||= default_results(options)
topics = yield(topics) if block_given?
topics =
DiscoursePluginRegistry.apply_modifier(:topic_query_create_list_topics, topics, options, self)
options = options.merge(@options)
if %w[activity default].include?(options[:order] || "activity") && !options[:unordered] &&