Had an answer flagged today because it recommended hacking core.

I will never recommend anyone hack core, and many members of the community have joined me in reiterating the reasons why it's a bad idea. But still, people answer questions with "just edit like 1000 of /wp-includes/...php."

What should we, as a community, do with such answers? Stick with down-voting to discourage them, or have moderators delete them outright to prevent the perpetuation of errant advice on the site?

I'm open to opinions either way.

share
5  
errant advice is precisely the reason that the up/down voting system exists. If an answer is wrong/harmful, it should be downvoted, not deleted. –  Chip Bennett Feb 21 '12 at 15:24
    
I feel the same way, but I wanted to hear what the community had to say before setting a precedent. –  EAMann Feb 21 '12 at 16:28

4 Answers 4

up vote 17 down vote accepted

Each time you change a core file you create a fork. There is nothing wrong with forks – even WordPress started as one.

We should not delete such answers – they may contain good hints for a better solution, or a fork may be just an appropriate option.
We should add a comment pointing out the problems.
I see no need for a voting rule. That’s up to each member.

share
    
I agree 100% and if we really want to leverage this "core hacks" we should direct the them (by comment) to the right pipe lines for making this changes for all users (meaning Wp TRAC), well if we could benefit from this changes anyway. –  Bainternet Feb 21 '12 at 11:24
1  
+1. I see no reason for closing/deleting questions/answers about hacking core files directly. Add comments; downvote answers that involve hacking core when an API could be used instead. No need to delete. We simply need to be less afraid to downvote answers for legitimate reasons. –  Chip Bennett Feb 21 '12 at 15:07
    
@ChipBennett I see your point here. Could we use a tag that could be used to easily identify this type of question in bulk? –  Brian Fegter Feb 21 '12 at 20:23
    
@BrianFegter I like the idea of a tag, even if just for reminding us where the "dangerous" questions/answers are at. Let's start a separate discussion regarding that tag ... –  EAMann Feb 22 '12 at 14:56
    
@EAMann Posted. –  Brian Fegter Feb 22 '12 at 15:13

At the risk of "perpetuation errant advice", I would argue that it might be better to educate the poster than outright delete the response. It would be nice to explain why changing core is a bad idea. Some people do not legitimately get the issue. Perhaps there is a good discussion of this somewhere on WPSE that can be linked to.

Even though "hacking core" is a terrible answer, it could actually be a good point of learning for the OP and subsequent users who stumble upon the question/answer.

I think that a down vote and an explanation is appropriate.

share

If there is a better way, give that answer. If there is no better way, make a patch and post it to trac.

share

Hacking core might be the only way to accomplish a task at all. WordPress used to not have a lot of functionality that it has now, and hacking the core was the only way to do things.

Is it better to have functionality added in a plugin/theme? Absolutely. But if it is impossible, hacking the core files may indeed be a correct answer. It may be a dangerous answer, an answer that may get overwritten, but that does not preclude it being correct.

So, even a downvote might just be a philosophical thumbing of your nose, even if the answer was technically correct.

share
    
I don't think it's thumbing your nose as much as staying true to the scope of this forum. There is a proper place for patches in Trac. –  Brian Fegter Feb 21 '12 at 20:54
    
If a feature/change can only be accomplished through a core hack, then the correct answer is "Submit a patch via Trac," not "hack core." Remember, answers will be read by other people who might not understand how updates work and the danger in following your advice. –  EAMann Feb 21 '12 at 21:03
    
Submitting a patch via Trac STARTS with knowing the specific problem and having a specific answer. The right/wrong of hacking core is not directly correlated to correct/incorrect. It may be correct, but it may be the wrong answer for an inexperienced user. But to the experienced user, it might be the correct answer and not deserving of a downvote just because someone wants to hold someone else's hand. –  Dan Gayle Feb 21 '12 at 21:19
    
Of course, any answer that suggests "hacking core" should make it abundantly clear the consequences, and that submitting a patch via Track is the ideal solution. –  Dan Gayle Feb 21 '12 at 21:21
    
@DanGayle Remember, the answers aren't just meant for the OP. They're archived and indexed and used weeks - even months - down the road by other users with the same or a similar question. Those future visitors might be more or less experienced than the OP. –  EAMann Feb 22 '12 at 14:55
    
That does not make the answer correct or incorrect, however. I would hate to have the answer I was looking for deleted just because moderators assumed that I didn't know what I was doing. –  Dan Gayle Feb 23 '12 at 22:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .