Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

Hide category plugin

+2 votes
asked Nov 29 in Plugins by Emre
Hello there,

Users don't want to see a few category questions. I want this plug-in, but the plug-in is faulty and broken. Can someone do this if you want to edit this plugin? I really need this plug-in.

I'm sorry I used the translation. I hope someone can edit this plug-in.


@q2apro @NoahY @Ami @pupi1985 @Arjun Suresh @Scott Vivian

Q2A version: 1.8
commented Nov 29 by Bruno Vandekerkhove
edited Nov 29 by Bruno Vandekerkhove
What's the error? I don't have a Q2A forum anymore so I can't test the plugin with the new version of the core but if necessary I'll quickly set one up. If it's a simple error maybe I can fix it without having to. You can PM me if you want. The plugin was discussed here : http://question2answer.org/qa/54089/how-to-hide-a-category-questions-from-activity-page

Someone used a core hack there but as discussed it's not the preferable way to implement this.
commented Nov 29 by Emre
I will try.
commented Nov 29 by Bruno Vandekerkhove
I tested it out with the new core and it works okay but be sure to remove the '-master' suffix from the plugin's folder name. Otherwise it won't find the functions file.
commented Nov 29 by pupi1985
Oh if that was the issue then it is just a matter of removing that require_once and add this to the qa-plugin.php file:

require_once 'qa-hide-category-functions.php';

No more directory renaming needed :)
commented Nov 29 by Bruno Vandekerkhove
edited Nov 30 by Bruno Vandekerkhove
Ah thanks, didn't know how to avoid hard-coding.

1 Answer

+2 votes
answered Nov 29 by pupi1985
The options you have are to minimally hack the core explicitly or to hack it by means of a huge, and seemingly more elegant, plugin override (this is what the plugin you linked is doing). I get the impression that plugin used to work but when the core changed then it stopped working. That's the thing with plugin overrides.

Here I've explained a possible approach to do this: https://www.question2answer.org/qa/54987
commented Nov 29 by Emre
I will try.