0

I don't understand when I'm suppose to use trash_comment over wp_trash_comment.

What's the difference?

1

Where did you see trash_comment? It is no original WordPress core function, though. Maybe some part of a plugin/theme?

So in short: use wp_trash_comment - if you must.

There is, however, an action called trash_comment. Maybe this is what got you confused...?

3
  • Oh my... so wp_trash_comment isnt even an action? Bah!! – dkl Jan 28 '14 at 12:00
  • I'm a little confused since wp_trash_post seems to be an action that works in my script, but wp_trash_comment doesnt. – dkl Jan 28 '14 at 12:04
  • No, wp_trash_comment is a function that you call (with a comment ID) to trash the comment. And trash_comment is an action (in this very function) that you can use for custom functions to hook in. – tfrommen Jan 28 '14 at 12:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.