sam
(Sam Saffron)
March 30, 2025, 10:52pm
2
I am confused about this report.
# frozen_string_literal: true
# name: discourse-categories-suppressed
# about: Suppress categories from latest topics page.
# version: 0.1
# url: https://github.com/vinothkannans/discourse-categories-suppressed
after_initialize do
if TopicQuery.respond_to?(:results_filter_callbacks)
remove_suppressed_category_topics =
Proc.new do |list_type, result, user, options|
category_ids =
(SiteSetting.categories_suppressed_from_latest.presence || "").split("|").map(&:to_i)
if category_ids.blank? || list_type != :latest || options[:category] || options[:tags]
result
else
result.where("topics.category_id NOT IN (#{category_ids.join(",")})")
end
end
This file has been truncated. show original
The only thing the plugin does is suppress categories from latest list, it does not touch the topic page at all, this feels like a feature request, you want to hide a category from an admin?
2 Likes