FIX: better filter for groups search (PR #14262)

Follow up of https://github.com/discourse/discourse/pull/14216

Allow plugins to register custom filter with block

GitHub

  define_register :groups_callback_for_users_search_controller_action, Hash

Perhaps this will make it clearly what it is used for?

I think the rename should state which controller action it is used for.

I’m wondering if we should prevent the same filter from being registered twice here. Never know when two plugins might decide to use the same name so some protection here will be nice.

Minor note but it’ll make it easier to read if the regexp stuff is extracted into a function that has a name to explain what the regexp is doing.

ups, fixing :slight_smile: